Class ServiceURI


  • public class ServiceURI
    extends java.lang.Object
    ServiceURI represents service uri within pulsar cluster.

    This file is based on {@link https://github.com/apache/bookkeeper/blob/master/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/net/ServiceURI.java}

    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceURI()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ServiceURI create​(java.lang.String uriStr)
      Create a service uri instance from a uri string.
      static ServiceURI create​(java.net.URI uri)
      Create a service uri instance from a URI instance.
      java.lang.String[] getServiceHosts()  
      java.lang.String[] getServiceInfos()  
      java.lang.String getServiceScheme()  
      java.lang.String selectOne()
      Create a new URI from the service URI which only specifies one of the hosts.
      • Methods inherited from class java.lang.Object

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

      • ServiceURI

        public ServiceURI()
    • Method Detail

      • create

        public static ServiceURI create​(java.lang.String uriStr)
        Create a service uri instance from a uri string.
        Parameters:
        uriStr - service uri string
        Returns:
        a service uri instance
        Throws:
        NullPointerExceptionFieldParser - if uriStr is null
        java.lang.IllegalArgumentException - if the given string violates RFC 2396
      • create

        public static ServiceURI create​(java.net.URI uri)
        Create a service uri instance from a URI instance.
        Parameters:
        uri - URI instance
        Returns:
        a service uri instance
        Throws:
        java.lang.NullPointerException - if uriStr is null
        java.lang.IllegalArgumentException - if the given string violates RFC 2396
      • getServiceInfos

        public java.lang.String[] getServiceInfos()
      • getServiceHosts

        public java.lang.String[] getServiceHosts()
      • getServiceScheme

        public java.lang.String getServiceScheme()
      • selectOne

        public java.lang.String selectOne()
        Create a new URI from the service URI which only specifies one of the hosts.
        Returns:
        a pulsar service URI with a single host specified