|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.www.protocol.http.cache.CachedResource
public abstract class CachedResource
Field Summary | |
---|---|
protected ArrayDictionary |
a
|
protected static int |
ATTR_CONNEG_HEADERS
Attribute index - The request headers used for content negotiation as set by the reply Vary header. |
protected static int |
ATTR_CONTENT_ENCODING
Attribute index - The Content Encoding of the resource |
protected static int |
ATTR_CONTENT_LANGUAGE
Attribute index - The Content Language of the resource |
protected static int |
ATTR_CONTENT_LENGTH
Attribute index - The resource content length. |
protected static int |
ATTR_CONTENT_MD5
Attribute index - The Content MD5 of the resource |
protected static int |
ATTR_CURRENT_LENGTH
Attribute index - The resource current length. |
protected static int |
ATTR_DATE
Attribute index - The Date of the resource |
protected static java.lang.String[] |
ATTR_DESCR
The minimal attribute set used to describe a cachedresource without loading it entirely. |
protected static int |
ATTR_ETAG
Attribute index - The entity tag (if any) associated with the resource. |
protected static int |
ATTR_EXTRA_HEADERS
Attribute index - The extra headers attribute. |
protected static int |
ATTR_FILE
Attribute index - The file |
protected static int |
ATTR_IDENTIFIER
Attribute index - The identifier |
protected static int |
ATTR_LOAD_STATE
Attribute index - The download state |
protected static int |
ATTR_LOCATION
Attribute index - The Location of this resource |
protected static int |
ATTR_REPLY_LAST_MODIFIED
Attribute index - The Last modified of this resource |
protected static int |
ATTR_STATUS
Attribute index - The reply status. |
protected static int |
ATTR_VARY
Attribute index - The Vary of this resource |
static int |
COND_FAILED
Condition check return code - Condition existed but failed. |
static int |
COND_OK
Condition check return code - Condition existed and succeeded. |
protected CacheFilter |
filter
|
protected CacheGeneration |
generation
|
protected boolean |
invalidated
|
protected static java.lang.String |
NAME_CONTENT_LENGTH
Attribute name - The resource content length. |
protected static java.lang.String |
NAME_CURRENT_LENGTH
Attribute name - The resource current length |
protected static java.lang.String |
NAME_FILE
Attribute name - The identifier |
protected static java.lang.String |
NAME_IDENTIFIER
Attribute name - The identifier |
protected LRUAble |
next
LRU management - next entry. |
protected LRUAble |
prev
LRU management - previous entry. |
static int |
STATE_LOAD_COMPLETE
The download state of the resource, complete content |
static int |
STATE_LOAD_ERROR
The download state of the resource, erroneous, something weird happened! but at least we know that :) |
static int |
STATE_LOAD_PARTIAL
The download state of the resource, partial content |
static int |
STATE_LOAD_UNKNOWN
The download state of the resource, unknown, probably an HTTP/1.0 reply without the Content-Length. |
static int |
STATE_NOT_LOADED
The download state of the resource, currently not loaded |
protected boolean |
uploading
|
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
---|
attributes, values |
Constructor Summary | |
---|---|
CachedResource()
|
Method Summary | |
---|---|
long |
delete()
Delete this resource (and its associated file). |
ArrayDictionary |
getConnegHeaders()
Get the extra headers stored for that resource. |
java.lang.String[] |
getContentEncoding()
Get the Content-Encoding associated with that cached entry. |
java.lang.String[] |
getContentLanguage()
Get the Content-Language associated with that cached entry. |
int |
getContentLength()
Get this cached entry content length. |
java.lang.String |
getContentMD5()
Get the Content-MD5 associated with that cached entry. |
abstract MimeType |
getContentType()
Get the Content-Type of the cached resource of null if
there is no mime type (it should NEVER happen!) |
abstract int |
getCurrentAge()
returns the current age of this cached resource |
int |
getCurrentLength()
Get this cached entry current content length. |
long |
getDate()
Get this date, as a long |
java.lang.String |
getETag()
Get the entity tag associated with that cached entry. |
ArrayDictionary |
getExtraHeaders()
Get the extra headers stored for that resource. |
java.io.File |
getFile()
Get the cached File. |
abstract int |
getFreshnessLifetime()
returns the current freshness lifetime of this resource |
java.lang.String |
getIdentifier()
Get this cached entry identifier |
long |
getLastModified()
Get this Cached Resource last modification time. |
int |
getLoadState()
Get the load state value |
LRUAble |
getNext()
LRU management - Get next node. |
LRUAble |
getPrev()
LRU management - Get previous node. |
int |
getStatus()
Get the HTTP status of that cached entry. |
java.lang.String[] |
getVary()
Get the Vary associated with that cached entry. |
boolean |
getWillRevalidate()
Get state of the resource, did someone ask for revalidation for the next request? |
CachedResource |
lookupResource(Request request)
This methods return the CachedResource matching this request it allows lookup in the cache for alternatives |
void |
notifyTeeFailure(int size)
Called when the Tee stream fails, it allows you to notify a listener of an error in the stream. |
void |
notifyTeeSuccess(int size)
Called when the tee succeed, it allows you to notify a listener of the Tee that the download completed succesfully with a specific size |
abstract Reply |
perform(Request request)
This cached entry has been checked valid, perform given request. |
void |
setConnegHeaders(ArrayDictionary a)
Set a new set of extra headers for that resource. |
void |
setContentEncoding(java.lang.String[] sum)
Associate a Content-Encoding with that cached enrty. |
void |
setContentLanguage(java.lang.String[] language)
Associate a Content-Language with that cached enrty. |
void |
setContentLength(int length)
Set the content length of that cached entry. |
void |
setContentMD5(java.lang.String sum)
Associate a Content-MD5 with that cached enrty. |
abstract void |
setContentType(MimeType type)
Set the Content-Type of this cached resource |
void |
setCurrentLength(int length)
Set the current length of that cached entry. |
void |
setDate(long date)
Set the content length of that cached entry. |
void |
setETag(java.lang.String etag)
Associate an entity tag with that cached enrty. |
void |
setExtraHeaders(ArrayDictionary a)
Set a new set of extra headers for that resource. |
void |
setFile(java.io.File file)
Set the cached file |
void |
setLastModified(long lastmodified)
Set the last modified time of that cached entry. |
void |
setLoadState(int state)
Set the loading state of this resource |
void |
setNext(LRUAble next)
LRU management - Set next node. |
void |
setPrev(LRUAble prev)
LRU management - Set previous node. |
abstract Request |
setRequestRevalidation(Request request)
This cached entry needs revalidation, it will modify the request to do that. |
void |
setStatus(int status)
Set the reply status for that entry. |
void |
setValue(int idx,
java.lang.Object value)
overrides the default setValue to invalidate the ETag |
void |
setVary(java.lang.String[] vary)
Associate a Vary with that cached enrty. |
void |
setWillRevalidate(boolean invalidated)
Set this cached entry revalidate-on-next-request flag |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, getValue, initialize, initialize, lookupAttribute, pickleValues, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString, unsafeGetValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COND_FAILED
public static final int COND_OK
public static final int STATE_NOT_LOADED
public static final int STATE_LOAD_COMPLETE
public static final int STATE_LOAD_PARTIAL
public static final int STATE_LOAD_UNKNOWN
public static final int STATE_LOAD_ERROR
protected static int ATTR_IDENTIFIER
protected static int ATTR_CONTENT_LENGTH
protected static int ATTR_CURRENT_LENGTH
protected static int ATTR_FILE
protected static final java.lang.String NAME_CONTENT_LENGTH
protected static final java.lang.String NAME_CURRENT_LENGTH
protected static final java.lang.String NAME_IDENTIFIER
protected static final java.lang.String NAME_FILE
protected static int ATTR_LOAD_STATE
protected static int ATTR_ETAG
protected static int ATTR_STATUS
protected static int ATTR_REPLY_LAST_MODIFIED
protected static int ATTR_DATE
protected static int ATTR_CONTENT_MD5
protected static int ATTR_CONTENT_ENCODING
protected static int ATTR_CONTENT_LANGUAGE
protected static int ATTR_LOCATION
protected static int ATTR_VARY
protected static int ATTR_EXTRA_HEADERS
protected static int ATTR_CONNEG_HEADERS
protected static java.lang.String[] ATTR_DESCR
protected boolean invalidated
protected CacheGeneration generation
protected ArrayDictionary a
protected boolean uploading
protected CacheFilter filter
protected LRUAble prev
protected LRUAble next
Constructor Detail |
---|
public CachedResource()
Method Detail |
---|
public void notifyTeeFailure(int size)
TeeMonitor
notifyTeeFailure
in interface TeeMonitor
public void notifyTeeSuccess(int size)
TeeMonitor
notifyTeeSuccess
in interface TeeMonitor
public LRUAble getNext()
getNext
in interface LRUAble
public LRUAble getPrev()
getPrev
in interface LRUAble
public void setNext(LRUAble next)
setNext
in interface LRUAble
public void setPrev(LRUAble prev)
setPrev
in interface LRUAble
public void setValue(int idx, java.lang.Object value)
setValue
in class AttributeHolder
idx
- The attribute index, in the list of attributes advertized by
the resource.value
- The new value for this attribute.public abstract int getCurrentAge()
public abstract int getFreshnessLifetime()
public CachedResource lookupResource(Request request)
public java.lang.String getIdentifier()
public int getContentLength()
public void setContentLength(int length)
length
- The new content length of that entry.public int getCurrentLength()
public void setCurrentLength(int length)
length
- The current length of that entry.public int getLoadState()
The default is STATE_NOT_LOADED
public void setLoadState(int state)
an
- integer, one of the state defined in CachedResourceCachedResource
public int getStatus()
public void setStatus(int status)
status
- The HTTP status code of that entry, or -1
to undefine the previous setting.public long getLastModified()
public void setLastModified(long lastmodified)
lastmodified
- The last modification date as a number of
milliseconds since Java epoch, or -1 to undefine
previous setting.public abstract MimeType getContentType()
null
if
there is no mime type (it should NEVER happen!)
public abstract void setContentType(MimeType type)
a
- MimeType, the mime type of this resourcepublic boolean getWillRevalidate()
true
if it will.
-1 if undefined.public void setWillRevalidate(boolean invalidated)
validate,
- a boolean, true
if it will be revalidated
next time.public long getDate()
public void setDate(long date)
length
- The new content length of that entry.public void setFile(java.io.File file)
file
- public java.io.File getFile()
public java.lang.String getETag()
public void setETag(java.lang.String etag)
etag
- The entity tag of the entry, or null
to reset the value.public java.lang.String getContentMD5()
public void setContentMD5(java.lang.String sum)
sum,
- the md5 sum as a string, see RFC2616,
or null
to reset the value.public java.lang.String[] getContentEncoding()
public void setContentEncoding(java.lang.String[] sum)
sum,
- the encoding as a string,
or null
to reset the value.public java.lang.String[] getContentLanguage()
public void setContentLanguage(java.lang.String[] language)
sum,
- the encoding as a string,
or null
to reset the value.public java.lang.String[] getVary()
public void setVary(java.lang.String[] vary)
sum,
- the header involved in the variant check as a string array,
or null
to reset the value.public ArrayDictionary getExtraHeaders()
public void setExtraHeaders(ArrayDictionary a)
headers
- The new set of headers.public ArrayDictionary getConnegHeaders()
public void setConnegHeaders(ArrayDictionary a)
headers
- The new set of headers.public long delete()
public abstract Reply perform(Request request) throws HttpException
request
- The request to perform.
HttpException
- If something went wrong.public abstract Request setRequestRevalidation(Request request)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |