Modifier and Type | Field and Description |
---|---|
static String |
AUTO_CREATE_SCHEMA |
static String |
DATASTORE |
static String |
GORA |
static String |
GORA_DEFAULT_DATASTORE_KEY |
static String |
GORA_DEFAULT_PROPERTIES_FILE |
static String |
INPUT_PATH |
static org.slf4j.Logger |
log |
static String |
MAPPING_FILE |
static String |
OUTPUT_PATH |
static Properties |
properties
Deprecated.
|
static String |
SCHEMA_NAME |
Modifier and Type | Method and Description |
---|---|
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
Object auth)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
Object auth,
Properties properties)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
Object auth,
Properties properties,
String schemaName)
Instantiate a new
DataStore . |
static <D extends DataStore<K,T>,K,T extends Persistent> |
createDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistent,
Object auth,
String schemaName)
Instantiate a new
DataStore . |
static Properties |
createProps()
Creates a new
Properties . |
static boolean |
findBooleanProperty(Properties properties,
DataStore<?,?> store,
String baseKey,
String defaultValue)
Asserts whether or not we can find a particular property based on the property
with the given baseKey.
|
static String |
findProperty(Properties properties,
DataStore<?,?> store,
String baseKey,
String defaultValue)
Tries to find a property with the given baseKey.
|
static String |
findPropertyOrDie(Properties properties,
DataStore<?,?> store,
String baseKey)
Tries to find a property with the given baseKey.
|
static boolean |
getAutoCreateSchema(Properties properties,
DataStore<?,?> store)
Asserts whether schema/datamodel autocreation is supported within datastore
initialization.
|
static <D extends DataStore<K,T>,K,T extends Persistent> |
getDataStore(Class<D> dataStoreClass,
Class<K> keyClass,
Class<T> persistentClass,
Object auth)
Instantiate a new
DataStore . |
static <K,T extends Persistent> |
getDataStore(Class<K> keyClass,
Class<T> persistent,
Object auth)
Instantiate the default
DataStore . |
static <K,T extends Persistent> |
getDataStore(String dataStoreClass,
Class<K> keyClass,
Class<T> persistentClass,
Object auth)
Instantiate a new
DataStore . |
static <K,T extends Persistent> |
getDataStore(String dataStoreClass,
String keyClass,
String persistentClass,
Object auth)
Instantiate a new
DataStore . |
static String |
getDefaultSchemaName(Properties properties,
DataStore<?,?> store)
Gets the default schema name of a given store class
|
static String |
getInputPath(Properties properties,
DataStore<?,?> store)
Returns the input path as read from the properties for file-backed data stores.
|
static String |
getMappingFile(Properties properties,
DataStore<?,?> store,
String defaultValue)
Returns a particular instance of an XML mapping file for some particular
properties and datastore.
|
static String |
getOutputPath(Properties properties,
DataStore<?,?> store)
Returns the output path as read from the properties for file-backed data stores.
|
static <D extends DataStore<K,T>,K,T extends Persistent> |
setDefaultSchemaName(Properties properties,
Class<D> dataStoreClass,
String schemaName)
Sets the default schema name to be used by the datastore of the given class
|
static void |
setDefaultSchemaName(Properties properties,
String schemaName)
Sets the default schema name.
|
public static final org.slf4j.Logger log
public static final String GORA_DEFAULT_PROPERTIES_FILE
public static final String GORA_DEFAULT_DATASTORE_KEY
public static final String GORA
public static final String DATASTORE
public static final String AUTO_CREATE_SCHEMA
public static final String INPUT_PATH
public static final String OUTPUT_PATH
public static final String MAPPING_FILE
public static final String SCHEMA_NAME
@Deprecated public static final Properties properties
createProps()
instead.public static Properties createProps()
Properties
. It adds the default gora configuration
resources. This properties object can be modified and used to instantiate
store instances. It is recommended to use a properties object for a single
store, because the properties object is passed on to store initialization
methods that are able to store the properties as a field.public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, Object auth) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.auth
- an authentication Object
to be used for communication.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, Object auth, String schemaName) throws GoraException
DataStore
. Uses default properties.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.auth
- an authentication Object
to be used for communication.schemaName
- A default schemaname that will be put on the properties.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, Object auth, Properties properties, String schemaName) throws GoraException
DataStore
.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.auth
- an authentication Object
to be used for communication.properties
- The properties to be used be the store.schemaName
- A default schemaname that will be put on the properties.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D createDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistent, Object auth, Properties properties) throws GoraException
DataStore
. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistent
- The value class.auth
- an authentication Object
to be used for communication.properties
- The properties to be used be the store.GoraException
public static <D extends DataStore<K,T>,K,T extends Persistent> D getDataStore(Class<D> dataStoreClass, Class<K> keyClass, Class<T> persistentClass, Object auth) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class.keyClass
- The key class.persistentClass
- The value class.auth
- an authentication Object
to be used for communication.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(String dataStoreClass, Class<K> keyClass, Class<T> persistentClass, Object auth) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class as string.keyClass
- The key class.persistentClass
- The value class.auth
- an authentication Object
to be used for communication.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(String dataStoreClass, String keyClass, String persistentClass, Object auth) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.dataStoreClass
- The datastore implementation class as string.keyClass
- The key class as string.persistentClass
- The value class as string.auth
- an authentication Object
to be used for communication.GoraException
public static <K,T extends Persistent> DataStore<K,T> getDataStore(Class<K> keyClass, Class<T> persistent, Object auth) throws GoraException
DataStore
. Uses default properties. Uses 'null' schema.keyClass
- The key class.persistent
- The value class.auth
- an authentication Object
to be used for communication.GoraException
public static String findProperty(Properties properties, DataStore<?,?> store, String baseKey, String defaultValue)
properties
- The properties to be used be the store.store
- the datastore class we wish to search for the property within.baseKey
- the key associated with the property we are trying to find.defaultValue
- a default (fallback) value for the property we wish to assert.public static String findPropertyOrDie(Properties properties, DataStore<?,?> store, String baseKey) throws IOException
properties
- The properties to be used be the store.store
- the datastore class we wish to search for the property within.baseKey
- the key associated with the property we are trying to find.IOException
public static boolean findBooleanProperty(Properties properties, DataStore<?,?> store, String baseKey, String defaultValue)
properties
- The properties to be used be the store.store
- the datastore class we wish to search for the property within.baseKey
- the key associated with the property we are trying to find.defaultValue
- a default (fallback) value for the property we wish to assert.public static boolean getAutoCreateSchema(Properties properties, DataStore<?,?> store)
properties
- The properties to be used be the store.store
- the datastore class we wish to search for the property within.public static String getInputPath(Properties properties, DataStore<?,?> store)
public static String getOutputPath(Properties properties, DataStore<?,?> store)
public static String getMappingFile(Properties properties, DataStore<?,?> store, String defaultValue)
properties
- The properties to be used be the store.store
- The datastore class we wish to search for the property within.defaultValue
- The name of the XML mapping file we wish to use.public static String getDefaultSchemaName(Properties properties, DataStore<?,?> store)
public static void setDefaultSchemaName(Properties properties, String schemaName)
public static <D extends DataStore<K,T>,K,T extends Persistent> void setDefaultSchemaName(Properties properties, Class<D> dataStoreClass, String schemaName)
Copyright © 2010-2015 The Apache Software Foundation. All Rights Reserved.