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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget()
It updates SSLContext at every configured refresh time and returns updated SSLContext.protected abstract T
Returns cached SSLContext.protected abstract boolean
Returns whether the key files modified after a refresh time, and context need update.protected abstract T
update()
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:
GeneralSecurityException
IOException
-
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:
-