Class ServiceURI

java.lang.Object
org.apache.pulsar.common.net.ServiceURI

public class ServiceURI extends 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 Details

    • ServiceURI

      public ServiceURI()
  • Method Details

    • create

      public static ServiceURI create(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
      IllegalArgumentException - if the given string violates RFC 2396
    • create

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

      public String[] getServiceInfos()
    • getServiceHosts

      public String[] getServiceHosts()
    • getServiceScheme

      public String getServiceScheme()
    • selectOne

      public 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