Class w3c.jigsaw.resources.HTTPResource
All Packages Class Hierarchy This Package Previous Next Index
Class w3c.jigsaw.resources.HTTPResource
java.lang.Object
|
+----w3c.jigsaw.resources.AttributeHolder
|
+----w3c.jigsaw.resources.Resource
|
+----w3c.jigsaw.resources.HTTPResource
- public class HTTPResource
- extends Resource
The basic HTTP resource.
Defines a bunch of attributes for all HTTP resources, and all the HTTP
method that provides access to them.
-
ATTR_CONTENT_ENCODING
- Attribute index - The index for the content encodings attribute.
-
ATTR_CONTENT_LANGUAGE
- Attribute index - The index for the content languages attribute.
-
ATTR_CONTENT_LENGTH
- Attribute index - The index for the content length attribute.
-
ATTR_CONTENT_TYPE
- Attribute index - The index for the content type attribute.
-
ATTR_EXPIRES
- Attribute index - The index for the expires attribute.
-
ATTR_ICON
- Attribute index - The icon (if any) associated to the resource.
-
ATTR_LAST_MODIFIED
- Attribute index - The index for the last-modified attribute.
-
ATTR_MAXAGE
- Attribute index - Max age: the maximum drift allowed from reality.
-
ATTR_PARENT
- Attribute index - The index for our parent attribute.
-
ATTR_QUALITY
- Attributes index - The index for the quality attribute.
-
ATTR_SERVER
- Attribute index - The index for our server attribute.
-
ATTR_TITLE
- Attribute index - The index for the title attribute.
-
ATTR_URL
- Attribute index - The index for our URL attribute.
-
HTTPResource()
-
-
delete(Request)
- The default DELETE method replies with a not implemented.
-
extended(Request)
- The handler for unknown method replies with a not implemented.
-
get(Request)
- The default GET method replies with a not implemented.
-
getContentEncoding()
- Get this resource content encoding.
-
getContentLanguage()
- Get this resource content language.
-
getContentLength()
- Get this resource content length.
-
getContentType()
- Get this resource content type.
-
getExpires()
- Get this resource expiration time.
-
getIcon()
- Get this resource's icon.
-
getLastModified()
- Get this resource last modification time.
-
getMaxAge()
- Get this resource's max age.
-
getParent()
- Get this resource parent resource.
-
getQuality()
- Get this resource quality.
-
getServer()
- Get the server this resource is served by.
-
getTitle()
- Get this resource title.
-
getURL()
- Get the URL this resource is attached to.
-
head(Request)
- The default HEAD method replies does a GET and removes entity.
-
link(Request)
- The default LINK method replies with a not implemented.
-
markModified()
- Set an HTTPResource attribute.
-
perform(Request)
- Perform the given request on this HTTP resource.
-
post(Request)
- The default POST method replies with a not implemented.
-
put(Request)
- The default PUT method replies with a not implemented.
-
unlink(Request)
- The default UNLINK method replies with a not implemented.
ATTR_PARENT
protected static int ATTR_PARENT
- Attribute index - The index for our parent attribute.
ATTR_URL
protected static int ATTR_URL
- Attribute index - The index for our URL attribute.
ATTR_SERVER
protected static int ATTR_SERVER
- Attribute index - The index for our server attribute.
ATTR_QUALITY
protected static int ATTR_QUALITY
- Attributes index - The index for the quality attribute.
ATTR_TITLE
protected static int ATTR_TITLE
- Attribute index - The index for the title attribute.
ATTR_CONTENT_LANGUAGE
protected static int ATTR_CONTENT_LANGUAGE
- Attribute index - The index for the content languages attribute.
ATTR_CONTENT_ENCODING
protected static int ATTR_CONTENT_ENCODING
- Attribute index - The index for the content encodings attribute.
ATTR_CONTENT_TYPE
protected static int ATTR_CONTENT_TYPE
- Attribute index - The index for the content type attribute.
ATTR_CONTENT_LENGTH
protected static int ATTR_CONTENT_LENGTH
- Attribute index - The index for the content length attribute.
ATTR_LAST_MODIFIED
protected static int ATTR_LAST_MODIFIED
- Attribute index - The index for the last-modified attribute.
ATTR_EXPIRES
protected static int ATTR_EXPIRES
- Attribute index - The index for the expires attribute.
ATTR_ICON
protected static int ATTR_ICON
- Attribute index - The icon (if any) associated to the resource.
ATTR_MAXAGE
protected static int ATTR_MAXAGE
- Attribute index - Max age: the maximum drift allowed from reality.
HTTPResource
public HTTPResource()
markModified
public void markModified()
- Set an HTTPResource attribute.
Mark modified should also update our last-modification time.
- Parameters:
- idx - The index of the value to be set.
- value - Its new value.
- Overrides:
- markModified in class Resource
getParent
public ContainerResource getParent()
- Get this resource parent resource.
The parent of a resource can be either null if it is
the server root resource, or any ContainerResource.
- Returns:
- An instance of ContainerResource, or null
getURL
public String getURL()
- Get the URL this resource is attached to.
- Returns:
- An URL object specifying the location in the information
space of this resource.
getServer
public httpd getServer()
- Get the server this resource is served by.
- Returns:
- The first instance of Jigsaw this resource was attached to.
getQuality
public double getQuality()
- Get this resource quality.
- Returns:
- The resource quality, or some negative value if not defined.
getTitle
public String getTitle()
- Get this resource title.
- Returns:
- This resource's title, or null if not
defined.
getContentLanguage
public String getContentLanguage()
- Get this resource content language.
Language are stored as a comma separated String of tokens.
- Returns:
- A comma separated string of language tokens, or
null if undefined.
getContentEncoding
public String getContentEncoding()
- Get this resource content encoding.
The content encoding of a resource is stored as a comma separated
list of tokens (as decribed in the Content_encoding header of the
HTTP specification, and in the order they should appear in the header).
- Returns:
- A string of comma separated encoding tokens, or
null if not defined.
getContentType
public MIMEType getContentType()
- Get this resource content type.
- Returns:
- An instance of MIMEType, or null if not
defined.
getContentLength
public int getContentLength()
- Get this resource content length.
- Returns:
- The resource content length, or -1 if not
defined.
getLastModified
public long getLastModified()
- Get this resource last modification time.
- Returns:
- A long giving the date of the last modification time, or
-1 if undefined.
getExpires
public long getExpires()
- Get this resource expiration time.
- Returns:
- A long giving the expires date, or -1 if
undefined.
getIcon
public String getIcon()
- Get this resource's icon.
getMaxAge
public long getMaxAge()
- Get this resource's max age.
The max age of a resource indicates how much drift is allowed between
the physicall version of the resource, and any in-memory cached version
of it.
The max age attribute is a long number giving the number of
milliseconds of allowed drift.
get
public Reply get(Request request) throws HTTPException
- The default GET method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
head
public Reply head(Request request) throws HTTPException
- The default HEAD method replies does a GET and removes entity.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
post
public Reply post(Request request) throws HTTPException
- The default POST method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
put
public Reply put(Request request) throws HTTPException
- The default PUT method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
delete
public Reply delete(Request request) throws HTTPException
- The default DELETE method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
link
public Reply link(Request request) throws HTTPException
- The default LINK method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
unlink
public Reply unlink(Request request) throws HTTPException
- The default UNLINK method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
extended
public Reply extended(Request request) throws HTTPException
- The handler for unknown method replies with a not implemented.
- Parameters:
- request - The request to handle.
- Throws: HTTPException
- Always thrown, to return a NOT_IMPLEMENTED
error.
perform
public Reply perform(Request request) throws HTTPException
- Perform the given request on this HTTP resource.
- Parameters:
- request - The request to perform.
- Throws: HTTPException
- If the resource couldn't process this request.
All Packages Class Hierarchy This Package Previous Next Index