All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.http.HttpRequestMessage

java.lang.Object
   |
   +----w3c.www.http.HttpMessage
           |
           +----w3c.www.http.HttpEntityMessage
                   |
                   +----w3c.www.http.HttpRequestMessage

public class HttpRequestMessage
extends HttpEntityMessage

Variable Index

 o H_ACCEPT
 o H_ACCEPT_CHARSET
 o H_ACCEPT_ENCODING
 o H_ACCEPT_LANGUAGE
 o H_AUTHORIZATION
 o H_FROM
 o H_HOST
 o H_IF_MATCH
 o H_IF_MODIFIED_SINCE
 o H_IF_NONE_MATCH
 o H_IF_RANGE
 o H_IF_UNMODIFIED_SINCE
 o H_MAX_FORWARDS
 o H_PROXY_AUTHORIZATION
 o H_RANGE
 o H_REFERER
 o H_USER_AGENT
 o method
The method to execute on the target resource.
 o proxy
The proxy to use for that request, if any.
 o sProxy
 o url
The target resource, identified by its URL.

Constructor Index

 o HttpRequestMessage()
 o HttpRequestMessage(MimeParser)

Method Index

 o dump(OutputStream)
 o getAccept()
Get this request accept list.
 o getAcceptCharset()
Get the list of accepted charsets for this request.
 o getAcceptEncoding()
Get the list of accepted encodings.
 o getAcceptLanguage()
Get the list of accepted languages for this request.
 o getAuthorization()
Get the authorization associated with this request.
 o getFrom()
Get the originator (from header value) of the request.
 o getHost()
Get the host header.
 o getIfMatch()
Get the conditional matching set of entity tags.
 o getIfModifiedSince()
Get the if-modified-since conditional.
 o getIfNoneMatch()
Get the conditional none matching entity tags.
 o getIfRange()
Get the if-range conditional if any.
 o getIfUnmodifiedSince()
Get the if unmodified since conditional date.
 o getMaxForwards()
Get the maximum allowed count of hops for the request.
 o getMaxStale()
Get the max-stale directive value of the cache control header.
 o getMethod()
Get this request's method.
 o getMinFresh()
Get the min-fresh directive value of the cache control header.
 o getProxy()
Get the proxy to use for that request.
 o getProxyAuthorization()
Get the authorization associated with this request.
 o getRange()
Get the ranges queried by this request.
 o getReferer()
Get the referer of the request.
 o getTarget()
 o getURL()
Get this request's target URI.
 o getUserAgent()
Get the user agent String.
 o hasAuthorization()
Does this request has some specific authorization infos.
 o hasProxy()
Will this request use a proxy when executed ?
 o main(String[])
 o notifyBeginParsing(MimeParser)
MimeHeaderHolder implementation - HTTP message about to be parsed.
 o setAccept(HttpAccept[])
Set the list of accept clauses attached to this request.
 o setAcceptCharset(HttpAcceptCharset[])
Set the list of accepted charsets for this request.
 o setAcceptEncoding(String[])
Set the list of accepted encodings.
 o setAcceptLanguage(HttpAcceptCharset[])
Set the list of accepted languages for this request.
 o setAuthorization(HttpCredential)
Set the authorization associated with this request.
 o setFrom(String)
Set the originator of this request.
 o setHost(String)
Set the host header value.
 o setIfMatch(HttpEntityTag[])
Set the conditional matching set of entity tags.
 o setIfModifiedSince(long)
Set the if-modified-since conditional.
 o setIfNoneMatch(HttpEntityTag[])
Set the conditional none matching entity tags.
 o setIfRange(HttpEntityTag)
Set the if-range header value.
 o setIfUnmodifiedSince(long)
Set the if-unmodified-since conditional date.
 o setMaxForwards(int)
Set the maximum allowed count of hops for that request.
 o setMaxStale(int)
Set the max-stale directive value.
 o setMethod(String)
Set this request's method.
 o setMinFresh(int)
Set the min-fresh directive value of the cache control header.
 o setProxy(URL)
Set the proxy to use for that request.
 o setProxyAuthorization(HttpCredential)
Set the proxy authorization associated with that request.
 o setRange(HttpRange[])
Set the ranges queried by this request.
 o setReferer(String)
Set the referer of this request.
 o setTarget(String)
 o setURL(URL)
Set this request URI.
 o setUserAgent(String)
Set the user agent description header.
 o startEmit(OutputStream, int)
This message is about to be emited, emit the request-line first !

