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 Object
Auto refresher and builder of SSLContext.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
     
    protected final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SslContextAutoRefreshBuilder(long certRefreshInSec)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    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
    updates and returns cached SSLContext.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • refreshTime

      protected final long refreshTime
    • lastRefreshTime

      protected long lastRefreshTime
  • Constructor Details

    • SslContextAutoRefreshBuilder

      public SslContextAutoRefreshBuilder(long certRefreshInSec)
  • Method Details

    • update

      protected abstract T update() throws GeneralSecurityException, IOException
      updates and returns cached SSLContext.
      Returns:
      Throws:
      GeneralSecurityException
      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: