Package org.serviceconnector.conf
Class SCCacheConfiguration
java.lang.Object
org.serviceconnector.conf.SCCacheConfiguration
The Class SCCacheConfiguration. This is the main SC cache configuration class, keeping all required configuration parameters. This class is used to setup SC cache
SCCache instance.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the disk path.intGets the expiration check interval seconds.intGets the max elements in memory.intGets the max elements on disk.booleanChecks if is cache enabled.voidload(org.apache.commons.configuration2.CompositeConfiguration compositeConfiguration) Loads cache parameters from properties file.
Service Connector cache parameters:
cache.enabled=true
cache.diskPath=../..
-
Constructor Details
-
SCCacheConfiguration
public SCCacheConfiguration()Instantiates a new cache configuration.
-
-
Method Details
-
load
public void load(org.apache.commons.configuration2.CompositeConfiguration compositeConfiguration) throws SCMPValidatorException Loads cache parameters from properties file.
Service Connector cache parameters:
cache.enabled=true
cache.diskPath=../../dev/cache
cache.maxElementsInMemory=100000
cache.maxElementsOnDisk=1000000
cache.expirationCheckIntervalSeconds=60- Parameters:
compositeConfiguration- the composite configuration- Throws:
SCMPValidatorException- the SCMP validator exception
-
isCacheEnabled
public boolean isCacheEnabled()Checks if is cache enabled.- Returns:
- true, if is cache enabled
-
getDiskPath
Gets the disk path.- Returns:
- the disk path
-
getMaxElementsInMemory
public int getMaxElementsInMemory()Gets the max elements in memory.- Returns:
- the max elements in memory
-
getMaxElementsOnDisk
public int getMaxElementsOnDisk()Gets the max elements on disk.- Returns:
- the max elements on disk
-
getExpirationCheckIntervalSeconds
public int getExpirationCheckIntervalSeconds()Gets the expiration check interval seconds.- Returns:
- the expiration check interval seconds
-