Class ApacheHTTPResponse

java.lang.Object
org.igniterealtime.jbosh.ApacheHTTPResponse
All Implemented Interfaces:
HTTPResponse

final class ApacheHTTPResponse extends Object implements HTTPResponse
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Name of the accept encoding header.
    private static final String
    Value to use for the ACCEPT_ENCODING header.
    private AbstractBody
    The response body which was received from the server or null if that has not yet happened.
    private static final String
    Name of the character set to encode the body to/from.
    private final org.apache.http.client.HttpClient
    HttpClient instance to use to communicate.
    private static final String
    Content type to use when transmitting the body data.
    private final org.apache.http.protocol.HttpContext
    The execution state of an HTTP process.
    private final Lock
    Lock used for internal synchronization.
    private final org.apache.http.client.methods.HttpPost
    The HTTP POST request is sent to the server.
    private boolean
    A flag which indicates if the transmission was already done.
    private int
    The HTTP response status code.
    Exception to throw when the response data is attempted to be accessed, or null if no exception should be thrown.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApacheHTTPResponse(org.apache.http.client.HttpClient client, BOSHClientConfig cfg, CMSessionParams params, AbstractBody request)
    Create and send a new request to the upstream connection manager, providing deferred access to the results to be returned.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abort the client transmission and response processing.
    private void
    Await the response, storing the result in the instance variables of this class when they arrive.
    Wait for and then return the response body.
    int
    Wait for and then return the response HTTP status code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ACCEPT_ENCODING

      private static final String ACCEPT_ENCODING
      Name of the accept encoding header.
      See Also:
    • ACCEPT_ENCODING_VAL

      private static final String ACCEPT_ENCODING_VAL
      Value to use for the ACCEPT_ENCODING header.
    • CHARSET

      private static final String CHARSET
      Name of the character set to encode the body to/from.
      See Also:
    • CONTENT_TYPE

      private static final String CONTENT_TYPE
      Content type to use when transmitting the body data.
      See Also:
    • lock

      private final Lock lock
      Lock used for internal synchronization.
    • context

      private final org.apache.http.protocol.HttpContext context
      The execution state of an HTTP process.
    • client

      private final org.apache.http.client.HttpClient client
      HttpClient instance to use to communicate.
    • post

      private final org.apache.http.client.methods.HttpPost post
      The HTTP POST request is sent to the server.
    • sent

      private boolean sent
      A flag which indicates if the transmission was already done.
    • toThrow

      private BOSHException toThrow
      Exception to throw when the response data is attempted to be accessed, or null if no exception should be thrown.
    • body

      private AbstractBody body
      The response body which was received from the server or null if that has not yet happened.
    • statusCode

      private int statusCode
      The HTTP response status code.
  • Constructor Details

    • ApacheHTTPResponse

      ApacheHTTPResponse(org.apache.http.client.HttpClient client, BOSHClientConfig cfg, CMSessionParams params, AbstractBody request)
      Create and send a new request to the upstream connection manager, providing deferred access to the results to be returned.
      Parameters:
      client - client instance to use when sending the request
      cfg - client configuration
      params - connection manager parameters from the session creation response, or null if the session has not yet been established
      request - body of the client request
  • Method Details