Package org.infinispan.rest.operations
Class CacheOperations
- java.lang.Object
-
- org.infinispan.rest.operations.CacheOperations
-
public class CacheOperations extends Object
REST Operations implementation. All operations translateInfinispanRequestintoInfinispanResponse.- Author:
- Sebastian Ćaskawiec
-
-
Constructor Summary
Constructors Constructor Description CacheOperations(RestServerConfiguration configuration, RestCacheManager<Object> cacheManager)Creates new instance ofCacheOperations.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfinispanResponseclearEntireCache(InfinispanCacheAPIRequest request)Implementation of HTTP DELETE request invoked on root context.InfinispanResponsedeleteCacheValue(InfinispanCacheAPIRequest request)Implementation of HTTP DELETE request invoked with a key.InfinispanResponsegetCacheValue(InfinispanCacheAPIRequest request)Implementation of HTTP GET and HTTP HEAD requests invoked with a key.InfinispanResponsegetCacheValues(InfinispanCacheAPIRequest request)Implementation of HTTP GET request invoked on root context.InfinispanResponseputValueToCache(InfinispanCacheAPIRequest request)Implementation of HTTP PUT and HTTP POST requests invoked with a key.
-
-
-
Constructor Detail
-
CacheOperations
public CacheOperations(RestServerConfiguration configuration, RestCacheManager<Object> cacheManager)
Creates new instance ofCacheOperations.- Parameters:
configuration- REST Server configuration.cacheManager- Embedded Cache Manager for storing data.
-
-
Method Detail
-
getCacheValues
public InfinispanResponse getCacheValues(InfinispanCacheAPIRequest request) throws RestResponseException
Implementation of HTTP GET request invoked on root context.- Parameters:
request-InfinispanRequestto be processed.- Returns:
- InfinispanResponse which shall be sent to the client.
- Throws:
RestResponseException- Thrown in case of any non-critical processing errors.
-
getCacheValue
public InfinispanResponse getCacheValue(InfinispanCacheAPIRequest request) throws RestResponseException
Implementation of HTTP GET and HTTP HEAD requests invoked with a key.- Parameters:
request-InfinispanRequestto be processed.- Returns:
- InfinispanResponse which shall be sent to the client.
- Throws:
RestResponseException- Thrown in case of any non-critical processing errors.
-
deleteCacheValue
public InfinispanResponse deleteCacheValue(InfinispanCacheAPIRequest request) throws RestResponseException
Implementation of HTTP DELETE request invoked with a key.- Parameters:
request-InfinispanRequestto be processed.- Returns:
- InfinispanResponse which shall be sent to the client.
- Throws:
RestResponseException- Thrown in case of any non-critical processing errors.
-
clearEntireCache
public InfinispanResponse clearEntireCache(InfinispanCacheAPIRequest request) throws RestResponseException
Implementation of HTTP DELETE request invoked on root context.- Parameters:
request-InfinispanRequestto be processed.- Returns:
- InfinispanResponse which shall be sent to the client.
- Throws:
RestResponseException- Thrown in case of any non-critical processing errors.
-
putValueToCache
public InfinispanResponse putValueToCache(InfinispanCacheAPIRequest request) throws RestResponseException
Implementation of HTTP PUT and HTTP POST requests invoked with a key.- Parameters:
request-InfinispanRequestto be processed.- Returns:
- InfinispanResponse which shall be sent to the client.
- Throws:
RestResponseException- Thrown in case of any non-critical processing errors.
-
-