Variables

 o H_ACCEPT
 public static int H_ACCEPT
 o H_ACCEPT_CHARSET
 public static int H_ACCEPT_CHARSET
 o H_ACCEPT_ENCODING
 public static int H_ACCEPT_ENCODING
 o H_ACCEPT_LANGUAGE
 public static int H_ACCEPT_LANGUAGE
 o H_AUTHORIZATION
 public static int H_AUTHORIZATION
 o H_FROM
 public static int H_FROM
 o H_HOST
 public static int H_HOST
 o H_IF_MODIFIED_SINCE
 public static int H_IF_MODIFIED_SINCE
 o H_IF_MATCH
 public static int H_IF_MATCH
 o H_IF_NONE_MATCH
 public static int H_IF_NONE_MATCH
 o H_IF_RANGE
 public static int H_IF_RANGE
 o H_IF_UNMODIFIED_SINCE
 public static int H_IF_UNMODIFIED_SINCE
 o H_MAX_FORWARDS
 public static int H_MAX_FORWARDS
 o H_PROXY_AUTHORIZATION
 public static int H_PROXY_AUTHORIZATION
 o H_RANGE
 public static int H_RANGE
 o H_REFERER
 public static int H_REFERER
 o H_USER_AGENT
 public static int H_USER_AGENT
 o method
 protected String method
The method to execute on the target resource.

 o url
 protected URL url
The target resource, identified by its URL.

 o proxy
 protected URL proxy
The proxy to use for that request, if any.

 o sProxy
 protected String sProxy

Constructors

 o HttpRequestMessage
 public HttpRequestMessage(MimeParser parser)
 o HttpRequestMessage
 public HttpRequestMessage()

Methods

 o startEmit
 protected void startEmit(OutputStream out,
                          int what) throws IOException
This message is about to be emited, emit the request-line first !

Parameters:
out - The output stream to emit the request to.
Throws: IOException
If some IO error occured while emiting the request.
Overrides:
startEmit in class HttpMessage
 o dump
 public void dump(OutputStream out)
Overrides:
dump in class HttpMessage
 o notifyBeginParsing
 public boolean notifyBeginParsing(MimeParser parser) throws HttpParserException, IOException
MimeHeaderHolder implementation - HTTP message about to be parsed.

Overrides:
notifyBeginParsing in class HttpMessage
 o setTarget
 protected void setTarget(String target)
 o getTarget
 protected String getTarget()
 o getMethod
 public String getMethod()
Get this request's method.

Returns:
The request method, as a String.
 o setMethod
 public void setMethod(String method)
Set this request's method.

Parameters:
mth - The request method.
 o getURL
 public URL getURL()
Get this request's target URI. This will only return the absolute path of the requested resource, even if the actual request came with the full path as an URI.

Returns:
An URL instance, or null if undefined.
 o setURL
 public void setURL(URL url)
Set this request URI. The provided URI should only include the absolute path of the target request, see the setHost method for how to set the actual host of the target resource.

Parameters:
url - The target URL of the request, as an URL instance.
 o getMinFresh
 public int getMinFresh()
Get the min-fresh directive value of the cache control header.

Returns:
The min-fresh value, as a number of seconds, or -1 if undefined.
 o setMinFresh
 public void setMinFresh(int minfresh)
Set the min-fresh directive value of the cache control header.

Parameters:
minfresh - The min-fresh value, in seconds, or -1 to reset value.
 o getMaxStale
 public int getMaxStale()
Get the max-stale directive value of the cache control header.

Returns:
The max-stale value, as a number of seconds, or -1 if undefined.
 o setMaxStale
 public void setMaxStale(int maxstale)
Set the max-stale directive value.

Parameters:
maxstale - A number of seconds giving the allowed drift for a resource that is no more valid, or -1 to reset the value.
 o getAccept
 public HttpAccept[] getAccept()
Get this request accept list.

Returns:
A list of Accept clauses encoded as an array of HttpAccept instances, or null if undefined.
 o setAccept
 public void setAccept(HttpAccept accepts[])
Set the list of accept clauses attached to this request.

Parameters:
accepts - The list of accept clauses encoded as an array of HttpAccept instances, or null to reset the value.
 o getAcceptCharset
 public HttpAcceptCharset[] getAcceptCharset()
Get the list of accepted charsets for this request.

Returns:
The list of accepted languages encoded as an array of instances of HttpAcceptCharset, or null if undefined.
 o setAcceptCharset
 public void setAcceptCharset(HttpAcceptCharset charsets[])
Set the list of accepted charsets for this request.

Parameters:
charsets - The list of accepted charsets, encoded as an array of HttpAcceptCharset instances, or null to reset the value.
 o getAcceptEncoding
 public String[] getAcceptEncoding()
Get the list of accepted encodings.

Returns:
A list of token describing the accepted encodings, or null if undefined.
 o setAcceptEncoding
 public void setAcceptEncoding(String encoding[])
Set the list of accepted encodings.

Parameters:
encodings - The list of accepted encodings, as a String array, or null to reset the value.
 o getAcceptLanguage
 public HttpAcceptLanguage[] getAcceptLanguage()
Get the list of accepted languages for this request.

Returns:
The list of accepted languages encoded as an array of instances of HttpAcceptLanguage, or null if undefined.
 o setAcceptLanguage
 public void setAcceptLanguage(HttpAcceptCharset langs[])
Set the list of accepted languages for this request.

Parameters:
langs - The list of accepted languages, encoded as an array of HttpAcceptLanguage instances, or null to reset value.
 o getAuthorization
 public HttpCredential getAuthorization()
Get the authorization associated with this request.

