use of org.ff4j.cache.FF4jCacheProxy in project ff4j by ff4j.
the class PropertyStoreResource method clear.
/**
* POST Operation to clean cache.
*/
@POST
@Path("/" + RESOURCE_CACHE)
@Produces(MediaType.TEXT_PLAIN)
@ApiOperation(value = "Clear Cache", response = Response.class)
@ApiResponses({ @ApiResponse(code = 200, message = "cache is cleard"), @ApiResponse(code = 404, message = "no cache content provided") })
public Response clear() {
FF4jCacheProxy cacheProxy = ff4j.getCacheProxy();
if (cacheProxy == null) {
return Response.status(Response.Status.NOT_FOUND).entity("Current Store is not cached").build();
}
cacheProxy.getCacheManager().clearProperties();
return Response.ok("Cache has been cleared").build();
}
Aggregations