Package org.wildfly.security.util
Class DefaultTransformationMapper
- java.lang.Object
-
- org.wildfly.security.util.DefaultTransformationMapper
-
- All Implemented Interfaces:
TransformationMapper
public class DefaultTransformationMapper extends Object implements TransformationMapper
Default implementation of TransformationMapper interface.- Author:
- Peter Skopek
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMap<String,TransformationSpec[]>transformations
-
Constructor Summary
Constructors Constructor Description DefaultTransformationMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransformationSpecgetTransformationSpec(String mechanism, String token)Get TransformationSpec with highest strength.TransformationSpecgetTransformationSpec(String provider, String mechanism, String token)Get TransformationSpec with highest strength.TransformationSpec[]getTransformationSpecByStrength(String mechanism, String... tokens)Get ordered array of TransformationSpec by strength.TransformationSpec[]getTransformationSpecByStrength(String provider, String mechanism, String... tokens)Get ordered array of TransformationSpec by strength.TransformationSpec[]getTransformationSpecWithStrength(String mechanism, int strength, String... tokens)Get array of TransformationSpec with given strength.TransformationSpec[]getTransformationSpecWithStrength(String provider, String mechanism, int strength, String... tokens)Get array of TransformationSpec with given strength.
-
-
-
Field Detail
-
transformations
protected HashMap<String,TransformationSpec[]> transformations
-
-
Method Detail
-
getTransformationSpec
public TransformationSpec getTransformationSpec(String mechanism, String token) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet TransformationSpec with highest strength.- Specified by:
getTransformationSpecin interfaceTransformationMapper- Parameters:
mechanism- name as per specification. Cannot benull.token- name as per mechanism specification- Returns:
- TransformationSpec object
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
getTransformationSpec
public TransformationSpec getTransformationSpec(String provider, String mechanism, String token) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet TransformationSpec with highest strength.- Specified by:
getTransformationSpecin interfaceTransformationMapper- Parameters:
provider- name as defined by JCAmechanism- name as per specification. Cannot benull.token- name as per mechanism specification- Returns:
- TransformationSpec object
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
getTransformationSpecByStrength
public TransformationSpec[] getTransformationSpecByStrength(String mechanism, String... tokens) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet ordered array of TransformationSpec by strength. Array is ordered from the highest strength to the lowest.- Specified by:
getTransformationSpecByStrengthin interfaceTransformationMapper- Parameters:
mechanism- name as per specification. Cannot benull.tokens- - array of tokens to consider. Names as per mechanism specification.- Returns:
- ordered array of TransformationSpec
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
getTransformationSpecByStrength
public TransformationSpec[] getTransformationSpecByStrength(String provider, String mechanism, String... tokens) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet ordered array of TransformationSpec by strength. Array is ordered from the highest strength to the lowest.- Specified by:
getTransformationSpecByStrengthin interfaceTransformationMapper- Parameters:
provider- name as defined by JCAmechanism- name as per specification. Cannot benull.tokens- - array of tokens to consider. Names as per mechanism specification.- Returns:
- ordered array of TransformationSpec
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
getTransformationSpecWithStrength
public TransformationSpec[] getTransformationSpecWithStrength(String mechanism, int strength, String... tokens) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet array of TransformationSpec with given strength.- Specified by:
getTransformationSpecWithStrengthin interfaceTransformationMapper- Parameters:
mechanism- name as per specification. Cannot benull.strength- of desired transformationtokens- - array of tokens to consider. Names as per mechanism specification.- Returns:
- array of TransformationSpec
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
getTransformationSpecWithStrength
public TransformationSpec[] getTransformationSpecWithStrength(String provider, String mechanism, int strength, String... tokens) throws IllegalArgumentException
Description copied from interface:TransformationMapperGet array of TransformationSpec with given strength.- Specified by:
getTransformationSpecWithStrengthin interfaceTransformationMapper- Parameters:
provider- name as defined by JCAmechanism- name as per specification. Cannot benull.strength- of desired transformationtokens- - array of tokens to consider. Names as per mechanism specification.- Returns:
- array of TransformationSpec
- Throws:
IllegalArgumentException- if there is no such mechanism or token for the mechanism
-
-