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.

Variable Index

 o ATTR_CONTENT_ENCODING
Attribute index - The index for the content encodings attribute.
 o ATTR_CONTENT_LANGUAGE
Attribute index - The index for the content languages attribute.
 o ATTR_CONTENT_LENGTH
Attribute index - The index for the content length attribute.
 o ATTR_CONTENT_TYPE
Attribute index - The index for the content type attribute.
 o ATTR_EXPIRES
Attribute index - The index for the expires attribute.
 o ATTR_ICON
Attribute index - The icon (if any) associated to the resource.
 o ATTR_LAST_MODIFIED
Attribute index - The index for the last-modified attribute.
 o ATTR_MAXAGE
Attribute index - Max age: the maximum drift allowed from reality.
 o ATTR_PARENT
Attribute index - The index for our parent attribute.
 o ATTR_QUALITY
Attributes index - The index for the quality attribute.
 o ATTR_SERVER
Attribute index - The index for our server attribute.
 o ATTR_TITLE
Attribute index - The index for the title attribute.
 o ATTR_URL
Attribute index - The index for our URL attribute.

Constructor Index

 o HTTPResource()

Method Index

 o delete(Request)
The default DELETE method replies with a not implemented.
 o extended(Request)
The handler for unknown method replies with a not implemented.
 o get(Request)
The default GET method replies with a not implemented.
 o getContentEncoding()
Get this resource content encoding.
 o getContentLanguage()
Get this resource content language.
 o getContentLength()
Get this resource content length.
 o getContentType()
Get this resource content type.
 o getExpires()
Get this resource expiration time.
 o getIcon()
Get this resource's icon.
 o getLastModified()
Get this resource last modification time.
 o getMaxAge()
Get this resource's max age.
 o getParent()
Get this resource parent resource.
 o getQuality()
Get this resource quality.
 o getServer()
Get the server this resource is served by.
 o getTitle()
Get this resource title.
 o getURL()
Get the URL this resource is attached to.
 o head(Request)
The default HEAD method replies does a GET and removes entity.
 o link(Request)
The default LINK method replies with a not implemented.
 o markModified()
Set an HTTPResource attribute.
 o perform(Request)
Perform the given request on this HTTP resource.
 o post(Request)
The default POST method replies with a not implemented.
 o put(Request)
The default PUT method replies with a not implemented.
 o unlink(Request)
The default UNLINK method replies with a not implemented.

Variables

 o ATTR_PARENT
  protected static int ATTR_PARENT
Attribute index - The index for our parent attribute.
 o ATTR_URL
  protected static int ATTR_URL
Attribute index - The index for our URL attribute.
 o ATTR_SERVER
  protected static int ATTR_SERVER
Attribute index - The index for our server attribute.
 o ATTR_QUALITY
  protected static int ATTR_QUALITY
Attributes index - The index for the quality attribute.
 o ATTR_TITLE
  protected static int ATTR_TITLE
Attribute index - The index for the title attribute.
 o ATTR_CONTENT_LANGUAGE
  protected static int ATTR_CONTENT_LANGUAGE
Attribute index - The index for the content languages attribute.
 o ATTR_CONTENT_ENCODING
  protected static int ATTR_CONTENT_ENCODING
Attribute index - The index for the content encodings attribute.
 o ATTR_CONTENT_TYPE
  protected static int ATTR_CONTENT_TYPE
Attribute index - The index for the content type attribute.
 o ATTR_CONTENT_LENGTH
  protected static int ATTR_CONTENT_LENGTH
Attribute index - The index for the content length attribute.
 o ATTR_LAST_MODIFIED
  protected static int ATTR_LAST_MODIFIED
Attribute index - The index for the last-modified attribute.
 o ATTR_EXPIRES
  protected static int ATTR_EXPIRES
Attribute index - The index for the expires attribute.
 o ATTR_ICON
  protected static int ATTR_ICON
Attribute index - The icon (if any) associated to the resource.
 o ATTR_MAXAGE
  protected static int ATTR_MAXAGE
Attribute index - Max age: the maximum drift allowed from reality.

Constructors

 o HTTPResource
  public HTTPResource()

Methods

 o 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
 o 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
 o 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.
 o getServer
  public httpd getServer()
Get the server this resource is served by.
Returns:
The first instance of Jigsaw this resource was attached to.
 o getQuality
  public double getQuality()
Get this resource quality.
Returns:
The resource quality, or some negative value if not defined.
 o getTitle
  public String getTitle()
Get this resource title.
Returns:
This resource's title, or null if not defined.
 o 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.
 o 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.
 o getContentType
  public MIMEType getContentType()
Get this resource content type.
Returns:
An instance of MIMEType, or null if not defined.
 o getContentLength
  public int getContentLength()
Get this resource content length.
Returns:
The resource content length, or -1 if not defined.
 o 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.
 o getExpires
  public long getExpires()
Get this resource expiration time.
Returns:
A long giving the expires date, or -1 if undefined.
 o getIcon
  public String getIcon()
Get this resource's icon.
 o 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.

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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