DATACOUCH-207 - Makes all BeanNames constants public

This commit is contained in:
Simon Baslé
2016-02-22 15:20:47 +01:00
parent 2f251e0ba9
commit 338eb38f46
8 changed files with 71 additions and 36 deletions

View File

@@ -16,10 +16,20 @@
package org.springframework.data.couchbase.config;
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.Cluster;
import com.couchbase.client.java.cluster.ClusterInfo;
import com.couchbase.client.java.env.CouchbaseEnvironment;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.couchbase.core.CouchbaseOperations;
import org.springframework.data.couchbase.core.convert.translation.TranslationService;
/**
* Contains default bean names that will be used when no "id" is supplied to the beans.
* Contains default bean names for Couchbase beans.
*
* These are the names of the beans used by Spring Data Couchbase, unless an explicit id is given to the bean
* either in the xml configuration or the {@link AbstractCouchbaseConfiguration java configuration}.
*
* @author Michael Nitschinger
* @author Simon Baslé
@@ -27,56 +37,75 @@ import org.springframework.core.convert.converter.Converter;
public class BeanNames {
/**
* Refers to the "<couchbase:env />" bean.
* The name for the default {@link CouchbaseEnvironment} bean.
*
* See {@link AbstractCouchbaseConfiguration#couchbaseEnvironment()} for java config, and
* the "<couchbase:env />" element for xml config.
*/
static final String COUCHBASE_ENV = "couchbaseEnv";
/**
* Refers to the "<couchbase:cluster />" bean.
*/
static final String COUCHBASE_CLUSTER = "couchbaseCluster";
public static final String COUCHBASE_ENV = "couchbaseEnv";
/**
* Refers to the "<couchbase:bucket />" bean.
* The name for the default {@link Cluster} bean.
*
* See {@link AbstractCouchbaseConfiguration#couchbaseCluster()} for java config, and
* the "<couchbase:cluster />" element for xml config.
*/
static final String COUCHBASE_BUCKET = "couchbaseBucket";
public static final String COUCHBASE_CLUSTER = "couchbaseCluster";
/**
* Refers to the "<couchbase:template />" bean.
* The name for the default {@link Bucket} bean.
*
* See {@link AbstractCouchbaseConfiguration#couchbaseClient()} for java config, and
* the "<couchbase:bucket />" element for xml config.
*/
static final String COUCHBASE_TEMPLATE = "couchbaseTemplate";
public static final String COUCHBASE_BUCKET = "couchbaseBucket";
/**
* Refers to the "<couchbase:translation-service />" bean
* The name for the default {@link CouchbaseOperations} bean.
*
* See {@link AbstractCouchbaseConfiguration#couchbaseTemplate()} for java config, and
* the "<couchbase:template />" element for xml config.
*/
static final String COUCHBASE_TRANSLATION_SERVICE = "couchbaseTranslationService";
public static final String COUCHBASE_TEMPLATE = "couchbaseTemplate";
/**
* Refers to the "<couchbase:clusterInfo>" bean
* The name for the default {@link TranslationService} bean.
*
* See {@link AbstractCouchbaseConfiguration#translationService()} for java config, and
* the "<couchbase:translation-service />" element for xml config.
*/
static final String COUCHBASE_CLUSTER_INFO = "couchbaseClusterInfo";
public static final String COUCHBASE_TRANSLATION_SERVICE = "couchbaseTranslationService";
/**
* The bean that stores custom mapping between repositories and their backing couchbaseOperations.
* The name for the default {@link ClusterInfo} bean.
*
* See {@link AbstractCouchbaseConfiguration#couchbaseClusterInfo()} for java config, and
* the "<couchbase:clusterInfo />" element for xml config.
*/
public static final String COUCHBASE_CLUSTER_INFO = "couchbaseClusterInfo";
/**
* The name for the bean that stores custom mapping between repositories and their backing couchbaseOperations.
*/
public static final String COUCHBASE_OPERATIONS_MAPPING = "couchbaseRepositoryOperationsMapping";
/**
* The bean that drives how some indexes are automatically created.
* The name for the bean that drives how some indexes are automatically created.
*/
public static final String COUCHBASE_INDEX_MANAGER = "couchbaseIndexManager";
/**
* The bean that performs conversion to/from representation suitable for storage in couchbase.
* The name for the bean that performs conversion to/from representation suitable for storage in couchbase.
*/
public static final String COUCHBASE_MAPPING_CONVERTER = "couchbaseMappingConverter";
/**
* The bean that stores mapping metadata for entities stored in couchbase.
* The name for the bean that stores mapping metadata for entities stored in couchbase.
*/
public static final String COUCHBASE_MAPPING_CONTEXT = "couchbaseMappingContext";
/**
* The bean that registers custom {@link Converter Converters} to encode/decode entity members.
* The name for the bean that registers custom {@link Converter Converters} to encode/decode entity members.
*/
public static final String COUCHBASE_CUSTOM_CONVERSIONS = "couchbaseCustomConversions";
}

View File

@@ -19,6 +19,7 @@ package org.springframework.data.couchbase.repository.config;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Import;
import org.springframework.data.couchbase.config.BeanNames;
import org.springframework.data.couchbase.core.CouchbaseTemplate;
import org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactoryBean;
import org.springframework.data.repository.config.DefaultRepositoryBaseClass;
@@ -112,6 +113,6 @@ public @interface EnableCouchbaseRepositories {
*
* @return
*/
String couchbaseTemplateRef() default "couchbaseTemplate";
String couchbaseTemplateRef() default BeanNames.COUCHBASE_TEMPLATE;
}