All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.www.http.HttpReplyMessage

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

public class HttpReplyMessage
extends HttpEntityMessage

Variable Index

 o H_ACCEPT_RANGES
 o H_AGE
 o H_LOCATION
 o H_PROXY_AUTHENTICATE
 o H_PUBLIC
 o H_RETRY_AFTER
 o H_SERVER
 o H_VARY
 o H_WARNING
 o H_WWW_AUTHENTICATE
 o reason
The reason phrase.
 o status
The status associated with this reply.

Constructor Index

 o HttpReplyMessage()
 o HttpReplyMessage(MimeParser)

Method Index

 o addWarning(HttpWarning)
Add a warning to this reply message.
 o checkMustRevalidate()
Check the must-revalidate directive of the cache control header.
 o checkProxyRevalidate()
Check the proxy-revalidate directive of the cache control header.
 o checkPublic()
Check the public directive of the cache control header.
 o dump(OutputStream)
 o getAcceptRanges()
Get the list of accepted ranges.
 o getAge()
Get the age of the attached entity.
 o getLocation()
Get the location of the reply.
 o getPrivate()
Get the private directive of the cache control header.
 o getProxyAuthenticate()
Get the proxy authentication challenge from this reply.
 o getPublic()
Get the list of publicly allowed methods on queried resource.
 o getReason()
Get the reason phrase for this reply.
 o getServer()
Get the description of the server that generated this reply.
 o getStandardReason(int)
Get the standard HTTP reason phrase for the given status code.
 o getStatus()
Get this reply status code.
 o getVary()
Get the vary header value.
 o getWarning()
Get the list of warnings attached to this reply.
 o getWWWAuthenticate()
Get the challenge attached to this reply.
 o notifyBeginParsing(MimeParser)
MimeHeaderHolder implementation - Begining of reply parsing.
 o setAcceptRanges(String[])
Set the list of units in which range requests are accepted.
 o setAge(int)
Set the age of the attached entity.
 o setLocation(URL)
Set the location value of the reply.
 o setMustRevalidate(boolean)
Set the must-revalidate cache control directive.
 o setProxyAuthenticate(HttpChallenge)
Set thye proxy authentication challenge on this reply.
 o setProxyRevalidate(boolean)
Set the proxy-revalidate cache control directive.
 o setPublic(boolean)
Set the public cache control directive.
 o setPublic(String[])
Set the list of allowed method on queried resource.
 o setReason(String)
Set the reason phrase of this reply.
 o setServer(String)
Set the description of the server.
 o setStatus(int)
Set this reply status code.
 o setVary(String[])
Set the vary header value.
 o setWarning(HttpWarning[])
Set the warning list attached to this reply.
 o setWWWAuthenticate(HttpChallenge)
Attach a challenge to this reply.
 o startEmit(OutputStream, int)
Emit the status line before emiting the actual reply headers.

Variables

 o H_ACCEPT_RANGES
 public static int H_ACCEPT_RANGES
 o H_AGE
 public static int H_AGE
 o H_LOCATION
 public static int H_LOCATION
 o H_PROXY_AUTHENTICATE
 public static int H_PROXY_AUTHENTICATE
 o H_PUBLIC
 public static int H_PUBLIC
 o H_RETRY_AFTER
 public static int H_RETRY_AFTER
 o H_SERVER
 public static int H_SERVER
 o H_VARY
 public static int H_VARY
 o H_WARNING
 public static int H_WARNING
 o H_WWW_AUTHENTICATE
 public static int H_WWW_AUTHENTICATE
 o status
 protected int status
The status associated with this reply.

 o reason
 protected String reason
The reason phrase.

Constructors

 o HttpReplyMessage
 public HttpReplyMessage(MimeParser parser)
 o HttpReplyMessage
 public HttpReplyMessage()

Methods

 o startEmit
 protected void startEmit(OutputStream out,
                          int what) throws IOException
Emit the status line before emiting the actual reply headers.

Parameters:
out - The output stream to emit the reply to.
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 - Begining of reply parsing. If we can determine that this reply version number is less then 1.0, then we skip the header parsing by returning true to the MIME parser.

Otherwise, we parse the status line, and return false to make the MIME parser continue.

Returns:
A boolean true if the MIME parser should stop parsing, false otherwise.
Throws: IOException
If some IO error occured while reading the stream.
Overrides:
notifyBeginParsing in class HttpMessage
 o getStandardReason
 public String getStandardReason(int status)
Get the standard HTTP reason phrase for the given status code.

Parameters:
status - The given status code.
Returns:
A String giving the standard reason phrase, or null if the status doesn't match any knowned error.
 o getStatus
 public int getStatus()
Get this reply status code.

Returns:
An integer, giving the reply status code.
 o setStatus
 public void setStatus(int status)
