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 FileModifiedTimeUpdater
tlsTrustCertsFilePath
-
Fields inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
lastRefreshTime, refreshTime
-
-
Constructor Summary
Constructors Constructor Description NettyClientSslContextRefresher(boolean allowInsecure, java.lang.String trustCertsFilePath, org.apache.pulsar.client.api.AuthenticationDataProvider authData, long delayInSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.handler.ssl.SslContext
getSslContext()
Returns cached SSLContext.boolean
needUpdate()
Returns whether the key files modified after a refresh time, and context need update.io.netty.handler.ssl.SslContext
update()
updates and returns cached SSLContext.-
Methods inherited from class org.apache.pulsar.common.util.SslContextAutoRefreshBuilder
get
-
-
-
-
Field Detail
-
tlsTrustCertsFilePath
protected final FileModifiedTimeUpdater tlsTrustCertsFilePath
-
-
Constructor Detail
-
NettyClientSslContextRefresher
public NettyClientSslContextRefresher(boolean allowInsecure, java.lang.String trustCertsFilePath, org.apache.pulsar.client.api.AuthenticationDataProvider authData, long delayInSeconds) throws java.io.IOException, java.security.GeneralSecurityException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
-
-
Method Detail
-
update
public io.netty.handler.ssl.SslContext update() throws javax.net.ssl.SSLException, java.io.FileNotFoundException, java.security.GeneralSecurityException, java.io.IOException
Description copied from class:SslContextAutoRefreshBuilder
updates and returns cached SSLContext.- Specified by:
update
in classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>
- Returns:
- Throws:
java.security.GeneralSecurityException
java.io.IOException
javax.net.ssl.SSLException
java.io.FileNotFoundException
-
getSslContext
public io.netty.handler.ssl.SslContext getSslContext()
Description copied from class:SslContextAutoRefreshBuilder
Returns cached SSLContext.- Specified by:
getSslContext
in classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>
- Returns:
-
needUpdate
public boolean needUpdate()
Description copied from class:SslContextAutoRefreshBuilder
Returns whether the key files modified after a refresh time, and context need update.- Specified by:
needUpdate
in classSslContextAutoRefreshBuilder<io.netty.handler.ssl.SslContext>
- Returns:
- true if files modified
-
-