Class DefaultMetadataPolicyOperator
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.oidc.metadata.policy.impl.DefaultMetadataPolicyOperator
- All Implemented Interfaces:
CustomMetadataPolicyOperator,Component,DestructableComponent,InitializableComponent
public class DefaultMetadataPolicyOperator
extends AbstractInitializableComponent
implements CustomMetadataPolicyOperator
A
CustomMetadataPolicyOperator implementation that uses customizable Predicate for validating the
metadata policy and BiFunction for performing the operation.- Since:
- 3.1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Predicate<MetadataPolicy>The metadata policy validator.private BiFunction<Object,MetadataPolicy, Object> The metadata policy operator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Object inputValue, MetadataPolicy policy) Apply the operator for the given input that has the given metadata policy attached.voidvoidsetValidator(Predicate<MetadataPolicy> predicate) Set the metadata policy validator.voidsetValueOperator(BiFunction<Object, MetadataPolicy, Object> function) Set the metadata policy operator.booleanvalidate(MetadataPolicy policy) Validate whether the operator is compatible with the other operators in the policy.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
validator
The metadata policy validator. -
valueOperator
The metadata policy operator.
-
-
Constructor Details
-
DefaultMetadataPolicyOperator
public DefaultMetadataPolicyOperator()
-
-
Method Details
-
setValidator
Set the metadata policy validator.- Parameters:
predicate- What to set.
-
setValueOperator
Set the metadata policy operator.- Parameters:
function- What to set.
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
validate
Description copied from interface:CustomMetadataPolicyOperatorValidate whether the operator is compatible with the other operators in the policy.- Specified by:
validatein interfaceCustomMetadataPolicyOperator- Parameters:
policy- The metadata policy to be used by the custom policy operator.- Returns:
- true if
-
apply
public Object apply(@Nullable Object inputValue, @Nullable MetadataPolicy policy) throws ConstraintViolationException Description copied from interface:CustomMetadataPolicyOperatorApply the operator for the given input that has the given metadata policy attached.- Specified by:
applyin interfaceCustomMetadataPolicyOperator- Parameters:
inputValue- The value to be used by the custom policy operator.policy- The metadata policy to be used by the custom policy operator.- Returns:
- The value returned by the custom policy operator.
- Throws:
ConstraintViolationException- If the value-check of the custom operator fails.
-