/** {@inheritDoc} */ @Override public Map<String, Feature> readAll() { // Cannot be sure of whole cache - do not test any feature one-by-one : accessing FeatureStore return getTargetFeatureStore().readAll(); }
/** {@inheritDoc} */ @Override public boolean existGroup(String groupName) { // Cache cannot help you return getTargetFeatureStore().existGroup(groupName); }
/** {@inheritDoc} */ @Override public Map<String, Feature> readGroup(String groupName) { // Cache cannot help you return getTargetFeatureStore().readGroup(groupName); }
/** {@inheritDoc} */ @Override public Set<String> readAllGroups() { // Cannot be sure of whole cache - do not test any feature one-by-one : accessing FeatureStore return getTargetFeatureStore().readAllGroups(); }
/** {@inheritDoc} */ @Override public void delete(String featureId) { // Access target store getTargetFeatureStore().delete(featureId); // even is not present, evict won't failed getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void disable(String featureId) { // Reach target getTargetFeatureStore().disable(featureId); // Cache Operations : As modification, flush cache for this getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void createSchema() { // Create table for features but not only getTargetFeatureStore().createSchema(); // Also create tables for properties getTargetPropertyStore().createSchema(); }
/** {@inheritDoc} */ @Override public void create(Feature fp) { getTargetFeatureStore().create(fp); getCacheManager().putFeature(fp); }
/** {@inheritDoc} */ @Override public void removeFromGroup(String featureId, String groupName) { getTargetFeatureStore().removeFromGroup(featureId, groupName); getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ public void importFeatures(Collection<Feature> features) { getCacheManager().clearFeatures(); getTargetFeatureStore().importFeatures(features); }
/** {@inheritDoc} */ @Override public boolean exist(String featureId) { // not in cache but maybe created from last access if (getCacheManager().getFeature(featureId) == null) { return getTargetFeatureStore().exist(featureId); } return true; }
/** {@inheritDoc} */ @Override public void disableGroup(String groupName) { getTargetFeatureStore().disableGroup(groupName); // Cannot know wich feature to work with (exceptional event) : flush cache getCacheManager().clearFeatures(); }
/** {@inheritDoc} */ @Override public void addToGroup(String featureId, String groupName) { getTargetFeatureStore().addToGroup(featureId, groupName); getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void enable(String featureId) { // Reach target getTargetFeatureStore().enable(featureId); // Modification => flush cache getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void grantRoleOnFeature(String featureId, String roleName) { getTargetFeatureStore().grantRoleOnFeature(featureId, roleName); getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void removeRoleFromFeature(String featureId, String roleName) { getTargetFeatureStore().removeRoleFromFeature(featureId, roleName); getCacheManager().evictFeature(featureId); }
/** {@inheritDoc} */ @Override public void enableGroup(String groupName) { getTargetFeatureStore().enableGroup(groupName); // Cannot know wich feature to work with (exceptional event) : flush cache getCacheManager().clearFeatures(); }
/** {@inheritDoc} */ @Override public void update(Feature fp) { getTargetFeatureStore().update(fp); getCacheManager().evictFeature(fp.getUid()); }
/** {@inheritDoc} */ @Override public Feature read(String featureUid) { Feature fp = getCacheManager().getFeature(featureUid); // not in cache but may has been created from now if (null == fp) { fp = getTargetFeatureStore().read(featureUid); getCacheManager().putFeature(fp); } return fp; }
/** {@inheritDoc} */ @Override public void clear() { // Cache Operations : As modification, flush cache for this getCacheManager().clearProperties(); getTargetPropertyStore().clear(); // Cache Operations : As modification, flush cache for this getCacheManager().clearFeatures(); getTargetFeatureStore().clear(); }