Class ConfigurationUtils
java.lang.Object
org.apache.kafka.common.security.oauthbearer.secured.ConfigurationUtils
ConfigurationUtils is a utility class to perform basic configuration-related
logic and is separated out here for easier, more direct testing.-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationUtils(Map<String, ?> configs) ConfigurationUtils(Map<String, ?> configs, String saslMechanism) -
Method Summary
Modifier and TypeMethodDescription<T> TvalidateFile(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.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.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.validateLong(String name, boolean isRequired) validateLong(String name, boolean isRequired, Long min) validateString(String name) validateString(String name, boolean isRequired) 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.
-
Constructor Details
-
ConfigurationUtils
-
ConfigurationUtils
-
-
Method Details
-
validateFile
Validates that, if a value is supplied, is a file that: 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.- exists
- has read permission
- points to a file
-
validateInteger
Validates that, if a value is supplied, is a value that: 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.- is an Integer
- has a value that is not less than the provided minimum value
-
validateLong
Validates that, if a value is supplied, is a value that: 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.- is an Integer
- has a value that is not less than the provided minimum value
-
validateLong
-
validateLong
-
validateUrl
Validates that the configured URL that: No effort is made to connect to the URL in the validation step.- is well-formed
- contains a scheme
- uses either HTTP, HTTPS, or file protocols
-
validateString
- Throws:
ValidateException
-
validateString
- Throws:
ValidateException
-
get
-