Package org.restlet.engine.adapter
Class JettyServerCall
java.lang.Object
org.restlet.engine.adapter.Call
org.restlet.engine.adapter.ServerCall
org.restlet.engine.adapter.JettyServerCall
Call that is used by the Jetty HTTP server connectors.
- Author:
- Jerome Louvel, Tal Liron
-
Constructor Summary
ConstructorsConstructorDescriptionJettyServerCall(Server server, org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanabort()Ask the connector to abort the related network connection, for example immediately closing the socket.voidcomplete()Complete the responsevoidFlushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.org.eclipse.jetty.util.CallbackReturns the wrapped Jetty HTTP callback.Returns the chain of client SSL certificates, if available and accessible.Returns the SSL Cipher Suite, if available and accessible.Returns the client address.
Corresponds to the IP address of the requesting client.intReturns the client port.
Corresponds to the TCP/IP port of the requesting client.protected org.eclipse.jetty.io.ConnectionReturns the underlying Jetty's connection.protected org.eclipse.jetty.io.EndPointReturns the underlying Jetty's endpoint.Returns the host domain name.intReturns the host port.Returns the request method.org.eclipse.jetty.server.RequestReturns the wrapped Jetty HTTP request.getRequestEntityStream(long size) Returns the request entity stream if it exists.Returns the modifiable list of request headers.Returns the request head stream if it exists.Returns the URI on the request line (most like a relative reference, but not necessarily).org.eclipse.jetty.server.ResponseReturns the wrapped Jetty HTTP response.Returns the response entity stream if it exists.Returns the response address.
Corresponds to the IP address of the responding server.Returns the SSL key size, if available and accessible.Returns the SSL session ID, in hexadecimal encoding, if available and accessible.booleanIndicates if the confidentiality of the call is ensured (ex: via SSL).booleanisConnectionBroken(Throwable exception) Returns true if the given exception is caused by a broken connection.voidsendResponse(Response response) Sends the response back to the client.Methods inherited from class org.restlet.engine.adapter.ServerCall
getContentLength, getRequestEntity, getSslSessionIdBytes, isClientKeepAlive, isServerKeepAlive, readRequestHead, shouldResponseBeChunked, writeResponseBody, writeResponseHead, writeResponseHeadMethods inherited from class org.restlet.engine.adapter.Call
getLogger, getProtocol, getReasonPhrase, getRepresentation, getResponseHeaders, getServerPort, getStatusCode, getUserPrincipal, getVersion, isBroken, isKeepAlive, isRequestChunked, isResponseChunked, setClientAddress, setClientPort, setConfidential, setHostDomain, setHostPort, setMethod, setProtocol, setReasonPhrase, setRequestUri, setServerAddress, setServerPort, setStatusCode, setUserPrincipal, setVersion
-
Constructor Details
-
JettyServerCall
public JettyServerCall(Server server, org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback) Constructor.- Parameters:
server- The parent server.request- The wrapped Jetty HTTP request.response- The wrapped Jetty HTTP response.callback- The wrapped Jetty HTTP callback.
-
-
Method Details
-
abort
public boolean abort()Description copied from class:ServerCallAsk the connector to abort the related network connection, for example immediately closing the socket.- Specified by:
abortin classServerCall- Returns:
- True if the connection was aborted.
-
complete
public void complete()Description copied from class:ServerCallComplete the response- Overrides:
completein classServerCall
-
flushBuffers
Description copied from class:ServerCallFlushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.- Overrides:
flushBuffersin classServerCall- Throws:
IOException
-
getCallback
public org.eclipse.jetty.util.Callback getCallback()Returns the wrapped Jetty HTTP callback.- Returns:
- The wrapped Jetty HTTP callback.
-
getCertificates
Description copied from class:ServerCallReturns the chain of client SSL certificates, if available and accessible.- Overrides:
getCertificatesin classServerCall- Returns:
- The chain of client SSL certificates, if available and accessible.
-
getRequest
public org.eclipse.jetty.server.Request getRequest()Returns the wrapped Jetty HTTP request.- Returns:
- The wrapped Jetty HTTP request.
-
getResponse
public org.eclipse.jetty.server.Response getResponse()Returns the wrapped Jetty HTTP response.- Returns:
- The wrapped Jetty HTTP response.
-
getCipherSuite
Description copied from class:ServerCallReturns the SSL Cipher Suite, if available and accessible.- Overrides:
getCipherSuitein classServerCall- Returns:
- The SSL Cipher Suite, if available and accessible.
-
getClientAddress
Description copied from class:CallReturns the client address.
Corresponds to the IP address of the requesting client.- Overrides:
getClientAddressin classCall- Returns:
- The client address.
-
getClientPort
public int getClientPort()Description copied from class:CallReturns the client port.
Corresponds to the TCP/IP port of the requesting client.- Overrides:
getClientPortin classCall- Returns:
- The client port.
-
getConnection
protected org.eclipse.jetty.io.Connection getConnection()Returns the underlying Jetty's connection.- Returns:
- The underlying Jetty's connection.
-
getEndPoint
protected org.eclipse.jetty.io.EndPoint getEndPoint()Returns the underlying Jetty's endpoint.- Returns:
- The underlying Jetty's endpoint.
-
getMethod
Description copied from class:CallReturns the request method. -
getRequestEntityStream
Description copied from class:ServerCallReturns the request entity stream if it exists.- Specified by:
getRequestEntityStreamin classServerCall- Parameters:
size- The expected entity size or -1 if unknown.- Returns:
- The request entity stream if it exists.
-
getHostDomain
Description copied from class:ServerCallReturns the host domain name.- Overrides:
getHostDomainin classServerCall- Returns:
- The host domain name.
-
getHostPort
public int getHostPort()Description copied from class:ServerCallReturns the host port.- Overrides:
getHostPortin classServerCall- Returns:
- The host port.
-
getRequestHeaders
Description copied from class:CallReturns the modifiable list of request headers.- Overrides:
getRequestHeadersin classCall- Returns:
- The modifiable list of request headers.
-
getRequestHeadStream
Description copied from class:ServerCallReturns the request head stream if it exists.- Specified by:
getRequestHeadStreamin classServerCall- Returns:
- The request head stream if it exists.
-
getRequestUri
Description copied from class:CallReturns the URI on the request line (most like a relative reference, but not necessarily).- Overrides:
getRequestUriin classCall- Returns:
- The URI on the request line.
-
getResponseEntityStream
Description copied from class:ServerCallReturns the response entity stream if it exists.- Specified by:
getResponseEntityStreamin classServerCall- Returns:
- The response entity stream if it exists.
-
getServerAddress
Description copied from class:CallReturns the response address.
Corresponds to the IP address of the responding server.- Overrides:
getServerAddressin classCall- Returns:
- The response address.
-
getSslKeySize
Description copied from class:ServerCallReturns the SSL key size, if available and accessible.- Overrides:
getSslKeySizein classServerCall- Returns:
- The SSL key size, if available and accessible.
-
getSslSessionId
Description copied from class:ServerCallReturns the SSL session ID, in hexadecimal encoding, if available and accessible.- Overrides:
getSslSessionIdin classServerCall- Returns:
- The SSL session ID, in hexadecimal encoding, if available and accessible.
-
isConfidential
public boolean isConfidential()Description copied from class:CallIndicates if the confidentiality of the call is ensured (ex: via SSL).- Overrides:
isConfidentialin classCall- Returns:
- True if the confidentiality of the call is ensured (ex: via SSL).
-
isConnectionBroken
Description copied from class:CallReturns true if the given exception is caused by a broken connection.- Overrides:
isConnectionBrokenin classCall- Parameters:
exception- The exception to inspect.- Returns:
- True if the given exception is caused by a broken connection.
-
sendResponse
Description copied from class:ServerCallSends the response back to the client. Commits the status, headers and optional entity and send them over the network. The default implementation only writes the response entity on the response stream or channel. Subclasses will probably also copy the response headers and status.- Overrides:
sendResponsein classServerCall- Parameters:
response- The high-level response.- Throws:
IOException- if the Response could not be written to the network.
-