Class ZooKeeperClientConfig

java.lang.Object
org.apache.nifi.framework.cluster.zookeeper.ZooKeeperClientConfig

public class ZooKeeperClientConfig extends Object
  • Field Details

    • NETTY_CLIENT_CNXN_SOCKET

      public static final String NETTY_CLIENT_CNXN_SOCKET
    • NIO_CLIENT_CNXN_SOCKET

      public static final String NIO_CLIENT_CNXN_SOCKET
    • logger

      private static final org.slf4j.Logger logger
    • PORT_PATTERN

      private static final Pattern PORT_PATTERN
    • connectString

      private final String connectString
    • sessionTimeoutMillis

      private final int sessionTimeoutMillis
    • connectionTimeoutMillis

      private final int connectionTimeoutMillis
    • rootPath

      private final String rootPath
    • clientSecure

      private final boolean clientSecure
    • withEnsembleTracker

      private final boolean withEnsembleTracker
    • keyStore

      private final String keyStore
    • keyStoreType

      private final String keyStoreType
    • keyStorePassword

      private final String keyStorePassword
    • trustStore

      private final String trustStore
    • trustStoreType

      private final String trustStoreType
    • trustStorePassword

      private final String trustStorePassword
    • authType

      private final String authType
    • authPrincipal

      private final String authPrincipal
    • removeHostFromPrincipal

      private final String removeHostFromPrincipal
    • removeRealmFromPrincipal

      private final String removeRealmFromPrincipal
    • juteMaxbuffer

      private final int juteMaxbuffer
  • Constructor Details

    • ZooKeeperClientConfig

      private ZooKeeperClientConfig(String connectString, int sessionTimeoutMillis, int connectionTimeoutMillis, String rootPath, String authType, String authPrincipal, String removeHostFromPrincipal, String removeRealmFromPrincipal, boolean clientSecure, String keyStore, String keyStoreType, String keyStorePassword, String trustStore, String trustStoreType, String trustStorePassword, int juteMaxbuffer, boolean withEnsembleTracker)
  • Method Details

    • getConnectString

      public String getConnectString()
    • getSessionTimeoutMillis

      public int getSessionTimeoutMillis()
    • getConnectionTimeoutMillis

      public int getConnectionTimeoutMillis()
    • getRootPath

      public String getRootPath()
    • isClientSecure

      public boolean isClientSecure()
    • isWithEnsembleTracker

      public boolean isWithEnsembleTracker()
    • getConnectionSocket

      public String getConnectionSocket()
    • getKeyStore

      public String getKeyStore()
    • getKeyStoreType

      public String getKeyStoreType()
    • getKeyStorePassword

      public String getKeyStorePassword()
    • getTrustStore

      public String getTrustStore()
    • getTrustStoreType

      public String getTrustStoreType()
    • getTrustStorePassword

      public String getTrustStorePassword()
    • getAuthType

      public String getAuthType()
    • getAuthPrincipal

      public String getAuthPrincipal()
    • getRemoveHostFromPrincipal

      public String getRemoveHostFromPrincipal()
    • getRemoveRealmFromPrincipal

      public String getRemoveRealmFromPrincipal()
    • getJuteMaxbuffer

      public int getJuteMaxbuffer()
    • resolvePath

      public String resolvePath(String path)
    • createConfig

      public static ZooKeeperClientConfig createConfig(NiFiProperties nifiProperties)
    • getTimePeriod

      private static int getTimePeriod(NiFiProperties nifiProperties, String propertyName, String defaultValue)
    • getPreferredProperty

      public static String getPreferredProperty(NiFiProperties properties, String preferredPropertyName, String defaultPropertyName)
      Retrieves the preferred property value if it's set, otherwise retrieves the default property. If neither are set, returns null.
      Parameters:
      properties - The NiFi properties configuration.
      preferredPropertyName - The preferred property to get from NiFi properties.
      defaultPropertyName - The backup property to get from NiFi properties if the preferred property is not present.
      Returns:
      Returns the property in order of preference.
    • cleanConnectString

      public static String cleanConnectString(String connectString)
      Takes a given connect string and splits it by ',' character. For each split result trims whitespace then splits by ':' character. For each secondary split if a single value is returned it is trimmed and then the default zookeeper 2181 is append by adding ":2181". If two values are returned then the second value is evaluated to ensure it contains only digits and if not then the entry is in error and exception is raised. If more than two values are returned the entry is in error and an exception is raised. Each entry is trimmed and if empty the entry is skipped. After all splits are cleaned then they are all appended back together demarcated by "," and the full string is returned.
      Parameters:
      connectString - the string to clean
      Returns:
      cleaned connect string guaranteed to be non null but could be empty
      Throws:
      IllegalStateException - if any portions could not be cleaned/parsed