use of org.ff4j.exception.FeatureNotFoundException in project ff4j by ff4j.
the class FeatureStoreHttp method disable.
/**
* {@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);
}
}
use of org.ff4j.exception.FeatureNotFoundException in project ff4j by ff4j.
the class FeatureStoreHttp method enable.
/**
* {@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);
}
}
use of org.ff4j.exception.FeatureNotFoundException in project ff4j by ff4j.
the class FeatureStoreHttp method delete.
/**
* {@inheritDoc}
*/
@Override
public void delete(String uid) {
Util.assertHasLength(uid);
Response cRes = ClientHttpUtils.invokeDeleteMethod(getStore().path(uid), authorizationHeaderValue);
if (Status.NOT_FOUND.getStatusCode() == cRes.getStatus()) {
throw new FeatureNotFoundException(uid);
}
if (Status.NO_CONTENT.getStatusCode() != cRes.getStatus()) {
throw new FeatureAccessException("Cannot delete feature, an HTTP error " + cRes.getStatus() + OCCURED);
}
}
Aggregations