Class MockMatcher
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.idp.attribute.filter.testing.MockMatcher
- All Implemented Interfaces:
Matcher,Component,DestructableComponent,IdentifiedComponent,InitializableComponent
A simple, mock implementation of
Matcher.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleando we fail when validate is called? do we fail when we are called?private booleanstate variableprivate StringID of the attribute to which this matcher applies.private Collection<?>Values, of the attribute, considered to match this matcher.Fields inherited from interface net.shibboleth.idp.attribute.filter.Matcher
MATCHER_FAILS, MATCHES_ALL, MATCHES_NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetMatchingValues(IdPAttribute attribute, AttributeFilterContext filterContext) Return thoseIdPAttributeValues which match this rule, or null if the matcher failed.booleanvoidsetFailValidate(boolean doFail) set whether we are going to fail {getMatchingValues(IdPAttribute, AttributeFilterContext).voidSets the ID of the attribute to which this matcher applies.voidsetMatchingValues(Collection<?> values) Sets the values, of the attribute, considered to match this matcher.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, setIdMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
matchingAttribute
ID of the attribute to which this matcher applies. -
matchingValues
Values, of the attribute, considered to match this matcher. -
initialized
private boolean initializedstate variable -
fails
private boolean failsdo we fail when validate is called? do we fail when we are called?
-
-
Constructor Details
-
MockMatcher
public MockMatcher()Constructor.
-
-
Method Details
-
setMatchingAttribute
Sets the ID of the attribute to which this matcher applies.- Parameters:
id- ID of the attribute to which this matcher applies
-
setMatchingValues
Sets the values, of the attribute, considered to match this matcher. If null then all attribute values are considered to be matching.- Parameters:
values- values, of the attribute, considered to match this matcher
-
getMatchingValues
@Nullable public Set<IdPAttributeValue> getMatchingValues(@Nonnull IdPAttribute attribute, @Nonnull AttributeFilterContext filterContext) Return thoseIdPAttributeValues which match this rule, or null if the matcher failed.- Specified by:
getMatchingValuesin interfaceMatcher- Parameters:
attribute- the attribute under question.filterContext- the filter context- Returns:
- The result of this rule. Null if we failed.
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInitializableComponent- Overrides:
isInitializedin classAbstractInitializableComponent
-
doInitialize
public void doInitialize()- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent
-
setFailValidate
public void setFailValidate(boolean doFail) set whether we are going to fail {getMatchingValues(IdPAttribute, AttributeFilterContext).- Parameters:
doFail- whether we are going to fail.
-