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
-
Field Summary
Fields declared in class HttpExchange
RSPBODY_CHUNKED, RSPBODY_EMPTYModifier and TypeFieldDescriptionstatic final longThe response body length is unspecified and will be chunk encodedstatic final longNo response body is being sent with this response -
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()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
HttpsExchange
protected HttpsExchange()Constructor for subclasses to call.
-
-
Method Details
-
getSSLSession
Get theSSLSessionfor this exchange.- Returns:
- the
SSLSession
-