Set this reply status code. This will also set the reply reason, to the default HTTP/1.1 reason phrase.

Parameters:
status - The status code for this reply.
 o getReason
 public String getReason()
Get the reason phrase for this reply.

Returns:
A String encoded reason phrase.
 o setReason
 public void setReason(String reason)
Set the reason phrase of this reply.

Parameters:
reason - The reason phrase for this reply.
 o getPrivate
 public String[] getPrivate()
Get the private directive of the cache control header.

Returns:
A list of fields (potentially empty) encoded as an array of String (with 0 length if empty), or null if undefined.
 o checkPublic
 public boolean checkPublic()
Check the public directive of the cache control header.

Returns:
A boolean true if set, false otherwise.
 o setPublic
 public void setPublic(boolean onoff)
Set the public cache control directive.

Parameters:
onoff - Set it on or off.
 o checkProxyRevalidate
 public boolean checkProxyRevalidate()
Check the proxy-revalidate directive of the cache control header.

Returns:
A boolean true if set, false otherwise.
 o setProxyRevalidate
 public void setProxyRevalidate(boolean onoff)
Set the proxy-revalidate cache control directive.

Parameters:
onoff - Set it on or off.
 o checkMustRevalidate
 public boolean checkMustRevalidate()
Check the must-revalidate directive of the cache control header.

Returns:
A boolean true if set, false otherwise.
 o setMustRevalidate
 public void setMustRevalidate(boolean onoff)
Set the must-revalidate cache control directive.

Parameters:
onoff - Set it on or off.
 o getAcceptRanges
 public String[] getAcceptRanges()
Get the list of accepted ranges.

Returns:
The list of units in which range requests are accepted, encoded as an array of String, or null if undefined.
 o setAcceptRanges
 public void setAcceptRanges(String units[])
Set the list of units in which range requests are accepted.

Parameters:
units - The list of units, encoded as a String array, or null to reset the value.
 o getAge
 public int getAge()
Get the age of the attached entity.

Returns:
An integer giving the age as a number of seconds, or -1 if undefined.
 o setAge
 public void setAge(int age)
Set the age of the attached entity.

Parameters:
age - The age of the attached entity as a number of seconds, or null to reset the value.
 o getLocation
 public String getLocation()
Get the location of the reply. The location header field keeps track of where to relocate clients if needed.

Returns:
The location encoded as a String.
 o setLocation
 public void setLocation(URL location)
Set the location value of the reply.

Parameters:
location - The location, or null to reset the value.
 o getProxyAuthenticate
 public HttpChallenge getProxyAuthenticate()
Get the proxy authentication challenge from this reply.

Returns:
An instance of HttpChallenge, or null if undefined.
 o setProxyAuthenticate
 public void setProxyAuthenticate(HttpChallenge challenge)
Set thye proxy authentication challenge on this reply.

Parameters:
challenge - The challenge to set, or null to reset the value.
 o getPublic
 public String[] getPublic()
Get the list of publicly allowed methods on queried resource.

Returns:
The list of methods, encoded as a String array, or null if undefined.
 o setPublic
 public void setPublic(String mth[])
Set the list of allowed method on queried resource.

Parameters:
mth - The list of public methods, encoded as a String array, or null to reset the value.
 o getServer
 public String getServer()
Get the description of the server that generated this reply.

Returns:
A String giving the description, or null if undefined.
 o setServer
 public void setServer(String server)
Set the description of the server.

Parameters:
server - The String decribing the server, or null to reset the value.
 o getVary
 public String[] getVary()
Get the vary header value.

Returns:
A list of field-names on which the negotiated resource vary, or a list containing only * (if varies on all headers), or null if undefined.
 o setVary
 public void setVary(String varies[])
Set the vary header value.

Parameters:
varies - The list of headers on which this resource varies, or null to reset the value.
 o getWarning
 public HttpWarning[] getWarning()
Get the list of warnings attached to this reply.

Returns:
An array of HttpWarning, or null if undefined.
 o setWarning
 public void setWarning(HttpWarning warnings[])
Set the warning list attached to this reply.

Parameters:
warnings - An array of warnings to attach to the given reply, or null to reset the value.
 o addWarning
 public void addWarning(HttpWarning warning)
Add a warning to this reply message.

Parameters:
warning - The warning to add.
 o getWWWAuthenticate
 public HttpChallenge getWWWAuthenticate()
Get the challenge attached to this reply.

Returns:
An instance of HttpChallenge, or null if undefined.
 o setWWWAuthenticate
 public void setWWWAuthenticate(HttpChallenge challenge)
Attach a challenge to this reply.

Parameters:
challenge - The challenge to be attached to the reply, or null to reset the value.

All Packages  Class Hierarchy  This Package  Previous  Next  Index