public class AddAudienceRestrictionToAssertions extends AbstractConditionalProfileAction
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addingAudiencesToExistingRestriction
Whether, if an assertion already contains an audience restriction, this action will add its audiences to that
restriction or create another one.
|
private com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> |
audienceRestrictionsLookupStrategy
Strategy used to obtain the audiences to add.
|
private java.util.Collection<java.lang.String> |
audiences
Audiences to add.
|
private org.slf4j.Logger |
log
Class logger.
|
private SAMLObject |
response
Response to modify.
|
private com.google.common.base.Function<ProfileRequestContext,SAMLObject> |
responseLookupStrategy
Strategy used to locate the Response to operate on.
|
| Constructor and Description |
|---|
AddAudienceRestrictionToAssertions()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addAudienceRestriction(ProfileRequestContext profileRequestContext,
Conditions conditions)
Add the audiences obtained from a lookup function to the
AudienceRestrictionCondition. |
private void |
addAudienceRestriction(ProfileRequestContext profileRequestContext,
Conditions conditions)
Add the audiences obtained from a lookup function to the
AudienceRestriction. |
protected void |
doExecute(ProfileRequestContext profileRequestContext)
Performs this action.
|
protected void |
doInitialize() |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext)
Called prior to execution, actions may override this method to perform pre-processing for a request.
|
private AudienceRestriction |
getAudienceRestriction(Conditions conditions)
Get the
AudienceRestriction to which audiences will be added. |
private AudienceRestrictionCondition |
getAudienceRestrictionCondition(Conditions conditions)
Get the
AudienceRestrictionCondition to which audiences will be added. |
void |
setAddingAudiencesToExistingRestriction(boolean addingToExistingRestriction)
Set whether, if an assertion already contains an audience restriction, this action will add its audiences to
that restriction or create another one.
|
void |
setAudienceRestrictionsLookupStrategy(com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> strategy)
Set the strategy used to obtain the audience restrictions to apply.
|
void |
setResponseLookupStrategy(com.google.common.base.Function<ProfileRequestContext,SAMLObject> strategy)
Set the strategy used to locate the Response to operate on.
|
getActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
private boolean addingAudiencesToExistingRestriction
@Nonnull private com.google.common.base.Function<ProfileRequestContext,SAMLObject> responseLookupStrategy
@Nullable private com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> audienceRestrictionsLookupStrategy
@Nullable private SAMLObject response
@Nullable private java.util.Collection<java.lang.String> audiences
public AddAudienceRestrictionToAssertions()
public void setResponseLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,SAMLObject> strategy)
strategy - lookup strategypublic void setAddingAudiencesToExistingRestriction(boolean addingToExistingRestriction)
addingToExistingRestriction - whether this action will add its audiences to that restriction or create
another onepublic void setAudienceRestrictionsLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,java.util.Collection<java.lang.String>> strategy)
strategy - lookup strategyprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionprotected boolean doPreExecute(@Nonnull
ProfileRequestContext profileRequestContext)
If false is returned, execution will not proceed, and the action should attach an
EventContext to the context tree to signal how to continue with overall
workflow processing.
If returning successfully, the last step should be to return the result of the superclass version of this method.
doPreExecute in class AbstractConditionalProfileActionprofileRequestContext - the current IdP profile request contextprotected void doExecute(@Nonnull
ProfileRequestContext profileRequestContext)
doExecute in class AbstractProfileActionprofileRequestContext - the current IdP profile request contextprivate void addAudienceRestriction(@Nonnull
ProfileRequestContext profileRequestContext,
@Nonnull
Conditions conditions)
AudienceRestrictionCondition. If no
AudienceRestrictionCondition exists on the given Conditions one is created and added.profileRequestContext - current profile request contextconditions - condition that has, or will receive the created, AudienceRestrictionConditionprivate void addAudienceRestriction(@Nonnull
ProfileRequestContext profileRequestContext,
@Nonnull
Conditions conditions)
AudienceRestriction. If no
AudienceRestriction exists on the given Conditions one is created and added.profileRequestContext - current profile request contextconditions - condition that has, or will receive the created, AudienceRestriction@Nonnull private AudienceRestrictionCondition getAudienceRestrictionCondition(@Nonnull Conditions conditions)
AudienceRestrictionCondition to which audiences will be added.conditions - existing set of conditions@Nonnull private AudienceRestriction getAudienceRestriction(@Nonnull Conditions conditions)
AudienceRestriction to which audiences will be added.conditions - existing set of conditions