/** {@inheritDoc} */ @Override public Feature read(String uid) { if (!exist(uid)) { throw new FeatureNotFoundException(uid); } return (Feature) getCache().get(uid).getObjectValue(); }
/** {@inheritDoc} */ @Override public void disable(String uid) { Util.assertHasLength(uid); Response cRes = ClientHttpUtils.invokePostMethod( getStore().path(uid).path(OPERATION_DISABLE), authorizationHeaderValue); if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) { throw new FeatureNotFoundException(uid); } }
/** {@inheritDoc} */ @Override public void enable(String uid) { Util.assertHasLength(uid); Response cRes = ClientHttpUtils.invokePostMethod( getStore().path(uid).path(OPERATION_ENABLE), authorizationHeaderValue); if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) { throw new FeatureNotFoundException(uid); } }
/** * Validate feature uid. * * @param uid * target uid */ protected void assertFeatureExist(String uid) { Util.assertHasLength(uid); if (!exist(uid)) { throw new FeatureNotFoundException(uid); } }
/** {@inheritDoc} */ @Override public void delete(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } if (!exist(uid)) { throw new FeatureNotFoundException(uid); } getFeaturesCollection().remove(BUILDER.getFeatUid(uid)); }
/** {@inheritDoc} */ @Override public void enable(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } ClientResponse cRes = getStore().path(uid).path(OPERATION_ENABLE).post(ClientResponse.class); if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) { throw new FeatureNotFoundException(uid); } }
/** {@inheritDoc} */ @Override public void delete(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } if (!exist(uid)) { throw new FeatureNotFoundException(uid); } getFeaturesCollection().deleteOne(BUILDER.getFeatUid(uid)); }
/** {@inheritDoc} */ @Override public void disable(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } ClientResponse cRes = getStore().path(uid).path(OPERATION_DISABLE).post(ClientResponse.class); if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) { throw new FeatureNotFoundException(uid); } }
/** {@inheritDoc} */ @Override public void delete(String fpId) { if (!exist(fpId)) { throw new FeatureNotFoundException(fpId); } getCacheManager().evictFeature(fpId); }
/** {@inheritDoc} */ @Override @Transactional public void delete(String uid) { if (!exist(uid)) throw new FeatureNotFoundException(uid); deletePermissions(uid); deleteProperties(uid); deleteCoreFeature(uid); }
/** {@inheritDoc} */ @Override public Feature read(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } Document object = getFeaturesCollection().find(BUILDER.getFeatUid(uid)).first(); if (object==null) { throw new FeatureNotFoundException(uid); } return FMAPPER.fromStore(object); }
/** {@inheritDoc} */ @Override public void delete(String fpId) { if (!exist(fpId)) { throw new FeatureNotFoundException(fpId); } getCache().remove(fpId); }
/** {@inheritDoc} */ @Override public Feature read(String uid) { if (uid == null || uid.isEmpty()) { throw new IllegalArgumentException(FEATURE_IDENTIFIER_CANNOT_BE_NULL_NOR_EMPTY); } ClientResponse cRes = getStore().path(uid).get(ClientResponse.class); if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) { throw new FeatureNotFoundException(uid); } return parseFeature(cRes.getEntity(String.class)); }
/** {@inheritDoc} */ @Override public Feature read(String uid) { if (!exist(uid)) { throw new FeatureNotFoundException(uid); } return getCacheManager().getFeature(uid); }
/** {@inheritDoc} */ @Override public void update(Feature fp) { if (fp == null) { throw new IllegalArgumentException("Feature cannot be null"); } if (!exist(fp.getUid())) { throw new FeatureNotFoundException(fp.getUid()); } getCache().put(new Element(fp.getUid(), fp)); }
/** {@inheritDoc} */ public void disable(String uid) { Util.assertHasLength(uid); if (!exist(uid)) { throw new FeatureNotFoundException(uid); } getJdbcTemplate().update(getQueryBuilder().disableFeature(), uid); }
/** {@inheritDoc} */ public void enable(String uid) { Util.assertHasLength(uid); if (!exist(uid)) { throw new FeatureNotFoundException(uid); } getJdbcTemplate().update(getQueryBuilder().enableFeature(), uid); }
/** {@inheritDoc} */ @Override public void update(Feature fp) { if (fp == null) { throw new IllegalArgumentException("Feature cannot be null"); } if (!exist(fp.getUid())) { throw new FeatureNotFoundException(fp.getUid()); } getCacheManager().putFeature(fp); }
/** {@inheritDoc} */ @Override public void delete(String uid) { if (!exist(uid)) { throw new FeatureNotFoundException(uid); } // Delete feature key getDriver().deleteKey(getDriver().getFeatureKey(uid)); // Register in the dictionnary getDriver().unregisterFeature(uid); }
/** {@inheritDoc} */ @Override public Feature read(String uid) { if (!exist(uid)) { throw new FeatureNotFoundException(uid); } return getFeatureMapper().fromStore( getDriver().getValue(getDriver().getFeatureKey(uid))); }