Package uk.gov.gchq.gaffer.store
Class StoreProperties
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.StoreProperties
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AccumuloProperties
,FederatedStoreProperties
,FederatedStoreProperties
,MapStoreProperties
,ProxyProperties
public class StoreProperties extends Object implements Cloneable
AStoreProperties
contains specific configuration information for the store, such as database connection strings. It wrapsProperties
and lazy loads the all properties from a file when first used.All StoreProperties classes must be JSON serialisable.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ADMIN_AUTH
static String
EXECUTOR_SERVICE_THREAD_COUNT
static String
EXECUTOR_SERVICE_THREAD_COUNT_DEFAULT
static String
GAFFER_NAMED_OPERATION_NESTED
static String
JOB_TRACKER_ENABLED
static String
JSON_SERIALISER_CLASS
static String
JSON_SERIALISER_MODULES
static String
NAMED_OPERATION_ENABLED
static String
NAMED_VIEW_ENABLED
static String
OPERATION_DECLARATIONS
static String
OPERATION_DECLARATIONS_JSON
static String
REFLECTION_PACKAGES
CSV of extra packages to be included in the reflection scanning.static String
RESCHEDULE_JOBS_ON_START
static String
SCHEMA_CLASS
static String
STORE_CLASS
static String
STORE_PROPERTIES_CLASS
static String
STRICT_JSON
-
Constructor Summary
Constructors Constructor Description StoreProperties()
StoreProperties(Path propFileLocation)
StoreProperties(Properties props)
-
Method Summary
-
-
-
Field Detail
-
STORE_CLASS
public static final String STORE_CLASS
- See Also:
- Constant Field Values
-
SCHEMA_CLASS
public static final String SCHEMA_CLASS
- See Also:
- Constant Field Values
-
STORE_PROPERTIES_CLASS
public static final String STORE_PROPERTIES_CLASS
- See Also:
- Constant Field Values
-
OPERATION_DECLARATIONS
public static final String OPERATION_DECLARATIONS
- See Also:
- Constant Field Values
-
OPERATION_DECLARATIONS_JSON
public static final String OPERATION_DECLARATIONS_JSON
- See Also:
- Constant Field Values
-
NAMED_VIEW_ENABLED
public static final String NAMED_VIEW_ENABLED
- See Also:
- Constant Field Values
-
NAMED_OPERATION_ENABLED
public static final String NAMED_OPERATION_ENABLED
- See Also:
- Constant Field Values
-
JOB_TRACKER_ENABLED
public static final String JOB_TRACKER_ENABLED
- See Also:
- Constant Field Values
-
RESCHEDULE_JOBS_ON_START
public static final String RESCHEDULE_JOBS_ON_START
- See Also:
- Constant Field Values
-
EXECUTOR_SERVICE_THREAD_COUNT
public static final String EXECUTOR_SERVICE_THREAD_COUNT
- See Also:
- Constant Field Values
-
EXECUTOR_SERVICE_THREAD_COUNT_DEFAULT
public static final String EXECUTOR_SERVICE_THREAD_COUNT_DEFAULT
- See Also:
- Constant Field Values
-
JSON_SERIALISER_CLASS
public static final String JSON_SERIALISER_CLASS
- See Also:
- Constant Field Values
-
JSON_SERIALISER_MODULES
public static final String JSON_SERIALISER_MODULES
- See Also:
- Constant Field Values
-
STRICT_JSON
public static final String STRICT_JSON
- See Also:
- Constant Field Values
-
ADMIN_AUTH
public static final String ADMIN_AUTH
- See Also:
- Constant Field Values
-
REFLECTION_PACKAGES
public static final String REFLECTION_PACKAGES
CSV of extra packages to be included in the reflection scanning.- See Also:
- Constant Field Values
-
GAFFER_NAMED_OPERATION_NESTED
public static final String GAFFER_NAMED_OPERATION_NESTED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StoreProperties
public StoreProperties()
-
StoreProperties
public StoreProperties(Path propFileLocation)
-
StoreProperties
public StoreProperties(Properties props)
-
-
Method Detail
-
loadStoreProperties
public static <T extends StoreProperties> T loadStoreProperties(String pathStr, Class<T> requiredClass)
-
loadStoreProperties
public static StoreProperties loadStoreProperties(String pathStr)
-
loadStoreProperties
public static <T extends StoreProperties> T loadStoreProperties(Path storePropertiesPath, Class<T> requiredClass)
-
loadStoreProperties
public static StoreProperties loadStoreProperties(Path storePropertiesPath)
-
loadStoreProperties
public static <T extends StoreProperties> T loadStoreProperties(InputStream storePropertiesStream, Class<T> requiredClass)
-
loadStoreProperties
public static StoreProperties loadStoreProperties(InputStream storePropertiesStream)
-
loadStoreProperties
public static <T extends StoreProperties> T loadStoreProperties(Properties props, Class<T> requiredClass)
-
loadStoreProperties
public static StoreProperties loadStoreProperties(Properties props)
-
get
public String get(String key)
- Parameters:
key
- the property key- Returns:
- a property properties file with the given key.
-
containsKey
public boolean containsKey(Object key)
-
get
public String get(String key, String defaultValue)
Get a parameter from the schema file, or the default value.- Parameters:
key
- the property keydefaultValue
- the default value to use if the property doesn't exist- Returns:
- a property properties file with the given key or the default value if the property doesn't exist
-
set
public void set(String key, String value)
Set a parameter from the schema file.- Parameters:
key
- the keyvalue
- the value
-
merge
public void merge(StoreProperties properties)
-
getOperationDeclarations
public OperationDeclarations getOperationDeclarations()
Returns the operation definitions from the file specified in the properties. This is an optional feature, so if the property does not exist then this function will return an empty object.- Returns:
- The Operation Definitions to load dynamically
-
getStoreClass
public String getStoreClass()
-
setStoreClass
public void setStoreClass(String storeClass)
-
getJobTrackerEnabled
public boolean getJobTrackerEnabled()
-
setJobTrackerEnabled
public void setJobTrackerEnabled(boolean jobTrackerEnabled)
-
getNamedViewEnabled
public boolean getNamedViewEnabled()
-
setNamedViewEnabled
public void setNamedViewEnabled(boolean namedViewEnabled)
-
getNamedOperationEnabled
public boolean getNamedOperationEnabled()
-
setNamedOperationEnabled
public void setNamedOperationEnabled(boolean namedOperationEnabled)
-
getRescheduleJobsOnStart
public boolean getRescheduleJobsOnStart()
-
setRescheduleJobsOnStart
public void setRescheduleJobsOnStart(boolean rescheduleJobsOnStart)
-
getSchemaClassName
public String getSchemaClassName()
-
setSchemaClass
public void setSchemaClass(String schemaClass)
-
getStorePropertiesClassName
public String getStorePropertiesClassName()
-
setStorePropertiesClassName
public void setStorePropertiesClassName(String storePropertiesClassName)
-
getStorePropertiesClass
public Class<? extends StoreProperties> getStorePropertiesClass()
-
setStorePropertiesClass
public void setStorePropertiesClass(Class<? extends StoreProperties> storePropertiesClass)
-
getOperationDeclarationPaths
public String getOperationDeclarationPaths()
-
setOperationDeclarationPaths
public void setOperationDeclarationPaths(String paths)
-
getReflectionPackages
public String getReflectionPackages()
-
setReflectionPackages
public void setReflectionPackages(String packages)
-
getJobExecutorThreadCount
public Integer getJobExecutorThreadCount()
-
addOperationDeclarationPaths
public void addOperationDeclarationPaths(String... newPaths)
-
getJsonSerialiserClass
public String getJsonSerialiserClass()
-
setJsonSerialiserClass
public void setJsonSerialiserClass(Class<? extends JSONSerialiser> jsonSerialiserClass)
-
setJsonSerialiserClass
public void setJsonSerialiserClass(String jsonSerialiserClass)
-
getJsonSerialiserModules
public String getJsonSerialiserModules()
-
setJsonSerialiserModules
public void setJsonSerialiserModules(Set<Class<? extends JSONSerialiserModules>> modules)
-
setJsonSerialiserModules
public void setJsonSerialiserModules(String modules)
-
getStrictJson
public Boolean getStrictJson()
-
setStrictJson
public void setStrictJson(Boolean strictJson)
-
getAdminAuth
public String getAdminAuth()
-
setAdminAuth
public void setAdminAuth(String adminAuth)
-
getDefaultCacheServiceClass
public String getDefaultCacheServiceClass()
-
setDefaultCacheServiceClass
public void setDefaultCacheServiceClass(String cacheServiceClassString)
-
getJobTrackerCacheServiceClass
public String getJobTrackerCacheServiceClass()
-
setJobTrackerCacheServiceClass
public void setJobTrackerCacheServiceClass(String cacheServiceClassString)
-
getNamedViewCacheServiceClass
public String getNamedViewCacheServiceClass()
-
setNamedViewCacheServiceClass
public void setNamedViewCacheServiceClass(String cacheServiceClassString)
-
getNamedOperationCacheServiceClass
public String getNamedOperationCacheServiceClass()
-
setNamedOperationCacheServiceClass
public void setNamedOperationCacheServiceClass(String cacheServiceClassString)
-
setCacheServiceClass
@Deprecated public void setCacheServiceClass(String cacheServiceClassString)
Deprecated.
-
getCacheServiceClass
@Deprecated public String getCacheServiceClass()
Deprecated.
-
getCacheServiceClass
@Deprecated public String getCacheServiceClass(String defaultValue)
Deprecated.
-
setCacheServiceNameSuffix
public void setCacheServiceNameSuffix(String suffix)
-
getCacheServiceNamedOperationSuffix
public String getCacheServiceNamedOperationSuffix(String defaultValue)
-
isNestedNamedOperationAllow
public boolean isNestedNamedOperationAllow()
-
isNestedNamedOperationAllow
public boolean isNestedNamedOperationAllow(boolean defaultValue)
-
setNestedNamedOperationAllow
public void setNestedNamedOperationAllow(boolean isAllowed)
-
getProperties
public Properties getProperties()
-
setProperties
public void setProperties(Properties properties)
-
clone
public StoreProperties clone()
-
updateStorePropertiesClass
public void updateStorePropertiesClass()
-
updateStorePropertiesClass
public void updateStorePropertiesClass(Class<? extends StoreProperties> requiredClass)
-
-