Class HttpExchangeCall


  • public class HttpExchangeCall
    extends ServerCall
    Call that is used by the Basic HTTP server.
    Author:
    Jerome Louvel
    • Constructor Detail

      • HttpExchangeCall

        public HttpExchangeCall​(org.restlet.Server server,
                                com.sun.net.httpserver.HttpExchange exchange)
        Constructor.
        Parameters:
        server - The parent server.
        exchange - The wrapped HttpExchange instance.
      • HttpExchangeCall

        public HttpExchangeCall​(org.restlet.Server server,
                                com.sun.net.httpserver.HttpExchange exchange,
                                boolean confidential)
        Constructor.
        Parameters:
        server - The parent server.
        exchange - The wrapped HttpExchange instance.
        confidential - True if the confidentiality of the call is ensured (ex: via SSL)
    • Method Detail

      • 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.
      • 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
      • 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()
        Description copied from class: Call
        Returns the request method.
        Overrides:
        getMethod in class Call
        Returns:
        The request method.
      • getRequestHeaders

        public org.restlet.util.Series<org.restlet.data.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.
      • 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.
      • 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()
        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 java.io.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.
      • writeResponseHead

        public void writeResponseHead​(org.restlet.Response restletResponse)
                               throws java.io.IOException
        Description copied from class: ServerCall
        Writes the response status line and headers. Does nothing by default.
        Overrides:
        writeResponseHead in class ServerCall
        Parameters:
        restletResponse - The response.
        Throws:
        java.io.IOException