com.ibm.wsspi.http

Interface HttpResponse


  1. public interface HttpResponse
Representation of an HTTP response message provided by the dispatcher to any HTTP container.

Method Summary

Modifier and Type Method and Description
  1. void
addCookie(HttpCookie cookie)
Add a cookie object to the message.
  1. void
addHeader(java.lang.String name,java.lang.String value)
Append a header on the message using the provided name and value pair.
  1. HttpOutputStream
getBody()
Access the output stream representation of the body for this message.
  1. long
getContentLength()
Query the current content-length header of the message.
  1. HttpCookie
getCookie(java.lang.String name)
Access the first instance of a cookie with the provided name.
  1. java.util.List<HttpCookie>
getCookies()
Access a list of all cookies found in this message.
  1. java.util.List<HttpCookie>
getCookies(java.lang.String name)
Access a list of all cookie instances matching the provided name.
  1. java.lang.String
getHeader(java.lang.String name)
Access the value associated with the first instance of the target header name.
  1. java.util.List<java.lang.String>
getHeaderNames()
Access a list of all header names found in this message.
  1. java.util.List<java.lang.String>
getHeaders()
Access a list of all header values in this message.
  1. java.util.List<java.lang.String>
getHeaders(java.lang.String name)
Access a list of all header values for a given header name.
  1. java.lang.String
getReason()
Query the current reason phrase of this message.
  1. int
getStatus()
Query the current status code of this message.
  1. java.lang.String
getVersion()
Query the current HTTP version of this message.
  1. boolean
isCommitted()
Check whether the response headers have been committed and sent out on the network or not.
  1. boolean
isPersistent()
Check whether the connection is persistent or not.
  1. void
removeAllHeaders()
Remove all headers and cookies from the message.
  1. void
removeCookie(HttpCookie cookie)
Remove a cookie object from the message.
  1. void
removeHeader(java.lang.String name)
Remove the target header from the message.
  1. void
reset()
Resets the status code, version, and headers.
  1. void
setContentLength(long length)
Set the content-length header of this message.
  1. void
setHeader(java.lang.String name,java.lang.String value)
Set a header on the message using the provided name and value pair.
  1. void
setReason(java.lang.String phrase)
Set the reason phrase to the input value.
  1. void
setStatus(int code)
Set the status code to the input value.
  1. void
setVersion(java.lang.String version)
Set the HTTP version of this message to the input value.

Method Detail

setStatus

  1. void setStatus(int code)
Set the status code to the input value.
Parameters:
code -

setReason

  1. void setReason(java.lang.String phrase)
Set the reason phrase to the input value.
Parameters:
phrase -

setVersion

  1. void setVersion(java.lang.String version)
Set the HTTP version of this message to the input value. This is expected to be of the form "HTTP/.".
Parameters:
version -

setContentLength

  1. void setContentLength(long length)
Set the content-length header of this message.
Parameters:
length -

setHeader

  1. void setHeader(java.lang.String name,
  2. java.lang.String value)
Set a header on the message using the provided name and value pair. This will replace any currently existing instances of the header name.
Parameters:
name -
value -
See Also:

addHeader

  1. void addHeader(java.lang.String name,
  2. java.lang.String value)
Append a header on the message using the provided name and value pair. This will be added to any current instance of the header name.
Parameters:
name -
value -
See Also:

addCookie

  1. void addCookie(HttpCookie cookie)
Add a cookie object to the message.
Parameters:
cookie -

removeCookie

  1. void removeCookie(HttpCookie cookie)
Remove a cookie object from the message.
Parameters:
cookie -

removeHeader

  1. void removeHeader(java.lang.String name)
Remove the target header from the message.
Parameters:
name -

removeAllHeaders

  1. void removeAllHeaders()
Remove all headers and cookies from the message.

isCommitted

  1. boolean isCommitted()
Check whether the response headers have been committed and sent out on the network or not.
Returns:
boolean

isPersistent

  1. boolean isPersistent()
Check whether the connection is persistent or not.
Returns:
boolean

reset

  1. void reset()
Resets the status code, version, and headers.

getStatus

  1. int getStatus()
Query the current status code of this message.
Returns:
int

getReason

  1. java.lang.String getReason()
Query the current reason phrase of this message.
Returns:
String

getVersion

  1. java.lang.String getVersion()
Query the current HTTP version of this message. It will be in the form of "HTTP/.".
Returns:
String

getContentLength

  1. long getContentLength()
Query the current content-length header of the message. This will be -1L if the header is not set.
Returns:
long

getHeader

  1. java.lang.String getHeader(java.lang.String name)
Access the value associated with the first instance of the target header name. This will return null if no instance was found.
Parameters:
name -
Returns:
String

getHeaders

  1. java.util.List<java.lang.String> getHeaders( java.lang.String name)
Access a list of all header values for a given header name. This list is never null, but might be empty.
Parameters:
name -
Returns:
List

getHeaders

  1. java.util.List<java.lang.String> getHeaders( )
Access a list of all header values in this message. This list is never null, but might be empty.
Returns:
List

getHeaderNames

  1. java.util.List<java.lang.String> getHeaderNames( )
Access a list of all header names found in this message. This list is never null, but might be empty.
Returns:
List

getCookie

  1. HttpCookie getCookie(java.lang.String name)
Access the first instance of a cookie with the provided name. This might be null if no match is found.
Parameters:
name -
Returns:
HttpCookie

getCookies

  1. java.util.List<HttpCookie> getCookies( java.lang.String name)
Access a list of all cookie instances matching the provided name. This list is never null, but might be empty.
Parameters:
name -
Returns:
List

getCookies

  1. java.util.List<HttpCookie> getCookies( )
Access a list of all cookies found in this message. The list is never null, but might be empty.
Returns:
List

getBody

  1. HttpOutputStream getBody()
Access the output stream representation of the body for this message.
Returns:
HttpOutputStream