Package org.apache.pulsar.common.util
Class SslContextAutoRefreshBuilder<T>
java.lang.Object
org.apache.pulsar.common.util.SslContextAutoRefreshBuilder<T>
- Type Parameters:
T- type of SSLContext
- Direct Known Subclasses:
DefaultSslContextBuilder,NetSslContextBuilder,NettyClientSslContextRefresher,NettyServerSslContextBuilder,NettySSLContextAutoRefreshBuilder
Auto refresher and builder of SSLContext.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()It updates SSLContext at every configured refresh time and returns updated SSLContext.protected abstract TReturns cached SSLContext.protected abstract booleanReturns whether the key files modified after a refresh time, and context need update.protected abstract Tupdate()updates and returns cached SSLContext.
-
Field Details
-
refreshTime
protected final long refreshTime -
lastRefreshTime
protected long lastRefreshTime
-
-
Constructor Details
-
SslContextAutoRefreshBuilder
public SslContextAutoRefreshBuilder(long certRefreshInSec)
-
-
Method Details
-
update
updates and returns cached SSLContext.- Returns:
- Throws:
GeneralSecurityExceptionIOException
-
getSslContext
Returns cached SSLContext.- Returns:
-
needUpdate
protected abstract boolean needUpdate()Returns whether the key files modified after a refresh time, and context need update.- Returns:
- true if files modified
-
get
It updates SSLContext at every configured refresh time and returns updated SSLContext.- Returns:
-