Class CacheControlClientReaderInterceptor
- java.lang.Object
-
- org.apache.cxf.jaxrs.client.cache.CacheControlClientReaderInterceptor
-
- All Implemented Interfaces:
javax.ws.rs.ext.ReaderInterceptor
@Priority(4999) public class CacheControlClientReaderInterceptor extends Object implements javax.ws.rs.ext.ReaderInterceptor
-
-
Constructor Summary
Constructors Constructor Description CacheControlClientReaderInterceptor()CacheControlClientReaderInterceptor(javax.cache.Cache<Key,Entry> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectaroundReadFrom(javax.ws.rs.ext.ReaderInterceptorContext context)protected booleanisCacheControlValid(javax.ws.rs.ext.ReaderInterceptorContext context, javax.ws.rs.core.CacheControl responseControl)booleanisCacheInputStream()CacheControlClientReaderInterceptorsetCache(javax.cache.Cache<Key,Entry> c)voidsetCacheResponseInputStream(boolean cacheInputStream)Enforce the caching of the response stream.
-
-
-
Method Detail
-
setCache
public CacheControlClientReaderInterceptor setCache(javax.cache.Cache<Key,Entry> c)
-
aroundReadFrom
public Object aroundReadFrom(javax.ws.rs.ext.ReaderInterceptorContext context) throws IOException, javax.ws.rs.WebApplicationException
- Specified by:
aroundReadFromin interfacejavax.ws.rs.ext.ReaderInterceptor- Throws:
IOExceptionjavax.ws.rs.WebApplicationException
-
isCacheInputStream
public boolean isCacheInputStream()
-
setCacheResponseInputStream
public void setCacheResponseInputStream(boolean cacheInputStream)
Enforce the caching of the response stream. This is not recommended if the client code expects Serializable data, example, String or custom JAXB beans marked as Serializable, which can be stored in the cache directly. Use this property only if returning a cached entity does require a repeated stream parsing.- Parameters:
cacheInputStream-
-
isCacheControlValid
protected boolean isCacheControlValid(javax.ws.rs.ext.ReaderInterceptorContext context, javax.ws.rs.core.CacheControl responseControl)
-
-