Package org.opensaml.profile.logic
Class MessageContextPredicateAdapter
java.lang.Object
org.opensaml.profile.logic.MessageContextPredicateAdapter
- All Implemented Interfaces:
Predicate<MessageContext>
A
Predicate which adapts an existing ProfileRequestContext predicate
for use as a MessageContext predicate.
In normal usage the message context evaluated must have a ProfileRequestContext somewhere in
its parent chain. Typically this will be its direct parent context, as supplied by
BaseContext.getParent(). An optional flag is supplied to determine the evaluation result
when no parent profile request context can be located. This case defaults to false.
One example is for use as a MessageHandler activation condition
via AbstractMessageHandler.setActivationCondition(Predicate).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Predicate<ProfileRequestContext>The adapted predicate.private booleanFlag indicating whether failure to resolve a parent ProfileRequestContext satisfies the predicate.private static final ParentProfileRequestContextLookup<MessageContext>The lookup function for the ProfileRequestContext. -
Constructor Summary
ConstructorsConstructorDescriptionMessageContextPredicateAdapter(Predicate<ProfileRequestContext> prcPredicate) Constructor.MessageContextPredicateAdapter(Predicate<ProfileRequestContext> prcPredicate, boolean unresolvedSatisfies) Constructor. -
Method Summary
-
Field Details
-
PRC_LOOKUP
The lookup function for the ProfileRequestContext. -
adapted
The adapted predicate. -
noPRCSatisfies
private boolean noPRCSatisfiesFlag indicating whether failure to resolve a parent ProfileRequestContext satisfies the predicate.
-
-
Constructor Details
-
MessageContextPredicateAdapter
public MessageContextPredicateAdapter(@Nonnull @ParameterName(name="prcPredicate") Predicate<ProfileRequestContext> prcPredicate) Constructor.Failure to resolve the
ProfileRequestContextparent results in an evaluation offalse.- Parameters:
prcPredicate- the adapted predicate
-
MessageContextPredicateAdapter
public MessageContextPredicateAdapter(@Nonnull @ParameterName(name="prcPredicate") Predicate<ProfileRequestContext> prcPredicate, @ParameterName(name="unresolvedSatisfies") boolean unresolvedSatisfies) Constructor.- Parameters:
prcPredicate- the adapted predicateunresolvedSatisfies- whether failure to resolve a parent ProfileRequestContext satisfies the predicate
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<MessageContext>
-