Class JettyServerCall


public class JettyServerCall extends ServerCall
Call that is used by the Jetty HTTP server connectors.
Author:
Jerome Louvel, Tal Liron
  • 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: ServerCall
      Ask the connector to abort the related network connection, for example immediately closing the socket.
      Specified by:
      abort in class ServerCall
      Returns:
      True if the connection was aborted.
    • complete

      public void complete()
      Description copied from class: ServerCall
      Complete the response
      Overrides:
      complete in class ServerCall
    • flushBuffers

      public void flushBuffers() throws IOException
      Description copied from class: ServerCall
      Flushes the buffers onto the network so that for example you can force headers to be written before the entity is becoming available.
      Overrides:
      flushBuffers in class ServerCall
      Throws:
      IOException
    • getCallback

      public org.eclipse.jetty.util.Callback getCallback()
      Returns the wrapped Jetty HTTP callback.
      Returns:
      The wrapped Jetty HTTP callback.
    • getCertificates

      public List<Certificate> getCertificates()
      Description copied from class: ServerCall
      Returns the chain of client SSL certificates, if available and accessible.
      Overrides:
      getCertificates in class ServerCall
      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

      public String getCipherSuite()
      Description copied from class: ServerCall
      Returns the SSL Cipher Suite, if available and accessible.
      Overrides:
      getCipherSuite in class ServerCall
      Returns:
      The SSL Cipher Suite, if available and accessible.
    • getClientAddress

      public String getClientAddress()
      Description copied from class: Call
      Returns the client address.
      Corresponds to the IP address of the requesting client.
      Overrides:
      getClientAddress in class Call
      Returns:
      The client address.
    • getClientPort

      public int getClientPort()
      Description copied from class: Call
      Returns the client port.
      Corresponds to the TCP/IP port of the requesting client.
      Overrides:
      getClientPort in class Call
      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

      public String getMethod()
      Description copied from class: Call
      Returns the request method.
      Overrides:
      getMethod in class Call
      Returns:
      The request method.
    • getRequestEntityStream

      public InputStream getRequestEntityStream(long size)
      Description copied from class: ServerCall
      Returns the request entity stream if it exists.
      Specified by:
      getRequestEntityStream in class ServerCall
      Parameters:
      size - The expected entity size or -1 if unknown.
      Returns:
      The request entity stream if it exists.
    • getHostDomain

      public String getHostDomain()
      Description copied from class: ServerCall
      Returns the host domain name.
      Overrides:
      getHostDomain in class ServerCall
      Returns:
      The host domain name.
    • getHostPort

      public int getHostPort()
      Description copied from class: ServerCall
      Returns the host port.
      Overrides:
      getHostPort in class ServerCall
      Returns:
      The host port.
    • getRequestHeaders

      public Series<Header> getRequestHeaders()
      Description copied from class: Call
      Returns the modifiable list of request headers.
      Overrides:
      getRequestHeaders in class Call
      Returns:
      The modifiable list of request headers.
    • getRequestHeadStream

      public InputStream getRequestHeadStream()
      Description copied from class: ServerCall
      Returns the request head stream if it exists.
      Specified by:
      getRequestHeadStream in class ServerCall
      Returns:
      The request head stream if it exists.
    • getRequestUri

      public String getRequestUri()
      Description copied from class: Call
      Returns the URI on the request line (most like a relative reference, but not necessarily).
      Overrides:
      getRequestUri in class Call
      Returns:
      The URI on the request line.
    • getResponseEntityStream

      public OutputStream getResponseEntityStream()
      Description copied from class: ServerCall
      Returns the response entity stream if it exists.
      Specified by:
      getResponseEntityStream in class ServerCall
      Returns:
      The response entity stream if it exists.
    • getServerAddress

      public String getServerAddress()
      Description copied from class: Call
      Returns the response address.
      Corresponds to the IP address of the responding server.
      Overrides:
      getServerAddress in class Call
      Returns:
      The response address.
    • getSslKeySize

      public Integer getSslKeySize()
      Description copied from class: ServerCall
      Returns the SSL key size, if available and accessible.
      Overrides:
      getSslKeySize in class ServerCall
      Returns:
      The SSL key size, if available and accessible.
    • getSslSessionId

      public String getSslSessionId()
      Description copied from class: ServerCall
      Returns the SSL session ID, in hexadecimal encoding, if available and accessible.
      Overrides:
      getSslSessionId in class ServerCall
      Returns:
      The SSL session ID, in hexadecimal encoding, if available and accessible.
    • isConfidential

      public boolean isConfidential()
      Description copied from class: Call
      Indicates if the confidentiality of the call is ensured (ex: via SSL).
      Overrides:
      isConfidential in class Call
      Returns:
      True if the confidentiality of the call is ensured (ex: via SSL).
    • isConnectionBroken

      public boolean isConnectionBroken(Throwable exception)
      Description copied from class: Call
      Returns true if the given exception is caused by a broken connection.
      Overrides:
      isConnectionBroken in class Call
      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 IOException
      Description copied from class: ServerCall
      Sends 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:
      sendResponse in class ServerCall
      Parameters:
      response - The high-level response.
      Throws:
      IOException - if the Response could not be written to the network.