Class FilterByQueriedAttributes
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.saml2.profile.impl.FilterByQueriedAttributes
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that filters a set of attributes against the
Attribute objects in
an AttributeQuery.- Event:
EventIds.PROCEED_EVENT_ID
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AttributeContextAttributeContext to filter.Strategy used to locate theAttributeContextto filter.private final org.slf4j.LoggerClass logger.private AttributeQueryQuery to filter against.private Function<ProfileRequestContext,AttributeQuery> Strategy used to locate theAttributeQueryto filter against.Transcoder registry service object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, Attribute input, Multimap<String, IdPAttribute> results) Access the registry of transcoding rules to decode the inputAttribute.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private intfilterRequestedValues(IdPAttribute attribute, Collection<IdPAttribute> requestedAttributes) Adjust an input attribute's values based on any values requested.voidSet the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.voidSet the strategy used to locate theAttributeQueryassociated with a givenProfileRequestContext.voidSets the registry of transcoding rules to apply to encode attributes.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
transcoderRegistry
Transcoder registry service object. -
queryLookupStrategy
Strategy used to locate theAttributeQueryto filter against. -
attributeContextLookupStrategy
Strategy used to locate theAttributeContextto filter. -
query
Query to filter against. -
attributeContext
AttributeContext to filter.
-
-
Constructor Details
-
FilterByQueriedAttributes
public FilterByQueriedAttributes()Constructor.
-
-
Method Details
-
setQueryLookupStrategy
public void setQueryLookupStrategy(@Nonnull Function<ProfileRequestContext, AttributeQuery> strategy) Set the strategy used to locate theAttributeQueryassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
setAttributeContextLookupStrategy
public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Set the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
decodeAttribute
protected void decodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull Attribute input, @Nonnull @Live Multimap<String, IdPAttribute> results) throws AttributeDecodingExceptionAccess the registry of transcoding rules to decode the inputAttribute.- Parameters:
registry- registry of transcoding rulesprofileRequestContext- current profile request contextinput- input objectresults- collection to add results to- Throws:
AttributeDecodingException- if an error occurs or no results were obtained
-
filterRequestedValues
private int filterRequestedValues(@Nonnull IdPAttribute attribute, @Nonnull Collection<IdPAttribute> requestedAttributes) Adjust an input attribute's values based on any values requested.- Parameters:
attribute- attribute to filterrequestedAttributes- the attributes (and possibly values) requested- Returns:
- the number of values left in the input attribute