/** {@inheritDoc} */ @Override public void enable(String uid) { assertFeatureExist(uid); update(getQueryBuilder().enableFeature(), uid); }
/** {@inheritDoc} */ @Override public void disable(String uid) { assertFeatureExist(uid); update(getQueryBuilder().disableFeature(), uid); }
/** {@inheritDoc} */ @Override public void disableGroup(String groupName) { assertGroupExist(groupName); update(getQueryBuilder().disableGroup(), groupName); }
/** {@inheritDoc} */ @Override public void enableGroup(String groupName) { assertGroupExist(groupName); update(getQueryBuilder().enableGroup(), groupName); }
/** * Constructor initializing ff4j with an InMemoryStore using an InputStream. Simplify integration with Android through * <code>Asset</code> */ public FF4j(InputStream xmlFileResourceAsStream) { this.fstore = new InMemoryFeatureStore(xmlFileResourceAsStream); }
/** * @return the queryBuilder */ public JdbcQueryBuilder getQueryBuilder() { if (queryBuilder == null) { queryBuilder = new JdbcQueryBuilder(); } return queryBuilder; }
/** * Constructor with full set of feature. * * @param maps */ public InMemoryFeatureStore(Map<String, Feature> maps) { createSchema(); this.featuresMap = maps; buildGroupsFromFeatures(); }
/** {@inheritDoc} */ @Override public Map<String, MutableHitCount> getFeatureUsageHitCount(EventQueryDefinition query) { return getUsageCount(query, Types.NAME); }
/** * Default Constructor. */ public FeatureStoreRedis(String xmlFeaturesfFile) { this(); importFeaturesFromXmlFile(xmlFeaturesfFile); }
/** * Default Constructor. */ public PropertyStoreRedis(String xmlFeaturesfFile) { this(); importPropertiesFromXmlFile(xmlFeaturesfFile); }
/** {@inheritDoc} */ @Override public EventSeries searchFeatureUsageEvents(EventQueryDefinition query) { // Referenced from RDBMS implementation, same usage. return getAuditTrail(query); }
/** * Setter accessor for attribute 'locations'. * * @param locations * new value for 'locations ' */ public void setLocation(String locations) { loadConfFile(locations); }
/** * Parameterized constructor with collection. * * @param collection * the collection to set */ public FeatureStoreMongoDB(MongoClient client, String dbName, String collectionName) { this.mongoClient = client; this.collectionName = collectionName; this.dbName = dbName; this.featuresCollection = getFeaturesCollection(); }
/** * Table name for custom properties. * * @return * Table name for custom properties. */ public String getTableNameCustomProperties() { return getTableName("CUSTOM_PROPERTIES"); }
/** {@inheritDoc} */ @Override public String toString() { return toJson(); }
/** {@inheritDoc} */ @Override public Map<String, MutableHitCount> getSourceHitCount(EventQueryDefinition query) { return getUsageCount(query, Types.SOURCE); }
/** * Contact remote redis server. * * @param host * target redis host * @param port * target redis port */ public FeatureStoreRedis(String host, int port, String xmlFeaturesfFile) { this(host, port); importFeaturesFromXmlFile(xmlFeaturesfFile); }
/** * Contact remote redis server. * * @param host target redis host * @param port target redis port */ public PropertyStoreRedis(String host, int port, String xmlFeaturesfFile) { this(host, port); importPropertiesFromXmlFile(xmlFeaturesfFile); }
/** {@inheritDoc} */ @Override public Map<String, MutableHitCount> getUserHitCount(EventQueryDefinition query) { return getUsageCount(query, Types.USER); }
/** {@inheritDoc} */ @Override public Map<String, MutableHitCount> getHostHitCount(EventQueryDefinition query) { return getUsageCount(query, Types.HOST); }