Class DatastoreService
java.lang.Object
fr.paris.lutece.portal.service.datastore.DatastoreService
Datastore Service
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Lutece107Cache<String,DataEntity> static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexistsInstanceKey(String strKey) Check if a key is available in the datastore depending the current web app instancestatic booleanCheck if a key is available in the datastorestatic ReferenceListgetDataByPrefix(String strPrefix) Gets a list of key/value where keys are matching a given prefixstatic StringgetDataValue(String strKey, String strDefault) Get entitystatic ReferenceListgetInstanceDataByPrefix(String strPrefix) Gets a list of key/value where keys are matching a given prefix depending the current web app instancestatic StringgetInstanceDataValue(String strKey, String strDefault) Get entity depending the current web app instancestatic voidinit()initialize the servicestatic voidremoveData(String strKey) Remove a give keystatic voidremoveDataByPrefix(String strPrefix) Remove all data where keys begin with a given prefixstatic voidremoveInstanceData(String strKey) Remove a give key depending the current web app instancestatic voidremoveInstanceDataByPrefix(String strPrefix) Remove all data where keys begin with a given prefix depending the current web app instancestatic StringreplaceKeys(String strSource) This method replace keys by their value into a given contentstatic voidsetDataValue(String strKey, String strValue) Set entitystatic voidsetInstanceDataValue(String strKey, String strValue) Set entity depending the current web app instancestatic voidStart cache.
-
Field Details
-
VALUE_TRUE
- See Also:
-
VALUE_FALSE
- See Also:
-
_cache
-
-
Method Details
-
init
public static void init()initialize the service -
getDataValue
Get entity- Parameters:
strKey- The entity's keystrDefault- The default value- Returns:
- The value
-
getInstanceDataValue
Get entity depending the current web app instance- Parameters:
strKey- The entity's keystrDefault- The default value- Returns:
- The value
-
setDataValue
Set entity- Parameters:
strKey- The entity's keystrValue- The value
-
setInstanceDataValue
Set entity depending the current web app instance- Parameters:
strKey- The entity's keystrValue- The value
-
removeData
Remove a give key- Parameters:
strKey- The key
-
removeInstanceData
Remove a give key depending the current web app instance- Parameters:
strKey- The key
-
removeDataByPrefix
Remove all data where keys begin with a given prefix- Parameters:
strPrefix- The prefix
-
removeInstanceDataByPrefix
Remove all data where keys begin with a given prefix depending the current web app instance- Parameters:
strPrefix- The prefix
-
getDataByPrefix
Gets a list of key/value where keys are matching a given prefix- Parameters:
strPrefix- The prefix- Returns:
- The list
-
getInstanceDataByPrefix
Gets a list of key/value where keys are matching a given prefix depending the current web app instance- Parameters:
strPrefix- The prefix- Returns:
- The list
-
replaceKeys
This method replace keys by their value into a given content- Parameters:
strSource- The string that contains datastore keys- Returns:
- The string with keys replaced
-
existsKey
Check if a key is available in the datastore- Parameters:
strKey- The key- Returns:
- True if the key is found otherwise false
-
existsInstanceKey
Check if a key is available in the datastore depending the current web app instance- Parameters:
strKey- The key- Returns:
- True if the key is found otherwise false
-
startCache
public static void startCache()Start cache. NB : Cache can't be created at DataStore creation because CacheService uses DatastoreService (Circular reference)
-