Package org.apache.pulsar.common.net
Class ServiceURI
- java.lang.Object
-
- org.apache.pulsar.common.net.ServiceURI
-
public class ServiceURI extends java.lang.ObjectServiceURI 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 ServiceURIcreate(java.lang.String uriStr)Create a service uri instance from a uri string.static ServiceURIcreate(java.net.URI uri)Create a service uri instance from aURIinstance.java.lang.String[]getServiceHosts()java.lang.String[]getServiceInfos()java.lang.StringgetServiceScheme()java.lang.StringselectOne()Create a new URI from the service URI which only specifies one of the hosts.
-
-
-
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- ifuriStris nulljava.lang.IllegalArgumentException- if the given string violates RFC 2396
-
create
public static ServiceURI create(java.net.URI uri)
Create a service uri instance from aURIinstance.- Parameters:
uri-URIinstance- Returns:
- a service uri instance
- Throws:
java.lang.NullPointerException- ifuriStris nulljava.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
-
-