public class FeatureStoreCacheProxy extends Object implements FeatureStore
FeatureStore could generate some overhead and decrease performances. This is the reason why cache is provided
though proxies.
As applications are distributed, the cache itself could be distributed. The default implement is
InMemoryFeatureStoreCacheProxy but other are provided to use distributed cache system as redis or memcached.| Constructor and Description |
|---|
FeatureStoreCacheProxy()
Allow Ioc and defeine default constructor.
|
FeatureStoreCacheProxy(FeatureStore store,
FeatureCacheManager cache)
Initialization through constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToGroup(String featureId,
String groupName)
Add target
Feature to target group. |
void |
create(Feature fp)
Create flipPoint in storage (with roles).
|
void |
delete(String featureId)
Remove fliPoint from store.
|
void |
disable(String featureId)
Create Feature is does not exist and enable it.
|
void |
disableGroup(String groupName)
Disable all features contained in the following group.
|
void |
enable(String featureId)
Enable/UP/switch on a FlipPoint.
|
void |
enableGroup(String groupName)
Enable all features contained in the following group.
|
boolean |
exist(String featureId)
Check if Feature Exist.
|
boolean |
existGroup(String groupName)
Check if current group exist or not.
|
String |
getCachedTargetStore() |
FeatureCacheManager |
getCacheManager()
Getter accessor for attribute 'cacheManager'.
|
String |
getCacheProvider()
Return false.
|
FeatureStore |
getTarget()
Getter accessor for attribute 'target'.
|
void |
grantRoleOnFeature(String featureId,
String roleName)
Add a role to a flipPOINT.
|
boolean |
isCached()
Implementation of Store to get cache.
|
Feature |
read(String featureUid)
Create Feature is does not exist and enable it.
|
Map<String,Feature> |
readAll()
Access to all features to get information.
|
Set<String> |
readAllGroups()
Return a set of existing groups.
|
Map<String,Feature> |
readGroup(String groupName)
Read all features within target group.
|
void |
removeFromGroup(String featureId,
String groupName)
Remove target
Feature from group. |
void |
removeRoleFromFeature(String featureId,
String roleName)
Remove role to acess flip point
|
void |
setCacheManager(FeatureCacheManager cacheManager)
Setter accessor for attribute 'cacheManager'.
|
void |
setTarget(FeatureStore target)
Setter accessor for attribute 'target'.
|
void |
update(Feature fp)
Update FlipPoint within store.
|
public FeatureStoreCacheProxy()
public FeatureStoreCacheProxy(FeatureStore store, FeatureCacheManager cache)
store - target store to retrieve featurescache - cache manager to limit overhead of storepublic void enable(String featureId)
enable in interface FeatureStorefeatureId - unique feature identifierpublic void disable(String featureId)
disable in interface FeatureStorepublic boolean exist(String featureId)
exist in interface FeatureStorepublic void create(Feature fp)
create in interface FeatureStorefp - create rolespublic Feature read(String featureUid)
read in interface FeatureStorepublic Map<String,Feature> readAll()
readAll in interface FeatureStorepublic Set<String> readAllGroups()
readAllGroups in interface FeatureStorepublic void delete(String featureId)
delete in interface FeatureStorepublic void update(Feature fp)
update in interface FeatureStorefp - flipPoint new elementpublic void grantRoleOnFeature(String featureId, String roleName)
grantRoleOnFeature in interface FeatureStorepublic void removeRoleFromFeature(String featureId, String roleName)
removeRoleFromFeature in interface FeatureStorepublic void enableGroup(String groupName)
enableGroup in interface FeatureStoregroupName - target group namepublic void disableGroup(String groupName)
disableGroup in interface FeatureStoregroupName - target group namepublic boolean existGroup(String groupName)
existGroup in interface FeatureStoregroupName - target group namepublic Map<String,Feature> readGroup(String groupName)
readGroup in interface FeatureStoregroupName - target group namepublic void addToGroup(String featureId, String groupName)
Feature to target group.addToGroup in interface FeatureStorefeatureId - target feature identifiergroupName - target groupNamepublic void removeFromGroup(String featureId, String groupName)
Feature from group.removeFromGroup in interface FeatureStorefeatureId - target feature identifiergroupName - target groupNamepublic FeatureStore getTarget()
public void setTarget(FeatureStore target)
target - new value for 'target 'public FeatureCacheManager getCacheManager()
public void setCacheManager(FeatureCacheManager cacheManager)
cacheManager - new value for 'cacheManager 'public boolean isCached()
isCached in interface FeatureStorepublic String getCacheProvider()
getCacheProvider in interface FeatureStorepublic String getCachedTargetStore()
getCachedTargetStore in interface FeatureStoreCopyright © 2013–2015 FF4J. All rights reserved.