Class MetadataPolicyEntry
java.lang.Object
com.nimbusds.openid.connect.sdk.federation.policy.MetadataPolicyEntry
- All Implemented Interfaces:
Map.Entry<String,
List<PolicyOperation>>
Policy entry for a metadata parameter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PolicyOperationCombinationValidator
The default policy operation combination validator.static final PolicyOperationFactory
The default policy operation factory. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataPolicyEntry
(String parameterName, List<PolicyOperation> policyOperations) Creates a new policy entry for a metadata parameter. -
Method Summary
Modifier and TypeMethodDescriptionApplies this policy entry for a metadata parameter to the specified value.combine
(MetadataPolicyEntry other) Combines this policy entry with another one for the same parameter name.combine
(MetadataPolicyEntry other, PolicyOperationCombinationValidator combinationValidator) Combines this policy entry with another one for the same parameter name.getKey()
Returns a map of the operations for this policy entry, in theirstandard execution order
.Returns the parameter name.Returns the policy operations.getValue()
static MetadataPolicyEntry
Parses a policy entry for a metadata parameter.static MetadataPolicyEntry
parse
(String parameterName, net.minidev.json.JSONObject entrySpec, PolicyOperationFactory factory, PolicyOperationCombinationValidator combinationValidator) Parses a policy entry for a metadata parameter.setValue
(List<PolicyOperation> policyOperations) net.minidev.json.JSONObject
Returns a JSON object representation of the policy operations for this entry.
-
Field Details
-
DEFAULT_POLICY_OPERATION_FACTORY
The default policy operation factory. -
DEFAULT_POLICY_COMBINATION_VALIDATOR
The default policy operation combination validator.
-
-
Constructor Details
-
MetadataPolicyEntry
Creates a new policy entry for a metadata parameter.- Parameters:
parameterName
- The parameter name. Must not benull
.policyOperations
- The policy operations, empty list ornull
if none.
-
-
Method Details
-
getParameterName
Returns the parameter name.- Returns:
- The parameter name.
- See Also:
-
getKey
- Specified by:
getKey
in interfaceMap.Entry<String,
List<PolicyOperation>> - See Also:
-
getPolicyOperations
Returns the policy operations.- Returns:
- The policy operations, empty list if none.
- See Also:
-
getValue
- Specified by:
getValue
in interfaceMap.Entry<String,
List<PolicyOperation>> - See Also:
-
setValue
- Specified by:
setValue
in interfaceMap.Entry<String,
List<PolicyOperation>>
-
getOperationsMap
Returns a map of the operations for this policy entry, in theirstandard execution order
. Non-standard (custom) policy operations will be put at the end, in no particular order between them.- Returns:
- The map, empty if no operations.
-
combine
Combines this policy entry with another one for the same parameter name. Uses thedefault policy combination validator
.- Parameters:
other
- The other policy entry. Must not benull
.- Returns:
- The new combined policy entry.
- Throws:
PolicyViolationException
- If the parameter names don't match or another violation was encountered.
-
combine
public MetadataPolicyEntry combine(MetadataPolicyEntry other, PolicyOperationCombinationValidator combinationValidator) throws PolicyViolationException Combines this policy entry with another one for the same parameter name.- Parameters:
other
- The other policy entry. Must not benull
.combinationValidator
- The policy operation combination validator. Must not benull
.- Returns:
- The new combined policy entry.
- Throws:
PolicyViolationException
- If the parameter names don't match or another violation was encountered.
-
apply
Applies this policy entry for a metadata parameter to the specified value.- Parameters:
value
- The parameter value,null
if not specified.- Returns:
- The resulting value, can be
null
. - Throws:
PolicyViolationException
- On a policy violation.
-
toJSONObject
Returns a JSON object representation of the policy operations for this entry.- Returns:
- The JSON object keeping the ordering of the members.
-
parse
public static MetadataPolicyEntry parse(String parameterName, net.minidev.json.JSONObject entrySpec) throws ParseException, PolicyViolationException Parses a policy entry for a metadata parameter. This method is intended for policies with standardPolicyOperation
s only. Uses the defaultpolicy operation
andpolicy combination validator
factories.- Parameters:
parameterName
- The parameter name. Must not benull
.entrySpec
- The JSON object entry specification, must not benull
.- Returns:
- The policy entry for the metadata parameter.
- Throws:
ParseException
- On JSON parsing exception.PolicyViolationException
- On a policy violation.
-
parse
public static MetadataPolicyEntry parse(String parameterName, net.minidev.json.JSONObject entrySpec, PolicyOperationFactory factory, PolicyOperationCombinationValidator combinationValidator) throws ParseException, PolicyViolationException Parses a policy entry for a metadata parameter. This method is intended for policies including non-standardPolicyOperation
s.- Parameters:
parameterName
- The parameter name. Must not benull
.entrySpec
- The JSON object entry specification, must not benull
.factory
- The policy operation factory. Must not benull
.combinationValidator
- The policy operation combination validator. Must not benull
.- Returns:
- The policy entry for the metadata parameter.
- Throws:
ParseException
- On JSON parsing exception.PolicyViolationException
- On a policy violation.
-