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
public abstract class SslContextAutoRefreshBuilder<T> extends java.lang.ObjectAuto refresher and builder of SSLContext.
-
-
Field Summary
Fields Modifier and Type Field Description protected longlastRefreshTimeprotected longrefreshTime
-
Constructor Summary
Constructors Constructor Description SslContextAutoRefreshBuilder(long certRefreshInSec)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tget()It updates SSLContext at every configured refresh time and returns updated SSLContext.protected abstract TgetSslContext()Returns cached SSLContext.protected abstract booleanneedUpdate()Returns whether the key files modified after a refresh time, and context need update.protected abstract Tupdate()updates and returns cached SSLContext.
-
-
-
Method Detail
-
update
protected abstract T update() throws java.security.GeneralSecurityException, java.io.IOException
updates and returns cached SSLContext.- Returns:
- Throws:
java.security.GeneralSecurityExceptionjava.io.IOException
-
getSslContext
protected abstract T 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
public T get()
It updates SSLContext at every configured refresh time and returns updated SSLContext.- Returns:
-
-