Interface NHttpRequestExecutionHandler


@Deprecated public interface NHttpRequestExecutionHandler
Deprecated.
HTTP request execution handler can be used by client-side protocol handlers to trigger the submission of a new HTTP request and the processing of an HTTP response. When a new response entity is available for consumption, responseEntity(HttpResponse, HttpContext) is called. After the ConsumingNHttpEntity consumes the response body, handleResponse(HttpResponse, HttpContext) is notified that the response is fully read.
Since:
4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    finalizeContext(org.apache.http.protocol.HttpContext context)
    Deprecated.
    Triggered when the connection is terminated.
    void
    handleResponse(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)
    Deprecated.
    Triggered when an HTTP response is ready to be processed.
    void
    initalizeContext(org.apache.http.protocol.HttpContext context, Object attachment)
    Deprecated.
    Triggered when a new connection has been established and the HTTP context needs to be initialized.
    responseEntity(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)
    Deprecated.
    Triggered when a response is received with an entity.
    org.apache.http.HttpRequest
    submitRequest(org.apache.http.protocol.HttpContext context)
    Deprecated.
    Triggered when the underlying connection is ready to send a new HTTP request to the target host.
  • Method Details

    • initalizeContext

      void initalizeContext(org.apache.http.protocol.HttpContext context, Object attachment)
      Deprecated.
      Triggered when a new connection has been established and the HTTP context needs to be initialized.

      The attachment object is the same object which was passed to the connecting I/O reactor when the connection request was made. The attachment may optionally contain some state information required in order to correctly initalize the HTTP context.

      Parameters:
      context - the actual HTTP context
      attachment - the object passed to the connecting I/O reactor upon the request for a new connection.
      See Also:
    • submitRequest

      org.apache.http.HttpRequest submitRequest(org.apache.http.protocol.HttpContext context)
      Deprecated.
      Triggered when the underlying connection is ready to send a new HTTP request to the target host. This method may return null if the client is not yet ready to send a request. In this case the connection will remain open and can be activated at a later point.

      If the request has an entity, the entity must be an instance of ProducingNHttpEntity.

      Parameters:
      context - the actual HTTP context
      Returns:
      an HTTP request to be sent or null if no request needs to be sent
    • responseEntity

      ConsumingNHttpEntity responseEntity(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws IOException
      Deprecated.
      Triggered when a response is received with an entity. This method should return a ConsumingNHttpEntity that will be used to consume the entity. null is a valid response value, and will indicate that the entity should be silently ignored.

      After the entity is fully consumed, handleResponse(HttpResponse, HttpContext) is called to notify a full response & entity are ready to be processed.

      Parameters:
      response - The response containing the existing entity.
      context - the actual HTTP context
      Returns:
      An entity that will asynchronously consume the response's content body.
      Throws:
      IOException
    • handleResponse

      void handleResponse(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws IOException
      Deprecated.
      Triggered when an HTTP response is ready to be processed.
      Parameters:
      response - the HTTP response to be processed
      context - the actual HTTP context
      Throws:
      IOException
    • finalizeContext

      void finalizeContext(org.apache.http.protocol.HttpContext context)
      Deprecated.
      Triggered when the connection is terminated. This event can be used to release objects stored in the context or perform some other kind of cleanup.
      Parameters:
      context - the actual HTTP context