Class MessageContextPredicateAdapter

  • All Implemented Interfaces:
    Predicate<org.opensaml.messaging.context.MessageContext>, net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.messaging.context.MessageContext>

    public class MessageContextPredicateAdapter
    extends Object
    implements net.shibboleth.utilities.java.support.logic.Predicate<org.opensaml.messaging.context.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 Detail

      • PRC_LOOKUP

        @Nonnull
        private static final ParentProfileRequestContextLookup<org.opensaml.messaging.context.MessageContext> PRC_LOOKUP
        The lookup function for the ProfileRequestContext.
      • noPRCSatisfies

        private boolean noPRCSatisfies
        Flag indicating whether failure to resolve a parent ProfileRequestContext satisfies the predicate.
    • Constructor Detail

      • MessageContextPredicateAdapter

        public MessageContextPredicateAdapter​(@Nonnull @ParameterName(name="prcPredicate")
                                              Predicate<ProfileRequestContext> prcPredicate)
        Constructor.

        Failure to resolve the ProfileRequestContext parent results in an evaluation of false.

        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 predicate
        unresolvedSatisfies - whether failure to resolve a parent ProfileRequestContext satisfies the predicate
    • Method Detail

      • test

        public boolean test​(@Nullable
                            org.opensaml.messaging.context.MessageContext input)
        Specified by:
        test in interface Predicate<org.opensaml.messaging.context.MessageContext>