A HttpExchange must be closed to free or reuse
underlying resources. The effect of failing to close an exchange
is undefined.
| Modifier and Type | Field and Description |
|---|---|
| public static final String | REQUEST_CIPHER_SUITE
Standard property: cipher suite value when the request is received over HTTPS Type: String |
| public static final String | REQUEST_KEY_SIZE
Standard property: bit size of the algorithm when the request is received over HTTPS Type: Integer |
| public static final String | REQUEST_X509CERTIFICATE
Standard property: A SSL certificate, if any, associated with the request Type: java.security.cert.X509Certificate[] The order of this array is defined as being in ascending order of trust. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | addResponseHeader(String
the name of the header name, String the additional header value. If it contains octet string,
it should be encoded according to
RFC 2047 (http://www.ietf.org/rfc/rfc2047.txt) value)Adds a response header with the given name and value. |
| public abstract void | |
| public abstract Object | Returns: the attribute value, ornull if the attribute doesn't
existattribute name name)Returns an attribute that is associated with this
|
| public abstract Set | Returns: set of all attribute namesGives all the attribute names that are associated with
this |
| public abstract String | Returns: context path of all the endpoints in an applicationReturns the context path of all the endpoints in an application. |
| public abstract HttpContext | |
| public abstract InetSocketAddress | Returns: the InetSocketAddress of the local interfaceReturns the unresolved local address on which the request was received. |
| public abstract String | Returns: decoded extra path information of web service. It is the path that comes after the web service path but before the query string in the request URInull if there is no extra path in the request URIReturns the extra path information that follows the web service path but precedes the query string in the request URI and will start with a "/" character. |
| public abstract String | Returns: the protocol string from the requestReturns the protocol string from the request in the form protocol/majorVersion.minorVersion. |
| public abstract String | Returns: undecoded query string of request URI, ornull if the request URI doesn't have oneReturns the query string that is contained in the request URI after the path. |
| public abstract InetSocketAddress | Returns: the InetSocketAddress of the callerReturns the unresolved address of the remote entity invoking this request. |
| public abstract InputStream | Returns: the stream from which the request body can be read.Returns a stream from which the request body can be read. |
| public abstract String | Returns: returns the value of the requested header, or null if the request does not have a header of that namethe name of the request header name)Returns the value of the specified request header. |
| public abstract Map | Returns: an immutable Map which can be used to access request headersReturns an immutable Map containing the HTTP headers that were included with this request. |
| public abstract String | |
| public abstract String | Returns: the request URIReturns the part of the request's URI from the protocol name up to the query string in the first line of the HTTP request. |
| public abstract OutputStream | Returns: the stream to which the response body is writtenReturns a stream to which the response body must be written. |
| public abstract Map | Returns: a mutable Map which can be used to set response headers.Returns a mutable Map into which the HTTP response headers can be stored and which will be transmitted as part of this response. |
| public abstract String | Returns: name of the scheme used to make this requestReturns the name of the scheme used to make this request, for example: http, or https. |
| public abstract Principal | Returns: Principal for an authenticated user, ornull if not authenticatedReturns the |
| public abstract boolean | Returns: true if the user making this request belongs to a
given rolespecifies the name of the role role)Indicates whether an authenticated user is included in the specified logical "role". |
| public abstract void |
| REQUEST_CIPHER_SUITE | back to summary |
|---|---|
| public static final String REQUEST_CIPHER_SUITE Standard property: cipher suite value when the request is received over HTTPS Type: String | |
| REQUEST_KEY_SIZE | back to summary |
|---|---|
| public static final String REQUEST_KEY_SIZE Standard property: bit size of the algorithm when the request is received over HTTPS Type: Integer | |
| REQUEST_X509CERTIFICATE | back to summary |
|---|---|
| public static final String REQUEST_X509CERTIFICATE Standard property: A SSL certificate, if any, associated with the request Type: java.security.cert.X509Certificate[] The order of this array is defined as being in ascending order of trust. The first certificate in the chain is the one set by the client, the next is the one used to authenticate the first, and so on. | |
| HttpExchange | back to summary |
|---|---|
| public HttpExchange() | |
| addResponseHeader | back to summary |
|---|---|
| public abstract void addResponseHeader(String name, String value) Adds a response header with the given name and value. This method
allows a response header to have multiple values. This is a
convenience method to add a response header(instead of using the
| |
| close | back to summary |
|---|---|
| public abstract void close() throws IOException This must be called to end an exchange. Container takes care of closing request and response streams. This must be called so that the container can free or reuse underlying resources.
| |
| getAttribute | back to summary |
|---|---|
| public abstract Object getAttribute(String name) Returns an attribute that is associated with this
Servlet containers must expose If the request has been received by the container using HTTPS, the
following information must be exposed as attributes. These attributes
are | |
| getAttributeNames | back to summary |
|---|---|
| public abstract Set Gives all the attribute names that are associated with
this
| |
| getContextPath | back to summary |
|---|---|
| public abstract String getContextPath() Returns the context path of all the endpoints in an application. This path is the portion of the request URI that indicates the context of the request. The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. If this method returns "", the request is for default context. The container does not decode this string.
Context path is used in computing the endpoint address. See
| |
| getHttpContext | back to summary |
|---|---|
| public abstract HttpContext getHttpContext() Returns a
| |
| getLocalAddress | back to summary |
|---|---|
| public abstract InetSocketAddress getLocalAddress() Returns the unresolved local address on which the request was received.
| |
| getPathInfo | back to summary |
|---|---|
| public abstract String getPathInfo() Returns the extra path information that follows the web service path but precedes the query string in the request URI and will start with a "/" character.
This can be used for
| |
| getProtocol | back to summary |
|---|---|
| public abstract String getProtocol() Returns the protocol string from the request in the form protocol/majorVersion.minorVersion. For example, "HTTP/1.1"
| |
| getQueryString | back to summary |
|---|---|
| public abstract String getQueryString() Returns the query string that is contained in the request URI after the path.
This can be used for
| |
| getRemoteAddress | back to summary |
|---|---|
| public abstract InetSocketAddress getRemoteAddress() Returns the unresolved address of the remote entity invoking this request.
| |
| getRequestBody | back to summary |
|---|---|
| public abstract InputStream getRequestBody() throws IOException Returns a stream from which the request body can be read. Multiple calls to this method will return the same stream.
| |
| getRequestHeader | back to summary |
|---|---|
| public abstract String getRequestHeader(String name) Returns the value of the specified request header. If the request
did not include a header of the specified name, this method returns
null. If there are multiple headers with the same name, this method
returns the first header in the request. The header name is
case-insensitive. This is a convienence method to get a header
(instead of using the | |
| getRequestHeaders | back to summary |
|---|---|
| public abstract Map Returns an immutable Map containing the HTTP headers that were included with this request. The keys in this Map will be the header names, while the values will be a List of Strings containing each value that was included (either for a header that was listed several times, or one that accepts a comma-delimited list of values on a single line). In either of these cases, the values for the header name will be presented in the order that they were included in the request. The keys in Map are case-insensitive. | |
| getRequestMethod | back to summary |
|---|---|
| public abstract String getRequestMethod() Get the HTTP request method
| |
| getRequestURI | back to summary |
|---|---|
| public abstract String getRequestURI() Returns the part of the request's URI from the protocol name up to the query string in the first line of the HTTP request. Container doesn't decode this string.
| |
| getResponseBody | back to summary |
|---|---|
| public abstract OutputStream getResponseBody() throws IOException Returns a stream to which the response body must be
written.
| |
| getResponseHeaders | back to summary |
|---|---|
| public abstract Map Returns a mutable Map into which the HTTP response headers can be stored and which will be transmitted as part of this response. The keys in the Map will be the header names, while the values must be a List of Strings containing each value that should be included multiple times (in the order that they should be included). The keys in Map are case-insensitive. | |
| getScheme | back to summary |
|---|---|
| public abstract String getScheme() Returns the name of the scheme used to make this request, for example: http, or https.
| |
| getUserPrincipal | back to summary |
|---|---|
| public abstract Principal getUserPrincipal() Returns the
| |
| isUserInRole | back to summary |
|---|---|
| public abstract boolean isUserInRole(String role) Indicates whether an authenticated user is included in the specified logical "role".
| |
| setStatus | back to summary |
|---|---|
| public abstract void setStatus(int status) Sets the HTTP status code for the response.
This method must be called prior to calling
| |