Class JettyServerCall


  • public class JettyServerCall
    extends ServerCall
    Call that is used by the Jetty HTTP server connectors.
    • Field Detail

      • channel

        private final org.eclipse.jetty.server.HttpChannel channel
        The wrapped Jetty HTTP channel.
      • requestHeadersAdded

        private volatile boolean requestHeadersAdded
        Indicates if the request headers were parsed and added.
    • 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:
        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 java.io.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:
        java.io.IOException
      • getCertificates

        public java.util.List<java.security.cert.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.
      • 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: 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 java.lang.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.
      • getMethod

        public java.lang.String getMethod()
        Returns the request method.
        Overrides:
        getMethod in class Call
        Returns:
        The request method.
      • getRequestEntityStream

        public java.io.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.
      • getRequestHeaders

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

        public java.io.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 java.lang.String getRequestUri()
        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 java.io.OutputStream getResponseEntityStream()
        Returns the response stream if it exists.
        Specified by:
        getResponseEntityStream in class ServerCall
        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:
        getServerAddress in class Call
        Returns:
        The response address.
      • getSslKeySize

        public java.lang.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 java.lang.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()
        Indicates if the request was made using a confidential mean.
        Overrides:
        isConfidential in class Call
        Returns:
        True if the request was made using a confidential mean.
      • isConnectionBroken

        public boolean isConnectionBroken​(java.lang.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 java.io.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:
        java.io.IOException - if the Response could not be written to the network.