public interface PulsarAdminBuilder
PulsarAdmin
instance.Modifier and Type | Method and Description |
---|---|
PulsarAdminBuilder |
allowTlsInsecureConnection(boolean allowTlsInsecureConnection)
Configure whether the Pulsar admin client accept untrusted TLS certificate from broker (default: false).
|
PulsarAdminBuilder |
authentication(org.apache.pulsar.client.api.Authentication authentication)
Set the authentication provider to use in the Pulsar admin instance.
|
PulsarAdminBuilder |
authentication(String authPluginClassName,
Map<String,String> authParams)
Set the authentication provider to use in the Pulsar client instance.
|
PulsarAdminBuilder |
authentication(String authPluginClassName,
String authParamsString)
Set the authentication provider to use in the Pulsar client instance.
|
PulsarAdmin |
build() |
PulsarAdminBuilder |
clone()
Create a copy of the current client builder.
|
PulsarAdminBuilder |
connectionTimeout(int connectionTimeout,
TimeUnit connectionTimeoutUnit)
This sets the connection time out for the pulsar admin client.
|
PulsarAdminBuilder |
enableTlsHostnameVerification(boolean enableTlsHostnameVerification)
It allows to validate hostname verification when client connects to broker over TLS.
|
PulsarAdminBuilder |
readTimeout(int readTimeout,
TimeUnit readTimeoutUnit)
This sets the server response read time out for the pulsar admin client for any request.
|
PulsarAdminBuilder |
requestTimeout(int requestTimeout,
TimeUnit requestTimeoutUnit)
This sets the server request time out for the pulsar admin client for any request.
|
PulsarAdminBuilder |
serviceHttpUrl(String serviceHttpUrl)
Set the Pulsar service HTTP URL for the admin endpoint (eg.
|
PulsarAdminBuilder |
setContextClassLoader(ClassLoader clientBuilderClassLoader) |
PulsarAdminBuilder |
sslProvider(String sslProvider)
The name of the security provider used for SSL connections.
|
PulsarAdminBuilder |
tlsCiphers(Set<String> tlsCiphers)
A list of cipher suites.
|
PulsarAdminBuilder |
tlsProtocols(Set<String> tlsProtocols)
The SSL protocol used to generate the SSLContext.
|
PulsarAdminBuilder |
tlsTrustCertsFilePath(String tlsTrustCertsFilePath)
Set the path to the trusted TLS certificate file.
|
PulsarAdminBuilder |
tlsTrustStorePassword(String tlsTrustStorePassword)
The store password for the key store file.
|
PulsarAdminBuilder |
tlsTrustStorePath(String tlsTrustStorePath)
The location of the trust store file.
|
PulsarAdminBuilder |
tlsTrustStoreType(String tlsTrustStoreType)
The file format of the trust store file.
|
PulsarAdminBuilder |
useKeyStoreTls(boolean useKeyStoreTls)
If Tls is enabled, whether use KeyStore type as tls configuration parameter.
|
PulsarAdmin build() throws org.apache.pulsar.client.api.PulsarClientException
PulsarAdmin
instanceorg.apache.pulsar.client.api.PulsarClientException
PulsarAdminBuilder clone()
PulsarAdminBuilder builder = PulsarAdmin.builder().allowTlsInsecureConnection(false); PulsarAdmin client1 = builder.clone().serviceHttpUrl(URL_1).build(); PulsarAdmin client2 = builder.clone().serviceHttpUrl(URL_2).build();
PulsarAdminBuilder serviceHttpUrl(String serviceHttpUrl)
PulsarAdminBuilder authentication(String authPluginClassName, String authParamsString) throws org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
String AUTH_CLASS = "org.apache.pulsar.client.impl.auth.AuthenticationTls";
String AUTH_PARAMS = "tlsCertFile:/my/cert/file,tlsKeyFile:/my/key/file";
PulsarAdmin client = PulsarAdmin.builder()
.serviceHttpUrl(SERVICE_HTTP_URL)
.authentication(AUTH_CLASS, AUTH_PARAMS)
.build();
....
authPluginClassName
- name of the Authentication-Plugin you want to useauthParamsString
- string which represents parameters for the Authentication-Plugin, e.g., "key1:val1,key2:val2"org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
- failed to instantiate specified Authentication-PluginPulsarAdminBuilder authentication(String authPluginClassName, Map<String,String> authParams) throws org.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
String AUTH_CLASS = "org.apache.pulsar.client.impl.auth.AuthenticationTls";
Map<String, String> conf = new TreeMap<>();
conf.put("tlsCertFile", "/my/cert/file");
conf.put("tlsKeyFile", "/my/key/file");
PulsarAdmin client = PulsarAdmin.builder()
.serviceHttpUrl(SERVICE_HTTP_URL)
.authentication(AUTH_CLASS, conf)
.build();
....
authPluginClassName
- name of the Authentication-Plugin you want to useauthParams
- map which represents parameters for the Authentication-Pluginorg.apache.pulsar.client.api.PulsarClientException.UnsupportedAuthenticationException
- failed to instantiate specified Authentication-PluginPulsarAdminBuilder authentication(org.apache.pulsar.client.api.Authentication authentication)
String AUTH_CLASS = "org.apache.pulsar.client.impl.auth.AuthenticationTls";
Map<String, String> conf = new TreeMap<>();
conf.put("tlsCertFile", "/my/cert/file");
conf.put("tlsKeyFile", "/my/key/file");
Authentication auth = AuthenticationFactor.create(AUTH_CLASS, conf);
PulsarAdmin admin = PulsarAdmin.builder()
.serviceHttpUrl(SERVICE_URL)
.authentication(auth)
.build();
....
authentication
- an instance of the Authentication
provider already constructedPulsarAdminBuilder tlsTrustCertsFilePath(String tlsTrustCertsFilePath)
tlsTrustCertsFilePath
- PulsarAdminBuilder allowTlsInsecureConnection(boolean allowTlsInsecureConnection)
allowTlsInsecureConnection
- PulsarAdminBuilder enableTlsHostnameVerification(boolean enableTlsHostnameVerification)
enableTlsHostnameVerification
- PulsarAdminBuilder useKeyStoreTls(boolean useKeyStoreTls)
useKeyStoreTls
- PulsarAdminBuilder sslProvider(String sslProvider)
sslProvider
- PulsarAdminBuilder tlsTrustStoreType(String tlsTrustStoreType)
tlsTrustStoreType
- PulsarAdminBuilder tlsTrustStorePath(String tlsTrustStorePath)
tlsTrustStorePath
- PulsarAdminBuilder tlsTrustStorePassword(String tlsTrustStorePassword)
tlsTrustStorePassword
- PulsarAdminBuilder tlsCiphers(Set<String> tlsCiphers)
tlsCiphers
- PulsarAdminBuilder tlsProtocols(Set<String> tlsProtocols)
tlsProtocols
- PulsarAdminBuilder connectionTimeout(int connectionTimeout, TimeUnit connectionTimeoutUnit)
connectionTimeout
- connectionTimeoutUnit
- PulsarAdminBuilder readTimeout(int readTimeout, TimeUnit readTimeoutUnit)
readTimeout
- readTimeoutUnit
- PulsarAdminBuilder requestTimeout(int requestTimeout, TimeUnit requestTimeoutUnit)
requestTimeout
- requestTimeoutUnit
- PulsarAdminBuilder setContextClassLoader(ClassLoader clientBuilderClassLoader)
Copyright © 2017–2020 Apache Software Foundation. All rights reserved.