Class PredicateRoleDescriptorResolver

    • Field Detail

      • IS_VALID_PREDICATE

        private static final Predicate<XMLObject> IS_VALID_PREDICATE
        Predicate for evaluating whether a TimeboundSAMLObject is valid.
      • log

        private org.slf4j.Logger log
        Logger.
      • requireValidMetadata

        private boolean requireValidMetadata
        Whether metadata is required to be valid.
      • entityDescriptorResolver

        private MetadataResolver entityDescriptorResolver
        Resolver of EntityDescriptors.
      • satisfyAnyPredicates

        private boolean satisfyAnyPredicates
        Flag which determines whether predicates used in filtering are connected by a logical 'OR' (true) or by logical 'AND' (false). Defaults to false.
      • useDefaultPredicateRegistry

        private boolean useDefaultPredicateRegistry
        Flag which determines whether the default predicate registry will be used if no one is supplied explicitly. Defaults to true.
      • resolveViaPredicatesOnly

        private boolean resolveViaPredicatesOnly
        Flag indicating whether resolution may be performed solely by applying predicates to the entire metadata collection. Defaults to false.
    • Constructor Detail

      • PredicateRoleDescriptorResolver

        public PredicateRoleDescriptorResolver​(@Nonnull @ParameterName(name="mdResolver")
                                               MetadataResolver mdResolver)
        Constructor.
        Parameters:
        mdResolver - the resolver of EntityDescriptors
    • Method Detail

      • isSatisfyAnyPredicates

        public boolean isSatisfyAnyPredicates()
        Get the flag indicating whether resolved credentials may satisfy any predicates (i.e. connected by logical 'OR') or all predicates (connected by logical 'AND').

        Defaults to false.

        Returns:
        true if must satisfy all, false otherwise
      • setSatisfyAnyPredicates

        public void setSatisfyAnyPredicates​(boolean flag)
        Set the flag indicating whether resolved credentials may satisfy any predicates (i.e. connected by logical 'OR') or all predicates (connected by logical 'AND').

        Defaults to false.

        Parameters:
        flag - true if must satisfy all, false otherwise
      • setCriterionPredicateRegistry

        public void setCriterionPredicateRegistry​(@Nullable
                                                  CriterionPredicateRegistry<RoleDescriptor> registry)
        Set the registry used in resolving predicates from criteria.
        Parameters:
        registry - the registry instance to use
      • isUseDefaultPredicateRegistry

        public boolean isUseDefaultPredicateRegistry()
        Get the flag which determines whether the default predicate registry will be used if one is not supplied explicitly.

        Defaults to true.

        Returns:
        true if should use default registry, false otherwise
      • setUseDefaultPredicateRegistry

        public void setUseDefaultPredicateRegistry​(boolean flag)
        Set the flag which determines whether the default predicate registry will be used if one is not supplied explicitly.

        Defaults to true.

        Parameters:
        flag - true if should use default registry, false otherwise
      • isResolveViaPredicatesOnly

        public boolean isResolveViaPredicatesOnly()
        Get the flag indicating whether resolution may be performed solely by applying predicates to the entire metadata collection.
        Returns:
        true if resolution may be attempted solely via predicates, false if not
      • setResolveViaPredicatesOnly

        public void setResolveViaPredicatesOnly​(boolean flag)
        Set the flag indicating whether resolution may be performed solely by applying predicates to the entire metadata collection.
        Parameters:
        flag - true if resolution may be attempted solely via predicates, false if not
      • haveRoleCriteria

        protected boolean haveRoleCriteria​(@Nonnull
                                           CriteriaSet criteria)
        Determine if have entity role criteria.
        Parameters:
        criteria - the current criteria set
        Returns:
        true if have role criteria, false otherwise
      • getCandidatesByRoleAndProtocol

        protected Iterable<RoleDescriptor> getCandidatesByRoleAndProtocol​(@Nonnull
                                                                          Iterable<EntityDescriptor> entityDescriptors,
                                                                          @Nonnull
                                                                          CriteriaSet criteria)
        Obtain the role descriptors contained by the input entity descriptors which match the specified role and protocol criteria.

        This method should only be called if haveRoleCriteria(CriteriaSet) evaluates to true.

        Parameters:
        entityDescriptors - the entity descriptors on which to operate
        criteria - the current criteria set
        Returns:
        the role descriptors corresponding to the input entity role and protocol
      • getAllCandidates

        protected Iterable<RoleDescriptor> getAllCandidates​(@Nonnull
                                                            Iterable<EntityDescriptor> entityDescriptors)
        Obtain all role descriptors contained by the input entity descriptors.
        Parameters:
        entityDescriptors - the entity descriptors on which to operate
        Returns:
        all role descriptors contained by the input entity descriptors
      • predicateFilterCandidates

        protected Iterable<RoleDescriptor> predicateFilterCandidates​(@Nonnull
                                                                     Iterable<RoleDescriptor> candidates,
                                                                     @Nonnull
                                                                     CriteriaSet criteria,
                                                                     boolean onEmptyPredicatesReturnEmpty)
                                                              throws ResolverException
        Filter the supplied candidates by resolving predicates from the supplied criteria and applying the predicates to return a filtered Iterable.
        Parameters:
        candidates - the candidates to evaluate
        criteria - the criteria set to evaluate
        onEmptyPredicatesReturnEmpty - if true and no predicates are supplied, then return an empty iterable; otherwise return the original input candidates
        Returns:
        an iterable of the candidates filtered by the resolved predicates
        Throws:
        ResolverException - if there is a fatal error during resolution