Package org.restlet.ext.jetty.internal
Class JettyServerCall
- java.lang.Object
-
- org.restlet.engine.adapter.Call
-
- org.restlet.engine.adapter.ServerCall
-
- org.restlet.ext.jetty.internal.JettyServerCall
-
public class JettyServerCall extends ServerCall
Call that is used by the Jetty HTTP server connectors.
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.jetty.server.HttpChannelchannelThe wrapped Jetty HTTP channel.private booleanrequestHeadersAddedIndicates if the request headers were parsed and added.
-
Constructor Summary
Constructors Constructor Description JettyServerCall(Server server, org.eclipse.jetty.server.HttpChannel channel)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort()Closes the end point.voidcomplete()Complete the responsevoidflushBuffers()Flushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.java.util.List<java.security.cert.Certificate>getCertificates()Returns the chain of client SSL certificates, if available and accessible.org.eclipse.jetty.server.HttpChannelgetChannel()Returns the wrapped Jetty HTTP channel.java.lang.StringgetCipherSuite()Returns the SSL Cipher Suite, if available and accessible.java.lang.StringgetClientAddress()Returns the client address.
Corresponds to the IP address of the requesting client.intgetClientPort()Returns the client port.
Corresponds to the TCP/IP port of the requesting client.java.lang.StringgetMethod()Returns the request method.java.io.InputStreamgetRequestEntityStream(long size)Returns the request entity stream if it exists.Series<Header>getRequestHeaders()Returns the list of request headers.java.io.InputStreamgetRequestHeadStream()Returns the request head stream if it exists.java.lang.StringgetRequestUri()Returns the URI on the request line (most like a relative reference, but not necessarily).java.io.OutputStreamgetResponseEntityStream()Returns the response stream if it exists.java.lang.StringgetServerAddress()Returns the response address.
Corresponds to the IP address of the responding server.java.lang.IntegergetSslKeySize()Returns the SSL key size, if available and accessible.java.lang.StringgetSslSessionId()Returns the SSL session ID, in hexadecimal encoding, if available and accessible.booleanisConfidential()Indicates if the request was made using a confidential mean.booleanisConnectionBroken(java.lang.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, getHostDomain, getHostPort, getRequestEntity, getSslSessionIdBytes, isClientKeepAlive, isServerKeepAlive, readRequestHead, shouldResponseBeChunked, writeResponseBody, writeResponseHead, writeResponseHead
-
Methods inherited from class org.restlet.engine.adapter.Call
getLogger, getProtocol, getReasonPhrase, getRepresentation, 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 Detail
-
JettyServerCall
public JettyServerCall(Server server, org.eclipse.jetty.server.HttpChannel channel)
Constructor.- Parameters:
server- The parent server.channel- The wrapped Jetty HTTP channel.
-
-
Method Detail
-
abort
public boolean abort()
Closes the end point.- 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
public void flushBuffers() throws java.io.IOExceptionDescription 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:
java.io.IOException
-
getCertificates
public java.util.List<java.security.cert.Certificate> 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.
-
getChannel
public org.eclipse.jetty.server.HttpChannel getChannel()
Returns the wrapped Jetty HTTP channel.- Returns:
- The wrapped Jetty HTTP channel.
-
getCipherSuite
public java.lang.String 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
public java.lang.String 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.
-
getMethod
public java.lang.String getMethod()
Returns the request method.
-
getRequestEntityStream
public java.io.InputStream getRequestEntityStream(long size)
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.
-
getRequestHeaders
public Series<Header> getRequestHeaders()
Returns the list of request headers.- Overrides:
getRequestHeadersin classCall- Returns:
- The list of request headers.
-
getRequestHeadStream
public java.io.InputStream 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
public java.lang.String getRequestUri()
Returns 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
public java.io.OutputStream getResponseEntityStream()
Returns the response stream if it exists.- Specified by:
getResponseEntityStreamin classServerCall- Returns:
- The response stream if it exists.
-
getServerAddress
public java.lang.String getServerAddress()
Returns the response address.
Corresponds to the IP address of the responding server.- Overrides:
getServerAddressin classCall- Returns:
- The response address.
-
getSslKeySize
public java.lang.Integer 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
public java.lang.String 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()
Indicates if the request was made using a confidential mean.- Overrides:
isConfidentialin classCall- Returns:
- True if the request was made using a confidential mean.
-
isConnectionBroken
public boolean isConnectionBroken(java.lang.Throwable exception)
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
public void sendResponse(Response response) throws java.io.IOException
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:
java.io.IOException- if the Response could not be written to the network.
-
-