Returns:
An instance of HttpCredential of null if undefined.
 o setAuthorization
 public void setAuthorization(HttpCredential credentials)
Set the authorization associated with this request.

Parameters:
credentials - The credentials to attach to this request, or null to reset the value.
 o hasAuthorization
 public boolean hasAuthorization()
Does this request has some specific authorization infos.

Returns:
A boolean.
 o getFrom
 public String getFrom()
Get the originator (from header value) of the request.

Returns:
The originator description, as a String, or null if undefined.
 o setFrom
 public void setFrom(String from)
Set the originator of this request.

Parameters:
from - The description of the originator, as an email address, or null to reset the value.
 o getHost
 public String getHost()
Get the host header.

Returns:
The host header, encoded as a String, or null if undefined.
 o setHost
 public void setHost(String host)
Set the host header value.

Parameters:
host - The String representing the target host of the request, or null to reset the value.
 o getIfModifiedSince
 public long getIfModifiedSince()
Get the if-modified-since conditional.

Returns:
A long, giving the If-Modified-Since date value as the number of milliseconds since Java epoch, or -1 if undefined.
 o setIfModifiedSince
 public void setIfModifiedSince(long ims)
Set the if-modified-since conditional.

Parameters:
ims - The date of last modification, as the number of milliseconds since Java epoch, or -1 to reset the value.
 o getIfMatch
 public HttpEntityTag[] getIfMatch()
Get the conditional matching set of entity tags.

Returns:
An array of HttpEntityTag instances, or null if undefined.
 o setIfMatch
 public void setIfMatch(HttpEntityTag etags[])
Set the conditional matching set of entity tags.

Parameters:
etags - An array of HttpEntityTag, one per item in the set, or null to reset the header value.
 o getIfNoneMatch
 public HttpEntityTag[] getIfNoneMatch()
Get the conditional none matching entity tags.

Returns:
An entity tag list, encoded as an array of HttpEntityTag, or null if undefined.
 o setIfNoneMatch
 public void setIfNoneMatch(HttpEntityTag etags[])
Set the conditional none matching entity tags.

Parameters:
etags - An array of HttpEntityTag, one per item in the set, or null to reset the value.
 o getIfRange
 public HttpEntityTag getIfRange()
Get the if-range conditional if any. Warning: This API doesn't accept If-Range header that contains date value (if you want to discuss why, send me email)

Returns:
An HttpEntityTag instance, or null if that header is not defined.
 o setIfRange
 public void setIfRange(HttpEntityTag etag)
Set the if-range header value.

Parameters:
etag - The contional etag, or null to reset previous setting.
 o getIfUnmodifiedSince
 public long getIfUnmodifiedSince()
Get the if unmodified since conditional date.

Returns:
The date encoded as a long number of milliseconds since Java runtime epoch, or -1 if undefined.
 o setIfUnmodifiedSince
 public void setIfUnmodifiedSince(long date)
Set the if-unmodified-since conditional date.

Parameters:
date - The date, encoded as the number of milliseconds since Java epoch, or -1 to reset value.
 o getMaxForwards
 public int getMaxForwards()
Get the maximum allowed count of hops for the request.

Returns:
An integer giving the number of hops, or -1 if undefined.
 o setMaxForwards
 public void setMaxForwards(int hops)
Set the maximum allowed count of hops for that request.

Parameters:
hops - The hops count, or -1 to reset value.
 o setProxyAuthorization
 public void setProxyAuthorization(HttpCredential credentials)
Set the proxy authorization associated with that request.

Parameters:
credentials - The credentials, or null to reset the value.
 o getProxyAuthorization
 public HttpCredential getProxyAuthorization()
Get the authorization associated with this request.

Returns:
An instance of HttpCredential of null if undefined.
 o getRange
 public HttpRange[] getRange()
Get the ranges queried by this request.

Returns:
A list of ranges, encoded as an array of HttpRange instance or null if undefined.
 o setRange
 public void setRange(HttpRange ranges[])
Set the ranges queried by this request.

Parameters:
ranges - The list of ranges, encoded as an array of instances of HttpRange, or null to reset the value.
 o getReferer
 public String getReferer()
Get the referer of the request.

Returns:
A String encoding the referer (generally an URL), or null if undefined.
 o setReferer
 public void setReferer(String referer)
Set the referer of this request.

Parameters:
referer - The referer of the request, or null to reset the value.
 o getUserAgent
 public String getUserAgent()
Get the user agent String.

Returns:
The user agent description, as a String, or null if undefined.
 o setUserAgent
 public void setUserAgent(String ua)
Set the user agent description header.

Parameters:
ua - The description of the user agent emiting the request, or null to reset the value.
 o setProxy
 public void setProxy(URL proxy)
Set the proxy to use for that request.

Parameters:
proxy - The proxy's URL, or null to reset value.
 o getProxy
 public URL getProxy()
Get the proxy to use for that request.

Returns:
The proxy's URL, or null if none is set.
 o hasProxy
 public boolean hasProxy()
Will this request use a proxy when executed ?

Returns:
A boolean.
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index