net.sf.ehcache.management.resource.services.CachesResourceService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ehcache Show documentation
Show all versions of ehcache Show documentation
Ehcache is an open source, standards-based cache used to boost performance,
offload the database and simplify scalability. Ehcache is robust, proven and full-featured and
this has made it the most widely-used Java-based cache.
/* All content copyright (c) 2003-2012 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.*/
package net.sf.ehcache.management.resource.services;
import java.util.Collection;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import net.sf.ehcache.management.resource.CacheEntity;
/**
*
* A resource service for interacting with ehcache caches via the {@link CacheEntity}.
*
*
* @author brandony
*
*/
public interface CachesResourceService {
public static final String ATTR_QUERY_KEY = "show";
/**
*
* Get a {@code Collection} of {@link CacheEntity} objects representing the cache information provided by the associated monitorable
* entity's agent given the request path.
*
*
* @param info
* {@link UriInfo} for this resource request
* @return a collection of {@link CacheEntity} objects when successful.
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
Collection getCaches(@Context UriInfo info);
/**
*
* Create or update a cache with the name specified in the request path, for a specific agent and cache manager. The request path that
* does not identify a unique cache resource for creation or identifies a cache that already exists will constitute a bad request and will
* be denied, resulting in a response with a 400 and 409 respectively.
*
*
* @param info
* {@link UriInfo} for this resource request
* @param resource
* {@code CacheEntity} resource for update or creation
*/
@PUT
@Consumes(MediaType.APPLICATION_JSON)
void createOrUpdateCache(@Context UriInfo info, CacheEntity resource);
}