Class HttpsExchange
java.lang.Object
com.sun.net.httpserver.HttpExchange
com.sun.net.httpserver.HttpsExchange
- All Implemented Interfaces:
Request, AutoCloseable
This class encapsulates a HTTPS request received and a response to be
generated in one exchange and defines the extensions to
HttpExchange
that are specific to the HTTPS protocol.- Since:
- 1.6
-
Constructor Summary
Constructors -
Method Summary
Methods declared in class HttpExchange
close, getAttribute, getHttpContext, getLocalAddress, getPrincipal, getProtocol, getRemoteAddress, getRequestBody, getRequestHeaders, getRequestMethod, getRequestURI, getResponseBody, getResponseCode, getResponseHeaders, sendResponseHeaders, setAttribute, setStreamsModifier and TypeMethodDescriptionabstract voidclose()Ends this exchange by doing the following in sequence: close the requestInputStream, if not already closed.abstract ObjectgetAttribute(String name) Filtermodules may store arbitrary objects withHttpExchangeinstances as an out-of-band communication mechanism.abstract HttpContextReturns theHttpContextfor this exchange.abstract InetSocketAddressReturns the local address on which the request was received.abstract HttpPrincipalIf an authenticator is set on theHttpContextthat owns this exchange, then this method will return theHttpPrincipalthat represents the authenticated user for thisHttpExchange.abstract StringReturns the protocol string from the request in the form protocol/majorVersion.minorVersion.abstract InetSocketAddressReturns the address of the remote entity invoking this request.abstract InputStreamReturns a stream from which the request body can be read.abstract HeadersReturns an immutableHeaderscontaining the HTTP headers that were included with this request.abstract StringReturns the request method.abstract URIReturns the requestURI.abstract OutputStreamReturns a stream to which the response body must be written.abstract intReturns the response code, if it has already been set.abstract HeadersReturns a mutableHeadersinto which the HTTP response headers can be stored and which will be transmitted as part of this response.abstract voidsendResponseHeaders(int rCode, long responseLength) Starts sending the response back to the client using the current set of response headers and the numeric response code as specified in this method.abstract voidsetAttribute(String name, Object value) Filtermodules may store arbitrary objects withHttpExchangeinstances as an out-of-band communication mechanism.abstract voidUsed by Filters to wrap either (or both) of this exchange'sInputStreamandOutputStream, with the given filtered streams so that subsequent calls toHttpExchange.getRequestBody()will return the givenInputStream, and calls toHttpExchange.getResponseBody()will return the givenOutputStream.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
HttpsExchange
protected HttpsExchange()Constructor for subclasses to call.
-
-
Method Details
-
getSSLSession
Get theSSLSessionfor this exchange.- Returns:
- the
SSLSession
-