public class ProxyCacheResource extends CoapResource implements CacheResource
Resource.ResourceTreeBuilder
Constructor and Description |
---|
ProxyCacheResource()
Instantiates a new proxy cache resource.
|
ProxyCacheResource(boolean enabled)
Instantiates a new proxy cache resource.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheResponse(Request request,
Response response)
Puts in cache an entry or, if already present, refreshes it.
|
com.google.common.cache.CacheStats |
getCacheStats() |
Response |
getResponse(Request request)
Retrieves the response in the cache that matches the request passed, null
otherwise.
|
void |
handleDELETE(CoapExchange exchange)
Handles the DELETE request in the given CoAPExchange.
|
void |
handleGET(CoapExchange exchange)
Handles the GET request in the given CoAPExchange.
|
void |
handlePOST(CoapExchange exchange)
Handles the POST request in the given CoAPExchange.
|
void |
invalidateRequest(Request request) |
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
add, add, add, addObserver, addObserveRelation, changed, checkObserveRelation, clearAndNotifyObserveRelations, clearObserveRelations, createClient, createClient, createClient, delete, execute, executeAndWait, getAttributes, getChild, getChildren, getEndpoints, getExecutor, getName, getObserverCount, getParent, getPath, getURI, handlePUT, handleRequest, isCachable, isObservable, isVisible, remove, remove, removeObserver, removeObserveRelation, setName, setObservable, setObserveType, setParent, setPath, setVisible
public ProxyCacheResource()
public ProxyCacheResource(boolean enabled)
public void cacheResponse(Request request, Response response)
cacheResponse
in interface CacheResource
public com.google.common.cache.CacheStats getCacheStats()
getCacheStats
in interface CacheResource
public Response getResponse(Request request)
getResponse
in interface CacheResource
request
- the requestpublic void invalidateRequest(Request request)
invalidateRequest
in interface CacheResource
public void handleDELETE(CoapExchange exchange)
CoapResource
handleDELETE
in class CoapResource
exchange
- the CoapExchange for the simple APIpublic void handleGET(CoapExchange exchange)
CoapResource
handleGET
in class CoapResource
exchange
- the CoapExchange for the simple APIpublic void handlePOST(CoapExchange exchange)
CoapResource
handlePOST
in class CoapResource
exchange
- the CoapExchange for the simple APIpublic boolean isEnabled()
public void setEnabled(boolean enabled)