Class ParameterCallback
- java.lang.Object
-
- org.wildfly.security.auth.callback.ParameterCallback
-
- All Implemented Interfaces:
Serializable
,Callback
,ExtendedCallback
public final class ParameterCallback extends Object implements ExtendedCallback, Serializable
A callback used to acquire parameter specifications, either for outbound or inbound authentication. The supplied parameter information may be used to select an authentication mechanism, or to set parameters for an establishing mechanism. The supplied parameter specification should be of a supported type; theisParameterSupported(AlgorithmParameterSpec)
andisParameterTypeSupported(Class)
methods can be used to query the types that are supported. If no credential is available,null
is set, and authentication may fail. If an unsupported credential type is set, authentication may fail.- Author:
- David M. Lloyd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Class<? extends AlgorithmParameterSpec>[]
allowedTypes
private AlgorithmParameterSpec
parameterSpec
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description ParameterCallback(Class<? extends AlgorithmParameterSpec>... allowedTypes)
Construct a new instance.ParameterCallback(AlgorithmParameterSpec parameterSpec, Class<? extends AlgorithmParameterSpec>... allowedTypes)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlgorithmParameterSpec
getParameterSpec()
Get the parameter specification.boolean
isOptional()
Determine if this callback is optional.boolean
isParameterSupported(AlgorithmParameterSpec parameterSpec)
Determine whether a parameter specification would be supported by the authentication.boolean
isParameterTypeSupported(Class<? extends AlgorithmParameterSpec> parameterType)
Determine whether a credential type would be supported by the authentication.boolean
needsInformation()
Determine if this callback is requesting information.void
setParameterSpec(AlgorithmParameterSpec parameterSpec)
Set the parameter specification.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
allowedTypes
private final Class<? extends AlgorithmParameterSpec>[] allowedTypes
-
parameterSpec
private AlgorithmParameterSpec parameterSpec
-
-
Constructor Detail
-
ParameterCallback
@SafeVarargs public ParameterCallback(Class<? extends AlgorithmParameterSpec>... allowedTypes)
Construct a new instance.- Parameters:
allowedTypes
- the allowed types of parameter specification
-
ParameterCallback
@SafeVarargs public ParameterCallback(AlgorithmParameterSpec parameterSpec, Class<? extends AlgorithmParameterSpec>... allowedTypes)
Construct a new instance.- Parameters:
parameterSpec
- the default parameter spec value, if anyallowedTypes
- the allowed types of parameter spec
-
-
Method Detail
-
getParameterSpec
public AlgorithmParameterSpec getParameterSpec()
Get the parameter specification.- Returns:
- the parameter specification, or
null
if it wasn't set yet
-
setParameterSpec
public void setParameterSpec(AlgorithmParameterSpec parameterSpec)
Set the parameter specification.- Parameters:
parameterSpec
- the parameter specification, ornull
if no parameter specification is available
-
isParameterSupported
public boolean isParameterSupported(AlgorithmParameterSpec parameterSpec)
Determine whether a parameter specification would be supported by the authentication.- Parameters:
parameterSpec
- the parameter specification to test- Returns:
true
if the parameter specification is non-null
and supported,false
otherwise
-
isParameterTypeSupported
public boolean isParameterTypeSupported(Class<? extends AlgorithmParameterSpec> parameterType)
Determine whether a credential type would be supported by the authentication.- Parameters:
parameterType
- the parameter specification type to test- Returns:
true
if the parameter specification type is supported,false
otherwise
-
isOptional
public boolean isOptional()
Description copied from interface:ExtendedCallback
Determine if this callback is optional.- Specified by:
isOptional
in interfaceExtendedCallback
- Returns:
true
if the callback is optional,false
if it is mandatory
-
needsInformation
public boolean needsInformation()
Description copied from interface:ExtendedCallback
Determine if this callback is requesting information.- Specified by:
needsInformation
in interfaceExtendedCallback
- Returns:
true
if the callback is requesting information,false
if it is only providing information
-
-