public abstract class CommonExtensionsValidatorCallback extends Object implements Callback, Contextable
Constructor and Description |
---|
CommonExtensionsValidatorCallback(SaslExtensions extensions) |
CommonExtensionsValidatorCallback(SaslExtensions extensions,
io.confluent.kafka.util.ClientContext context) |
Modifier and Type | Method and Description |
---|---|
io.confluent.kafka.util.ClientContext |
context() |
Map<String,String> |
data() |
void |
data(String key,
String value)
Add any extra information apart from extensions.
|
void |
error(String invalidExtensionName,
String errorMessage)
Set the error value for a specific extension key-value pair if validation has failed
|
String |
errorMessage() |
void |
errorMessage(String errorMessage) |
Map<String,String> |
ignoredExtensions() |
SaslExtensions |
inputExtensions() |
Map<String,String> |
invalidExtensions() |
void |
valid(String extensionName)
Validates a specific extension in the original
inputExtensions map |
void |
valid(String extensionName,
Map<String,Object> identityPoolClaims)
Validates a specific extension in the original
inputExtensions map. |
void |
valid(String extensionName,
String extensionValue)
Validates a specific extension in the original
inputExtensions map. |
Map<String,String> |
validatedExtensions() |
public static final String SEPARATOR
public CommonExtensionsValidatorCallback(SaslExtensions extensions, io.confluent.kafka.util.ClientContext context)
public CommonExtensionsValidatorCallback(SaslExtensions extensions)
public io.confluent.kafka.util.ClientContext context()
context
in interface Contextable
public SaslExtensions inputExtensions()
SaslExtensions
consisting of the unvalidated extension names and values that were sent by the clientpublic Map<String,String> validatedExtensions()
Map
consisting of the validated and recognized by the server extension names and valuespublic Map<String,String> invalidExtensions()
Map
consisting of the name->error messages of extensions which failed validationpublic Map<String,String> ignoredExtensions()
Map
consisting of the extensions that have neither been validated nor invalidatedpublic void error(String invalidExtensionName, String errorMessage)
invalidExtensionName
- the mandatory extension name which caused the validation failureerrorMessage
- error message describing why the validation failedpublic String errorMessage()
public void errorMessage(String errorMessage)
public void valid(String extensionName)
inputExtensions
mapextensionName
- - the name of the extension which was validatedpublic void valid(String extensionName, String extensionValue)
inputExtensions
map. Adds entries
in validatedExtensions
for valid extension.extensionName
- - the name of the extension which was validatedextensionValue
- - the value of the extension which was validated, or some messagepublic void valid(String extensionName, Map<String,Object> identityPoolClaims)
inputExtensions
map. For each item in identity
pool claims adds entry extentionname:map.key = map.value in validatedExtensions
extensionName
- - the name of the extension which was validatedidentityPoolClaims
- -OAuthBearerExtensionsValidatorCallback pool claims corresponding to identity pool idpublic void data(String key, String value)
key
- String name of the key entryvalue
- String value for the data entry