public class CacheSettingServiceImpl extends Object implements org.exoplatform.commons.api.settings.SettingService
| Modifier and Type | Field and Description |
|---|---|
protected org.exoplatform.services.cache.future.FutureExoCache<org.exoplatform.commons.api.settings.data.SettingKey,org.exoplatform.commons.api.settings.SettingValue,org.exoplatform.commons.api.settings.SettingService> |
futureExoCache |
protected org.exoplatform.services.cache.ExoCache<org.exoplatform.commons.api.settings.data.SettingKey,org.exoplatform.commons.api.settings.SettingValue> |
settingCache |
| Constructor and Description |
|---|
CacheSettingServiceImpl(JPASettingServiceImpl service,
org.exoplatform.services.cache.CacheService cacheService)
Create cache setting service object with service for database and service for
cache
|
| Modifier and Type | Method and Description |
|---|---|
long |
countContextsByType(String contextType) |
org.exoplatform.commons.api.settings.SettingValue<?> |
get(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key)
Get setting value associated with composite key(context, scope, key) This
service will search in the cache first and then in the database.
|
List<String> |
getContextNamesByType(String contextType,
int offset,
int limit) |
List<org.exoplatform.commons.api.settings.data.Context> |
getContextsByTypeAndScopeAndSettingName(String contextType,
String scopeType,
String scopeName,
String settingName,
int offset,
int limit) |
Set<String> |
getEmptyContextsByTypeAndScopeAndSettingName(String contextType,
String scopeType,
String scopeName,
String settingName,
int offset,
int limit) |
Map<org.exoplatform.commons.api.settings.data.Scope,Map<String,org.exoplatform.commons.api.settings.SettingValue<String>>> |
getSettingsByContext(org.exoplatform.commons.api.settings.data.Context context) |
Map<String,org.exoplatform.commons.api.settings.SettingValue> |
getSettingsByContextAndScope(String contextType,
String contextName,
String scopeType,
String scopeName) |
void |
remove(org.exoplatform.commons.api.settings.data.Context context)
remove all the value associated with the specified context in cache and
database also.
|
void |
remove(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope)
remove all the value associated with the specified context and specified
scope in cache and database also.
|
void |
remove(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key)
Remove all the value associated with the composite key(context,scope,key) in
cache and also in database.
|
void |
save(org.exoplatform.commons.api.settings.data.Context context) |
void |
set(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key,
org.exoplatform.commons.api.settings.SettingValue<?> value)
Set the specified value with the key which is composed by context, scope,
key.
|
protected org.exoplatform.services.cache.ExoCache<org.exoplatform.commons.api.settings.data.SettingKey,org.exoplatform.commons.api.settings.SettingValue> settingCache
protected org.exoplatform.services.cache.future.FutureExoCache<org.exoplatform.commons.api.settings.data.SettingKey,org.exoplatform.commons.api.settings.SettingValue,org.exoplatform.commons.api.settings.SettingService> futureExoCache
public CacheSettingServiceImpl(JPASettingServiceImpl service, org.exoplatform.services.cache.CacheService cacheService)
service - Setting service for databasecacheService - Cache servicepublic void set(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key,
org.exoplatform.commons.api.settings.SettingValue<?> value)
set in interface org.exoplatform.commons.api.settings.SettingServicecontext - context with which the specified value is to be associatedscope - scope with which the specified value is to be associatedkey - key with which the specified value is to be associatedvalue - value to be associated with the specified key.public org.exoplatform.commons.api.settings.SettingValue<?> get(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key)
get in interface org.exoplatform.commons.api.settings.SettingServicepublic void remove(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope,
String key)
remove in interface org.exoplatform.commons.api.settings.SettingServicecontext - context with which the specified value is to be associated.
The context type must be USER and context.id must be not null.scope - scope with which the specified value is to be associated. The
scope.id must be not null.key - key with which the specified value is to be associatedpublic void remove(org.exoplatform.commons.api.settings.data.Context context,
org.exoplatform.commons.api.settings.data.Scope scope)
remove in interface org.exoplatform.commons.api.settings.SettingServicecontext - context with which the specified value is to be associated.
The context type must be USER and context.id must be not null.scope - scope with which the specified value is to be associated. The
scope.id must be not null.public void remove(org.exoplatform.commons.api.settings.data.Context context)
remove in interface org.exoplatform.commons.api.settings.SettingServicecontext - context with which the specified value is to be associated.
The context type must be USER and context.id must be not null.public long countContextsByType(String contextType)
countContextsByType in interface org.exoplatform.commons.api.settings.SettingServicepublic List<String> getContextNamesByType(String contextType, int offset, int limit)
getContextNamesByType in interface org.exoplatform.commons.api.settings.SettingServicepublic Map<org.exoplatform.commons.api.settings.data.Scope,Map<String,org.exoplatform.commons.api.settings.SettingValue<String>>> getSettingsByContext(org.exoplatform.commons.api.settings.data.Context context)
getSettingsByContext in interface org.exoplatform.commons.api.settings.SettingServicepublic List<org.exoplatform.commons.api.settings.data.Context> getContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit)
getContextsByTypeAndScopeAndSettingName in interface org.exoplatform.commons.api.settings.SettingServicepublic Set<String> getEmptyContextsByTypeAndScopeAndSettingName(String contextType, String scopeType, String scopeName, String settingName, int offset, int limit)
getEmptyContextsByTypeAndScopeAndSettingName in interface org.exoplatform.commons.api.settings.SettingServicepublic void save(org.exoplatform.commons.api.settings.data.Context context)
save in interface org.exoplatform.commons.api.settings.SettingServicepublic Map<String,org.exoplatform.commons.api.settings.SettingValue> getSettingsByContextAndScope(String contextType, String contextName, String scopeType, String scopeName)
getSettingsByContextAndScope in interface org.exoplatform.commons.api.settings.SettingServiceCopyright © 2003–2020 eXo Platform SAS. All rights reserved.