| java.lang.Object org.w3c.www.protocol.http.cache.CacheFilter
All known Subclasses: org.w3c.www.protocol.http.cache.push.PushCacheFilter,
Method Summary | |
protected void | addWarning(Request request, HttpWarning warning) Add a warning, to be emitted at reply time. | public boolean | canCache(Request req, Reply rep) | public boolean | canStore(Request req, Reply rep) Checks if, according to the headers of a reply we can store
the resource. | public boolean | canUseCache(Request req) check if we can use the cache or not for this request
It marks the request as being not cachable if false. | protected synchronized void | cleanUpload(CachedResource cr) | public boolean | exceptionFilter(Request request, HttpException ex) This filter handle exceptions.
Parameters: request - The request that triggered the exception. Parameters: ex - The triggered exception. | public CacheSerializer | getSerializer() | public CacheStore | getStore() | public CacheSweeper | getSweeper() | public CacheValidator | getValidator() | public Reply | ingoingFilter(Request request) The request pre-processing hook.
Before each request is launched, all filters will be called back through
this method. | public void | initialize(HttpManager manager) | public boolean | isConnected() | public boolean | isShared() | public Reply | outgoingFilter(Request request, Reply reply) The request post-processing hook. | public boolean | propertyChanged(String name) Property monitoring for the CacheFilter.
The CacheFilter allows you to dynamically (typically through the
property setter) change the class of the sweeper, the validator,
the size...
Parameters: name - The name of the property that has changed. | public void | pushDocument(Request request, Reply reply) Push a document in the cache.
The caller has to forge a a request and a reply before being able
to make something
enter the cache. | protected Request | setRequestRevalidation(CachedResource res, Request req) | final protected void | setWarnings(Request request, Reply reply) Copy all warnings colllected into the given reply. | public void | sync() | final protected void | trace(Request request, String msg) |
CACHE_CONNECTED_P | final public static String CACHE_CONNECTED_P(Code) | | Name of the property enabling the connected/disconnected mode
|
CACHE_SIZE_P | final public static String CACHE_SIZE_P(Code) | | The name of the properties indicating the size of the cache (in bytes).
This property will give the value of the disk-based cache size. This
value only takes into account the size of the entities saved, not
the size of the associated headers, and not the physical size on the
disc.
This property defaults to 5000000 bytes.
|
DEBUG_P | final public static String DEBUG_P(Code) | | Name of the property indicating if the cache is in debug mode.
This property defaults to false.
|
SHARED_P | final public static String SHARED_P(Code) | | Name of the property indicating if this cache is shared.
This property defaults to true.
|
STATE_NOCACHE | final public static String STATE_NOCACHE(Code) | | The state used to disable that filter per request. Also set by the cache
if the request cannot be fullfilled by caches, as detected by this
filter.
|
STATE_ORIGREQ | final public static String STATE_ORIGREQ(Code) | | Name of the request state used tokeep track of original request
|
STATE_REVALIDATION | final public static String STATE_REVALIDATION(Code) | | Name of the request state that marks a request as being a revalidation.
|
STATE_WARNINGS | final public static String STATE_WARNINGS(Code) | | Name of the request state used to collect warnings.
|
WARN_DISCONNECTED | protected static HttpWarning WARN_DISCONNECTED(Code) | | The HTTP warning used to notify of a disconnected cache.
|
WARN_HEURISTIC | protected static HttpWarning WARN_HEURISTIC(Code) | | The HTTP warning used to indicate a heuristic expiration time.
|
WARN_STALE | protected static HttpWarning WARN_STALE(Code) | | The HTTP warning used to mark invalid entries
|
connected | protected boolean connected(Code) | | |
debug | protected boolean debug(Code) | | |
shared | protected boolean shared(Code) | | |
addWarning | protected void addWarning(Request request, HttpWarning warning)(Code) | | Add a warning, to be emitted at reply time.
The cache filter keeps track, through a specific piece of request state
of the warnings to be emitted at reply time (if any).
During request processing, cached resources can add any kind
of warnings, which will be collected and forwarded back to the reply.
Parameters: request - The request being process, and whose reply requiressome warnings. Parameters: warning - The warning to be emitted if ever we use the cachefilter to answer the above request. |
canCache | public boolean canCache(Request req, Reply rep)(Code) | | Checks if, according to the headers of the reply, an entity may
be cached or not, it decorates also the reply
Parameters: a - request, the client side request Parameters: a - reply, the client side reply a boolean, true if the resource can be cached |
canStore | public boolean canStore(Request req, Reply rep)(Code) | | Checks if, according to the headers of a reply we can store
the resource.
Note that a resource may be cachable, but not storable (memory cache)
although is MUST do its best to get rid of it asap, in our case we just
don't store it!
Parameters: a - request, the client side request Parameters: a - reply, the client side reply a boolean, true if the resource can be stored by the cache |
canUseCache | public boolean canUseCache(Request req)(Code) | | check if we can use the cache or not for this request
It marks the request as being not cachable if false.
Parameters: a - request, the incoming client-side request a boolean, true if we can use the cache |
cleanUpload | protected synchronized void cleanUpload(CachedResource cr)(Code) | | do what is needed when an upload is done!
ie: remove from the precache and put in the store
Parameters: the - CachedResource to be moved. |
exceptionFilter | public boolean exceptionFilter(Request request, HttpException ex)(Code) | | This filter handle exceptions.
Parameters: request - The request that triggered the exception. Parameters: ex - The triggered exception. Always false. |
getSerializer | public CacheSerializer getSerializer()(Code) | | return the serializer used by the cache
an instance of Serializer |
getSweeper | public CacheSweeper getSweeper()(Code) | | return the cache sweeper used by the cache
an instance of CacheSweeper |
getValidator | public CacheValidator getValidator()(Code) | | return the cache validator used by the cache
an instance of CacheValidator |
ingoingFilter | public Reply ingoingFilter(Request request) throws HttpException(Code) | | The request pre-processing hook.
Before each request is launched, all filters will be called back through
this method. They will generally set up additional request header
fields to enhance the request.
Parameters: request - The request that is about to be launched. An instance of Reply if the filter could handle the request,or null if processing should continue normally. exception: HttpException - If the filter is supposed to fulfill therequest, but some error happened during that processing. |
isConnected | public boolean isConnected()(Code) | | is the cache connected?
a boolean, true if the cache is connected |
isShared | public boolean isShared()(Code) | | is the cache shared?
a boolean, true if the cache is shared |
outgoingFilter | public Reply outgoingFilter(Request request, Reply reply) throws HttpException(Code) | | The request post-processing hook.
After each request has been replied to by the target server (be it a
proxy or the actual origin server), each filter's outgoingFilter
method is called.
It gets the original request, and the actual reply as a parameter,
and should return whatever reply it wants the caller to get.
Parameters: request - The original (handled) request. Parameters: reply - The reply, as emited by the target server, or constructedby some other filter. exception: HttpException - If the reply emitted by the server is nota valid HTTP reply. |
propertyChanged | public boolean propertyChanged(String name)(Code) | | Property monitoring for the CacheFilter.
The CacheFilter allows you to dynamically (typically through the
property setter) change the class of the sweeper, the validator,
the size...
Parameters: name - The name of the property that has changed. A boolean, true if the change was made, false otherwise. |
pushDocument | public void pushDocument(Request request, Reply reply)(Code) | | Push a document in the cache.
The caller has to forge a a request and a reply before being able
to make something
enter the cache.
The request should provide at least:
- URL
The URL (key for cache lookups)
- Method
The method that was "applied" to URL to get forged
reply.
It is recommended that the reply provides at least
the following informations:
- Status Code
A valid HTTP/1.1 status code (probably
200)
- InputStream
Containing the entity to be cached,
- EntityTag
A valid entity tag for the document,
- CacheControl
Appropriate HTTP/1.1 cache controls for that
document,
- Mime headers
At least a valid content type, and probably a
content length (to check consistency with the reply body).
|
setRequestRevalidation | protected Request setRequestRevalidation(CachedResource res, Request req)(Code) | | Modify a request to ask for a revalidation
Parameters: the - resource to be revalidated request, the original request to be modified |
setWarnings | final protected void setWarnings(Request request, Reply reply)(Code) | | Copy all warnings colllected into the given reply.
This method collects all HTTP warnings saved during request processing
and create (if needed) the approporiate warning header in the given
reply.
Parameters: request - The request that has been processed by the cache filter. Parameters: reply - The reply that has been constructed from the cache. See Also: CacheFilter.addWarning |
trace | final protected void trace(Request request, String msg)(Code) | | Display some output, related to the request (used for debugging)
|
|
|