Interface SettingService
public interface SettingService
Stores and removes a value associated with a key.
- eXo level API
- Experimental
-
Method Summary
Modifier and TypeMethodDescriptiondefault longcountContextsByType(String contextType) Returns the total count of contexts by typeSettingValue<?> Gets values associated with a specified composite key (context, scope, key) in the database.getContextNamesByType(String contextType, int offset, int limit) Returns context names by typegetContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit) Gets a list of names of contexts of a chosen type that have a setting associated to a dedicated scopegetEmptyContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit) Gets a list of names of contexts of a chosen type that doesn't have settings associated to a dedicated scopegetSettingsByContext(Context context) Get settings related to a scope and a contextgetSettingsByContextAndScope(String contextType, String contextName, String scopeType, String scopeName) Get a list of settings that belongs to the context and scopevoidRemoves all values associated with a specified context from the database.voidRemoves all values associated with a specified context and scope from the database.voidRemoves a value associated with a specified composite key.voidSaves aContexton databasevoidset(Context context, Scope scope, String key, SettingValue<?> value) Sets a value with the key that is composed by context, scope, key.
-
Method Details
-
set
Sets a value with the key that is composed by context, scope, key. The value will be saved in the database.- Parameters:
context- The context with which the specified value is associated.scope- The scope with which the specified value is associated.key- The key with which the specified value is associated.value- The value associated with the specified key.- eXo level API
- Experimental
-
remove
Removes a value associated with a specified composite key.- Parameters:
context- The context with which the specified value is associated.scope- The scope with which the specified value is associated.key- The key with which the specified value is associated.- eXo level API
- Experimental
-
remove
Removes all values associated with a specified context and scope from the database.- Parameters:
context- The context with which the specified value is associated. The context type must be USER and context, and Id must not be "null".scope- The scope with which the specified value is associated. The scope.id must not be "null".- eXo level API
- Experimental
-
remove
Removes all values associated with a specified context from the database.- Parameters:
context- The context with which the specified value is associated. The context type must be USER and context, and Id must not be "null".- eXo level API
- Experimental
-
get
Gets values associated with a specified composite key (context, scope, key) in the database.- Parameters:
context- The context with which the specified value is associated. The context type must be USER and context and Id must not be "null".scope- The scope with which the specified value is associated. The scope.id must not be "null".key- The key with which the specified value is associated.- eXo level API
- Experimental
-
countContextsByType
Returns the total count of contexts by type- Parameters:
contextType- context type name ('USER' OR 'GLOBAL')- Returns:
- count of contexts by type
-
getContextNamesByType
Returns context names by type- Parameters:
contextType- context type name ('USER' OR 'GLOBAL')offset- query offsetlimit- query max results- Returns:
- the list of context names
-
getSettingsByContext
Get settings related to a scope and a context- Parameters:
context-Contextused to search settings- Returns:
Mapof settings with key = setting name and as value = correspondingSettingValue
-
getContextsByTypeAndScopeAndSettingName
List<Context> getContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit) Gets a list of names of contexts of a chosen type that have a setting associated to a dedicated scope -
getEmptyContextsByTypeAndScopeAndSettingName
Set<String> getEmptyContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit) Gets a list of names of contexts of a chosen type that doesn't have settings associated to a dedicated scope -
save
Saves aContexton database- Parameters:
context- context to save
-
getSettingsByContextAndScope
Map<String,SettingValue> getSettingsByContextAndScope(String contextType, String contextName, String scopeType, String scopeName) Get a list of settings that belongs to the context and scope- Parameters:
contextType- type of ontextcontextName- name of ontextscopeType- type of scopescopeName- name of scope- Returns:
- Map of settings key and value
-