Class ConfigurationUtils

java.lang.Object
org.apache.kafka.common.security.oauthbearer.secured.ConfigurationUtils

public class ConfigurationUtils extends Object
ConfigurationUtils is a utility class to perform basic configuration-related logic and is separated out here for easier, more direct testing.
  • Constructor Details

    • ConfigurationUtils

      public ConfigurationUtils(Map<String,?> configs)
    • ConfigurationUtils

      public ConfigurationUtils(Map<String,?> configs, String saslMechanism)
  • Method Details

    • validateFile

      public Path validateFile(String name)
      Validates that, if a value is supplied, is a file that:
      • exists
        has read permission
        points to a file
    • If the value is null or an empty string, it is assumed to be an "empty" value and thus. ignored. Any whitespace is trimmed off of the beginning and end.
    • validateInteger

      public Integer validateInteger(String name, boolean isRequired)
      Validates that, if a value is supplied, is a value that:
      • is an Integer
        has a value that is not less than the provided minimum value
    • If the value is null or an empty string, it is assumed to be an "empty" value and thus ignored. Any whitespace is trimmed off of the beginning and end.
    • validateLong

      public Long validateLong(String name)
      Validates that, if a value is supplied, is a value that:
      • is an Integer
        has a value that is not less than the provided minimum value
    • If the value is null or an empty string, it is assumed to be an "empty" value and thus ignored. Any whitespace is trimmed off of the beginning and end.
    • validateLong

      public Long validateLong(String name, boolean isRequired)
    • validateLong

      public Long validateLong(String name, boolean isRequired, Long min)
    • validateUrl

      public URL validateUrl(String name)
      Validates that the configured URL that:
      • is well-formed
        contains a scheme
        uses either HTTP, HTTPS, or file protocols
    • No effort is made to connect to the URL in the validation step.
    • validateString

      public String validateString(String name) throws ValidateException
      Throws:
      ValidateException
    • validateString

      public String validateString(String name, boolean isRequired) throws ValidateException
      Throws:
      ValidateException
    • get

      public <T> T get(String name)