Class BrokerURL

  • Direct Known Subclasses:
    BrokerMonitorURL

    public class BrokerURL
    extends java.lang.Object
    This class represents the network location of a Broker Server.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BrokerURL()
      Creates a Broker URL.
        BrokerURL​(java.lang.String url)
      Creates a Broker URL.
        BrokerURL​(java.lang.String brokerName, java.lang.String brokerHost)
      Creates a Broker URL.
        BrokerURL​(java.lang.String brokerName, java.lang.String brokerHost, boolean isSSL, boolean hasSSLDN)
      Creates a Broker URL.
        BrokerURL​(java.lang.String brokerName, java.lang.String host, java.lang.String port)
      Creates a Broker URL.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBroker()
      Returns the Broker URL Broker name.
      java.lang.String getBrokerHost()
      Returns the Broker URL [][:]
      static java.lang.String getFullyQualifiedHostDN​(java.lang.String host)
      Get the Fully qualifies Domain Name for the host.
      java.lang.String getHost()
      Returns the Broker URL host.
      int getPort()
      Returns the Broker URL port.
      int getSSLPort()
      Returns the Broker URL ssl port.
      java.lang.String getURL()
      Returns the fully qualified Broker URL.
      static boolean isLocalHost​(java.lang.String host)
      Utility method to find given hostname is valid local or loop back or address (IPV4 and IPV6) is defined on any interface.
      protected void parse​(java.lang.String url)
      Separate Broker name, host and port general form is [broker@][][:], hostport sub-string could be of the form host:port or [host]:port Also sets the ssl port
      java.lang.String toString()
      Returns a string representation of this object.
      • Methods inherited from class java.lang.Object

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

      • HOSTPORT_SEPARATOR

        protected static final java.lang.String HOSTPORT_SEPARATOR
        See Also:
        Constant Field Values
      • IPv6_OPEN_BRACKET

        protected static final java.lang.String IPv6_OPEN_BRACKET
        See Also:
        Constant Field Values
      • IPv6_CLOSE_BRACKET

        protected static final java.lang.String IPv6_CLOSE_BRACKET
        See Also:
        Constant Field Values
      • DEFAULT_HOST

        public static final java.lang.String DEFAULT_HOST
        The Broker Server's default host.
        See Also:
        Constant Field Values
      • DEFAULT_TCP_PORT

        public static final int DEFAULT_TCP_PORT
        The Broker Server's default port.
        See Also:
        Constant Field Values
      • _broker

        protected java.lang.String _broker
      • _host

        protected java.lang.String _host
      • _port

        protected int _port
      • _isIPv6Format

        protected boolean _isIPv6Format
    • Constructor Detail

      • BrokerURL

        protected BrokerURL()
        Creates a Broker URL. Uses "localhost" as TCP HOST and 6849 as default TCP port
      • BrokerURL

        public BrokerURL​(java.lang.String url)
                  throws BrokerInvalidPortException
        Creates a Broker URL. Uses "localhost" as default TCP HOST and 6849 as default TCP port
        Parameters:
        url - Broker location with syntax [broker@][][:]
        Throws:
        BrokerInvalidPortException - for invalid port numbers
      • BrokerURL

        public BrokerURL​(java.lang.String brokerName,
                         java.lang.String host,
                         java.lang.String port)
                  throws BrokerInvalidPortException
        Creates a Broker URL.
        Parameters:
        brokerName - the Broker name
        host - the Broker host
        port - the Broker port
        Throws:
        BrokerInvalidPortException - for invalid port numbers
      • BrokerURL

        public BrokerURL​(java.lang.String brokerName,
                         java.lang.String brokerHost)
                  throws BrokerInvalidPortException
        Creates a Broker URL.
        Parameters:
        brokerName - the Broker name
        brokerHost - the Broker host:port
        Throws:
        BrokerInvalidPortException - for invalid port numbers
      • BrokerURL

        public BrokerURL​(java.lang.String brokerName,
                         java.lang.String brokerHost,
                         boolean isSSL,
                         boolean hasSSLDN)
                  throws BrokerInvalidPortException
        Creates a Broker URL.
        Parameters:
        brokerName - the Broker name
        brokerHost - the Broker host:port
        Throws:
        BrokerInvalidPortException - for invalid port numbers
    • Method Detail

      • getURL

        public java.lang.String getURL()
        Returns the fully qualified Broker URL.
        Returns:
        the fully qualified Broker URL
      • getBroker

        public java.lang.String getBroker()
        Returns the Broker URL Broker name.
        Returns:
        the Broker URL Broker name
      • getHost

        public java.lang.String getHost()
        Returns the Broker URL host.
        Returns:
        the Broker URL host
      • getBrokerHost

        public java.lang.String getBrokerHost()
        Returns the Broker URL [][:]
        Returns:
        the Broker URL [][:]
      • getPort

        public int getPort()
        Returns the Broker URL port.
        Returns:
        the Broker URL port
      • getSSLPort

        public int getSSLPort()
        Returns the Broker URL ssl port.
        Returns:
        the Broker URL ssl port
      • parse

        protected void parse​(java.lang.String url)
                      throws BrokerInvalidPortException
        Separate Broker name, host and port general form is [broker@][][:], hostport sub-string could be of the form host:port or [host]:port Also sets the ssl port
        Parameters:
        url - Broker location with syntax [broker@][][:]
        Throws:
        BrokerInvalidPortException - for invalid port numbers
      • toString

        public java.lang.String toString()
        Returns a string representation of this object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this object
      • isLocalHost

        public static boolean isLocalHost​(java.lang.String host)
        Utility method to find given hostname is valid local or loop back or address (IPV4 and IPV6) is defined on any interface.
        Parameters:
        host -
        Returns:
        boolean
      • getFullyQualifiedHostDN

        public static java.lang.String getFullyQualifiedHostDN​(java.lang.String host)
        Get the Fully qualifies Domain Name for the host.
        Returns:
        The FQDN for the host if one exists, otherwise host itself.