Package org.apache.pulsar.broker
Class ServiceConfigurationUtils
- java.lang.Object
-
- org.apache.pulsar.broker.ServiceConfigurationUtils
-
public class ServiceConfigurationUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ServiceConfigurationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.StringbrokerUrl(java.lang.String host, int port)static java.lang.StringbrokerUrlTls(java.lang.String host, int port)static java.lang.StringgetAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener)Deprecated.static java.lang.StringgetDefaultOrConfiguredAddress(java.lang.String configuredAddress)static org.apache.pulsar.policies.data.loadbalancer.AdvertisedListenergetInternalListener(ServiceConfiguration config, java.lang.String protocol)Gets the internal advertised listener for broker-to-broker communication.static java.lang.StringgetWebServiceAddress(ServiceConfiguration config)Gets the web service address (hostname).static java.lang.StringunsafeLocalhostResolve()static java.lang.StringwebServiceUrl(java.lang.String host, int port)static java.lang.StringwebServiceUrlTls(java.lang.String host, int port)
-
-
-
Method Detail
-
getDefaultOrConfiguredAddress
public static java.lang.String getDefaultOrConfiguredAddress(java.lang.String configuredAddress)
-
unsafeLocalhostResolve
public static java.lang.String unsafeLocalhostResolve()
-
getAppliedAdvertisedAddress
@Deprecated public static java.lang.String getAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener)
Deprecated.Get the address of Broker, first try to get it from AdvertisedAddress. If it is not set, try to get the address set by advertisedListener. If it is still not set, get it through InetAddress.getLocalHost().- Parameters:
configuration-ignoreAdvertisedListener- Sometimes we can’t use the default key of AdvertisedListener, setting it to true can ignore AdvertisedListener.- Returns:
-
getInternalListener
public static org.apache.pulsar.policies.data.loadbalancer.AdvertisedListener getInternalListener(ServiceConfiguration config, java.lang.String protocol)
Gets the internal advertised listener for broker-to-broker communication.- Returns:
- a non-null advertised listener
-
getWebServiceAddress
public static java.lang.String getWebServiceAddress(ServiceConfiguration config)
Gets the web service address (hostname).
-
brokerUrl
public static java.lang.String brokerUrl(java.lang.String host, int port)
-
brokerUrlTls
public static java.lang.String brokerUrlTls(java.lang.String host, int port)
-
webServiceUrl
public static java.lang.String webServiceUrl(java.lang.String host, int port)
-
webServiceUrlTls
public static java.lang.String webServiceUrlTls(java.lang.String host, int port)
-
-