Package org.apache.pulsar.common.util
Class NettyClientSslContextRefresher
- java.lang.Object
-
- org.apache.pulsar.common.util.SslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>
-
- org.apache.pulsar.common.util.NettyClientSslContextRefresher
-
public class NettyClientSslContextRefresher extends SslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>
SSL context builder for Netty Client side.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileModifiedTimeUpdatertlsCertsFilePathprotected FileModifiedTimeUpdatertlsPrivateKeyFilePathprotected FileModifiedTimeUpdatertlsTrustCertsFilePath-
Fields inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
lastRefreshTime, refreshTime
-
-
Constructor Summary
Constructors Constructor Description NettyClientSslContextRefresher(io.netty.handler.ssl.SslProvider sslProvider, boolean allowInsecure, java.lang.String trustCertsFilePath, org.apache.pulsar.client.api.AuthenticationDataProvider authData, java.util.Set<java.lang.String> ciphers, java.util.Set<java.lang.String> protocols, long delayInSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.handler.ssl.SslContextgetSslContext()Returns cached SSLContext.booleanneedUpdate()Returns whether the key files modified after a refresh time, and context need update.io.netty.handler.ssl.SslContextupdate()updates and returns cached SSLContext.-
Methods inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
get
-
-
-
-
Field Detail
-
tlsTrustCertsFilePath
protected final FileModifiedTimeUpdater tlsTrustCertsFilePath
-
tlsCertsFilePath
protected final FileModifiedTimeUpdater tlsCertsFilePath
-
tlsPrivateKeyFilePath
protected final FileModifiedTimeUpdater tlsPrivateKeyFilePath
-
-
Constructor Detail
-
NettyClientSslContextRefresher
public NettyClientSslContextRefresher(io.netty.handler.ssl.SslProvider sslProvider, boolean allowInsecure, java.lang.String trustCertsFilePath, org.apache.pulsar.client.api.AuthenticationDataProvider authData, java.util.Set<java.lang.String> ciphers, java.util.Set<java.lang.String> protocols, long delayInSeconds)
-
-
Method Detail
-
update
public io.netty.handler.ssl.SslContext update() throws javax.net.ssl.SSLException, java.io.FileNotFoundException, java.security.GeneralSecurityException, java.io.IOExceptionDescription copied from class:SslContextAutoRefreshBuilderupdates and returns cached SSLContext.- Specified by:
updatein classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>- Returns:
- Throws:
java.security.GeneralSecurityExceptionjava.io.IOExceptionjavax.net.ssl.SSLExceptionjava.io.FileNotFoundException
-
getSslContext
public io.netty.handler.ssl.SslContext getSslContext()
Description copied from class:SslContextAutoRefreshBuilderReturns cached SSLContext.- Specified by:
getSslContextin classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>- Returns:
-
needUpdate
public boolean needUpdate()
Description copied from class:SslContextAutoRefreshBuilderReturns whether the key files modified after a refresh time, and context need update.- Specified by:
needUpdatein classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>- Returns:
- true if files modified
-
-