Class BOSHClientConfig

java.lang.Object
org.igniterealtime.jbosh.BOSHClientConfig

public final class BOSHClientConfig extends Object
BOSH client configuration information. Instances of this class contain all information necessary to establish connectivity with a remote connection manager.

Instances of this class are immutable, thread-safe, and can be re-used to configure multiple client session instances.

  • Field Details

    • uri

      private final URI uri
      Connection manager URI.
    • to

      private final String to
      Target domain.
    • from

      private final String from
      Client ID of this station.
    • lang

      private final String lang
      Default XML language.
    • route

      private final String route
      Routing information for messages sent to CM.
    • proxyHost

      private final String proxyHost
      Proxy host.
    • proxyPort

      private final int proxyPort
      Proxy port.
    • sslContext

      private final SSLContext sslContext
      SSL context.
    • compressionEnabled

      private final boolean compressionEnabled
      Flag indicating that compression should be attempted, if possible.
  • Constructor Details

    • BOSHClientConfig

      private BOSHClientConfig(URI cURI, String cDomain, String cFrom, String cLang, String cRoute, String cProxyHost, int cProxyPort, SSLContext cSSLContext, boolean cCompression)
      Prevent direct construction.
      Parameters:
      cURI - URI of the connection manager to connect to
      cDomain - the target domain of the first stream
      cFrom - client ID
      cLang - default XML language
      cRoute - target route
      cProxyHost - proxy host
      cProxyPort - proxy port
      cSSLContext - SSL context
      cCompression - compression enabled flag
  • Method Details

    • getURI

      public URI getURI()
      Get the URI to use to contact the connection manager.
      Returns:
      connection manager URI.
    • getTo

      public String getTo()
      Get the ID of the target domain.
      Returns:
      domain id
    • getFrom

      public String getFrom()
      Get the ID of the local client.
      Returns:
      client id, or null
    • getLang

      public String getLang()
      Get the default language of any human-readable content within the XML. Defaults to "en".
      Returns:
      XML language ID
    • getRoute

      public String getRoute()
      Get the routing information for messages sent to the CM.
      Returns:
      route attribute string, or null if no routing info was provided.
    • getProxyHost

      public String getProxyHost()
      Get the HTTP proxy host to use.
      Returns:
      proxy host, or null if no proxy information was specified
    • getProxyPort

      public int getProxyPort()
      Get the HTTP proxy port to use.
      Returns:
      proxy port, or 0 if no proxy information was specified
    • getSSLContext

      public SSLContext getSSLContext()
      Get the SSL context to use for this session.
      Returns:
      SSL context instance to use, or null if no context instance was provided.
    • isCompressionEnabled

      boolean isCompressionEnabled()
      Determines whether or not compression of the underlying data stream should be attempted/allowed. Defaults to false.
      Returns:
      true if compression should be attempted, false if compression is disabled or was not specified