Package org.apache.pulsar.common.net
Class ServiceURI
java.lang.Object
org.apache.pulsar.common.net.ServiceURI
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ServiceURICreate a service uri instance from a uri string.static ServiceURICreate a service uri instance from aURIinstance.String[]String[]Create a new URI from the service URI which only specifies one of the hosts.
-
Constructor Details
-
ServiceURI
public ServiceURI()
-
-
Method Details
-
create
Create a service uri instance from a uri string.- Parameters:
uriStr- service uri string- Returns:
- a service uri instance
- Throws:
NullPointerExceptionFieldParser- ifuriStris nullIllegalArgumentException- if the given string violates RFC 2396
-
create
Create a service uri instance from aURIinstance.- Parameters:
uri-URIinstance- Returns:
- a service uri instance
- Throws:
NullPointerException- ifuriStris nullIllegalArgumentException- if the given string violates RFC 2396
-
getServiceInfos
-
getServiceHosts
-
getServiceScheme
-
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
-