    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.http.HttpReplyMessage

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

public class HttpReplyMessage
extends HttpEntityMessage

##

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

##

HttpReplyMessage()
HttpReplyMessage(MimeParser)

##

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

##

H_ACCEPT_RANGES

     public static int H_ACCEPT_RANGES

H_AGE

     public static int H_AGE

H_LOCATION

     public static int H_LOCATION

H_PROXY_AUTHENTICATE

     public static int H_PROXY_AUTHENTICATE

H_PUBLIC

     public static int H_PUBLIC

H_RETRY_AFTER

     public static int H_RETRY_AFTER

H_SERVER

     public static int H_SERVER

H_VARY

     public static int H_VARY

H_WARNING

     public static int H_WARNING

H_WWW_AUTHENTICATE

     public static int H_WWW_AUTHENTICATE

status

     protected int status

  The status associated with this reply.

reason

     protected String reason

  The reason phrase.

##

HttpReplyMessage

     public HttpReplyMessage(MimeParser parser)

HttpReplyMessage

     public HttpReplyMessage()

##

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

dump

     public void dump(OutputStream out)

  Overrides:
    dump in class HttpMessage

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.
  Throws: HttpParserException
    if parsing failed.
  Overrides:
    notifyBeginParsing in class HttpMessage

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.

getStatus

     public int getStatus()

  Get this reply status code.

  Returns:
    An integer, giving the reply status code.

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.

getReason

     public String getReason()

  Get the reason phrase for this reply.

  Returns:
    A String encoded reason phrase.

setReason

     public void setReason(String reason)

  Set the reason phrase of this reply.

  Parameters:
    reason - The reason phrase for this reply.

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.

checkPublic

     public boolean checkPublic()

  Check the `public` directive of the cache control header.

  Returns:
    A boolean true if set, false otherwise.

setPublic

     public void setPublic(boolean onoff)

  Set the `public` cache control directive.

  Parameters:
    onoff - Set it on or off.

checkProxyRevalidate

     public boolean checkProxyRevalidate()

  Check the `proxy-revalidate` directive of the cache control header.

  Returns:
    A boolean true if set, false otherwise.

setProxyRevalidate

     public void setProxyRevalidate(boolean onoff)

  Set the `proxy-revalidate` cache control directive.

  Parameters:
    onoff - Set it on or off.

checkMustRevalidate

     public boolean checkMustRevalidate()

  Check the `must-revalidate` directive of the cache control header.

  Returns:
    A boolean true if set, false otherwise.

setMustRevalidate

     public void setMustRevalidate(boolean onoff)

  Set the `must-revalidate` cache control directive.

  Parameters:
    onoff - Set it on or off.

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.

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.

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.

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.

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.

setLocation

     public void setLocation(URL location)

  Set the location value of the reply.

  Parameters:
    location - The location, or null to reset the value.

getProxyAuthenticate

     public HttpChallenge getProxyAuthenticate()

  Get the proxy authentication challenge from this reply.

  Returns:
    An instance of HttpChallenge, or null if undefined.

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.

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.

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.

getServer

     public String getServer()

  Get the description of the server that generated this reply.

  Returns:
    A String giving the description, or null if undefined.

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.

setRetryAfter

     public void setRetryAfter(int delay)

  set the retry after as a delay

  Parameters:
    an - integer representing the delay, in seconds

setRetryAfter

     public void setRetryAfter(long date)

  set the retry after as a date

  Parameters:
    long - the date as a long

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.

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.

getWarning

     public HttpWarning[] getWarning()

  Get the list of warnings attached to this reply.

  Returns:
    An array of HttpWarning, or null if undefined.

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.

addWarning

     public void addWarning(HttpWarning warning)

  Add a warning to this reply message.

  Parameters:
    warning - The warning to add.

getWWWAuthenticate

     public HttpChallenge getWWWAuthenticate()

  Get the challenge attached to this reply.

  Returns:
    An instance of HttpChallenge, or null if undefined.

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