Class BOSHClientConfig


  • public final class BOSHClientConfig
    extends java.lang.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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BOSHClientConfig.Builder
      Class instance builder, after the builder pattern.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean compressionEnabled
      Flag indicating that compression should be attempted, if possible.
      private java.lang.String from
      Client ID of this station.
      private java.lang.String lang
      Default XML language.
      private java.lang.String proxyHost
      Proxy host.
      private int proxyPort
      Proxy port.
      private java.lang.String route
      Routing information for messages sent to CM.
      private javax.net.ssl.SSLContext sslContext
      SSL context.
      private java.lang.String to
      Target domain.
      private java.net.URI uri
      Connection manager URI.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BOSHClientConfig​(java.net.URI cURI, java.lang.String cDomain, java.lang.String cFrom, java.lang.String cLang, java.lang.String cRoute, java.lang.String cProxyHost, int cProxyPort, javax.net.ssl.SSLContext cSSLContext, boolean cCompression)
      Prevent direct construction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFrom()
      Get the ID of the local client.
      java.lang.String getLang()
      Get the default language of any human-readable content within the XML.
      java.lang.String getProxyHost()
      Get the HTTP proxy host to use.
      int getProxyPort()
      Get the HTTP proxy port to use.
      java.lang.String getRoute()
      Get the routing information for messages sent to the CM.
      javax.net.ssl.SSLContext getSSLContext()
      Get the SSL context to use for this session.
      java.lang.String getTo()
      Get the ID of the target domain.
      java.net.URI getURI()
      Get the URI to use to contact the connection manager.
      (package private) boolean isCompressionEnabled()
      Determines whether or not compression of the underlying data stream should be attempted/allowed.
      • Methods inherited from class java.lang.Object

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

      • uri

        private final java.net.URI uri
        Connection manager URI.
      • to

        private final java.lang.String to
        Target domain.
      • from

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

        private final java.lang.String lang
        Default XML language.
      • route

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

        private final java.lang.String proxyHost
        Proxy host.
      • proxyPort

        private final int proxyPort
        Proxy port.
      • sslContext

        private final javax.net.ssl.SSLContext sslContext
        SSL context.
      • compressionEnabled

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

      • BOSHClientConfig

        private BOSHClientConfig​(java.net.URI cURI,
                                 java.lang.String cDomain,
                                 java.lang.String cFrom,
                                 java.lang.String cLang,
                                 java.lang.String cRoute,
                                 java.lang.String cProxyHost,
                                 int cProxyPort,
                                 javax.net.ssl.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 Detail

      • getURI

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

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

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

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

        public java.lang.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 java.lang.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 javax.net.ssl.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