Package com.ibm.wsspi.http
Interface HttpResponse
- 
 public interface HttpResponseRepresentation of an HTTP response message provided by the dispatcher to any HTTP container.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCookie(HttpCookie cookie)Add a cookie object to the message.voidaddHeader(java.lang.String name, java.lang.String value)Append a header on the message using the provided name and value pair.HttpOutputStreamgetBody()Access the output stream representation of the body for this message.longgetContentLength()Query the current content-length header of the message.HttpCookiegetCookie(java.lang.String name)Access the first instance of a cookie with the provided name.java.util.List<HttpCookie>getCookies()Access a list of all cookies found in this message.java.util.List<HttpCookie>getCookies(java.lang.String name)Access a list of all cookie instances matching the provided name.java.lang.StringgetHeader(java.lang.String name)Access the value associated with the first instance of the target header name.java.util.List<java.lang.String>getHeaderNames()Access a list of all header names found in this message.java.util.List<java.lang.String>getHeaders()Access a list of all header values in this message.java.util.List<java.lang.String>getHeaders(java.lang.String name)Access a list of all header values for a given header name.java.lang.StringgetReason()Query the current reason phrase of this message.intgetStatus()Query the current status code of this message.java.lang.StringgetVersion()Query the current HTTP version of this message.booleanisCommitted()Check whether the response headers have been committed and sent out on the network or not.booleanisPersistent()Check whether the connection is persistent or not.voidremoveAllHeaders()Remove all headers and cookies from the message.voidremoveCookie(HttpCookie cookie)Remove a cookie object from the message.voidremoveHeader(java.lang.String name)Remove the target header from the message.voidreset()Resets the status code, version, and headers.voidsetContentLength(long length)Set the content-length header of this message.voidsetHeader(java.lang.String name, java.lang.String value)Set a header on the message using the provided name and value pair.voidsetReason(java.lang.String phrase)Set the reason phrase to the input value.voidsetStatus(int code)Set the status code to the input value.voidsetTrailer(java.lang.String name, java.lang.String value)Sets a trailer header to follow the body of this messagevoidsetVersion(java.lang.String version)Set the HTTP version of this message to the input value.voidwriteTrailers()Write trailer when all have been set.
 
- 
- 
- 
Method Detail- 
setStatusvoid setStatus(int code) Set the status code to the input value.- Parameters:
- code-
 
 - 
setReasonvoid setReason(java.lang.String phrase) Set the reason phrase to the input value.- Parameters:
- phrase-
 
 - 
setVersionvoid 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-
 
 - 
setContentLengthvoid setContentLength(long length) Set the content-length header of this message.- Parameters:
- length-
 
 - 
setHeadervoid setHeader(java.lang.String name, 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(String, String)
 
 - 
addHeadervoid addHeader(java.lang.String name, 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:
- setHeader(String, String)
 
 - 
addCookievoid addCookie(HttpCookie cookie) Add a cookie object to the message.- Parameters:
- cookie-
 
 - 
removeCookievoid removeCookie(HttpCookie cookie) Remove a cookie object from the message.- Parameters:
- cookie-
 
 - 
removeHeadervoid removeHeader(java.lang.String name) Remove the target header from the message.- Parameters:
- name-
 
 - 
removeAllHeadersvoid removeAllHeaders() Remove all headers and cookies from the message.
 - 
isCommittedboolean isCommitted() Check whether the response headers have been committed and sent out on the network or not.- Returns:
- boolean
 
 - 
isPersistentboolean isPersistent() Check whether the connection is persistent or not.- Returns:
- boolean
 
 - 
resetvoid reset() Resets the status code, version, and headers.
 - 
getStatusint getStatus() Query the current status code of this message.- Returns:
- int
 
 - 
getReasonjava.lang.String getReason() Query the current reason phrase of this message.- Returns:
- String
 
 - 
getVersionjava.lang.String getVersion() Query the current HTTP version of this message. It will be in the form of "HTTP/. ". - Returns:
- String
 
 - 
getContentLengthlong getContentLength() Query the current content-length header of the message. This will be -1L if the header is not set.- Returns:
- long
 
 - 
getHeaderjava.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
 
 - 
getHeadersjava.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
 
 - 
getHeadersjava.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
 
 - 
getHeaderNamesjava.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
 
 - 
getCookieHttpCookie 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
 
 - 
getCookiesjava.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
 
 - 
getCookiesjava.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
 
 - 
getBodyHttpOutputStream getBody() Access the output stream representation of the body for this message.- Returns:
- HttpOutputStream
 
 - 
setTrailervoid setTrailer(java.lang.String name, java.lang.String value)Sets a trailer header to follow the body of this message- Parameters:
- name-
- value-
 
 - 
writeTrailersvoid writeTrailers() Write trailer when all have been set.- Parameters:
- name-
- value-
 
 
- 
 
-