Class AttributeResolverImpl

    • Constructor Detail

      • AttributeResolverImpl

        public AttributeResolverImpl()
        Constructor.
    • Method Detail

      • setAttributeDefinitions

        public void setAttributeDefinitions​(@Nonnull @NonnullElements
                                            Collection<AttributeDefinition> definitions)
        Sets the attribute definitions for this resolver.
        Parameters:
        definitions - attribute definitions loaded in to this resolver
      • setDataConnectors

        public void setDataConnectors​(@Nonnull @NonnullElements
                                      Collection<DataConnector> connectors)
        Sets the data connectors for this resolver.
        Parameters:
        connectors - data connectors loaded in to this resolver
      • isStripNulls

        public boolean isStripNulls()
        Do we strip nulls from attribute values.
        Returns:
        Returns whether to strip nulls from attribute values
      • setStripNulls

        public void setStripNulls​(Boolean doStripNulls)
        Sets whether to strip nulls from attribute values.
        Parameters:
        doStripNulls - what to set
      • isSuppressDisplayInformation

        public boolean isSuppressDisplayInformation()
        Do we allow addition of Display Information?
        Returns:
        whether we are suppressing
      • setSuppressDisplayInformation

        @Deprecated(forRemoval=true,
                    since="4.2")
        public void setSuppressDisplayInformation​(boolean what)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Display Information should be consulted at point of use
        Set whether we suppress addition of Display Information.
        Parameters:
        what - true if we suppress the addition.
      • resolveDependencies

        protected void resolveDependencies​(@Nonnull
                                           ResolverPlugin<?> plugin,
                                           @Nonnull
                                           AttributeResolutionContext resolutionContext)
                                    throws ResolutionException
        Resolves all the dependencies for a given plugin.
        Parameters:
        plugin - plugin whose dependencies should be resolved
        resolutionContext - current resolution context
        Throws:
        ResolutionException - thrown if there is a problem resolving a dependency
      • filterAttributeValues

        @Nullable
        @NonnullElements
        private List<IdPAttributeValue> filterAttributeValues​(String attributeId,
                                                              List<IdPAttributeValue> input)
        Helper method for exporting attributes.
        Parameters:
        attributeId - the if (for logging)
        input - the inout list
        Returns:
        a null stripped, or null list of values
      • collectResolvedAttributes

        private void collectResolvedAttributes​(Map<String,​IdPAttribute> resolvedAttributes,
                                               AttributeResolverWorkContext workContext,
                                               boolean includeDependencyOnly)
        Helper function to collect suitably resolved attributes.
        Parameters:
        resolvedAttributes - bucket to collect attributes into
        workContext - context to extract attributes from
        includeDependencyOnly - whether we include dependencyOnly attributes
      • collectExportingDataConnectors

        private void collectExportingDataConnectors​(Map<String,​IdPAttribute> resolvedAttributes,
                                                    AttributeResolutionContext resolutionContext,
                                                    AttributeResolverWorkContext workContext)
        Helper function to collect attributes and their data & metadata from suitable data connectors.
        Parameters:
        resolvedAttributes - bucket to collect attributes into
        resolutionContext - the context we are working in
        workContext - context to extract attributes from
      • finalizeResolvedAttributes

        protected void finalizeResolvedAttributes​(@Nonnull
                                                  AttributeResolutionContext resolutionContext)
        Finalizes the set of resolved attributes and places them in the AttributeResolutionContext. The result of each AttributeDefinition resolution is inspected. If the result is not null, a dependency-only attribute, or an attribute that contains no values then it becomes part of the final set of resolved attributes.

        Then we handle attribute exports from DataConnectors.

        Values are also de-duplicated here, so that all the intermediate operations maintain the coherency of multi-valued result sets produced by data connectors.

        Parameters:
        resolutionContext - current resolution context
      • finalizePreResolvedAttributes

        protected void finalizePreResolvedAttributes​(@Nonnull
                                                     AttributeResolutionContext resolutionContext)
        Collects the set of pre resolved attributes and places them in an AttributeContext which inserted as a child of the AttributeResolutionContext and also returned.

        Values are also de-duplicated here.

        Parameters:
        resolutionContext - current resolution context
      • checkPlugInDependencies

        protected void checkPlugInDependencies​(String circularCheckPluginId,
                                               ResolverPlugin<?> plugin,
                                               Set<String> checkedPlugins)
                                        throws ComponentInitializationException
        Checks to ensure that there are no circular dependencies or dependencies on non-existent plugins.
        Parameters:
        circularCheckPluginId - the ID of the plugin currently being checked for circular dependencies
        plugin - current plugin, in the dependency tree of the plugin being checked, that we're currently looking at
        checkedPlugins - IDs of plugins that have already been checked and known to be good
        Throws:
        ComponentInitializationException - thrown if there is a dependency loop
      • startTimer

        private boolean startTimer​(@Nonnull
                                   AttributeResolutionContext resolutionContext)
        Conditionally start a timer at the beginning of the resolution process.
        Parameters:
        resolutionContext - attribute resolution context
        Returns:
        true iff the stopTimer(AttributeResolutionContext) method needs to be called
      • stopTimer

        private void stopTimer​(@Nonnull
                               AttributeResolutionContext resolutionContext)
        Conditionally stop a timer at the end of the resolution process.
        Parameters:
        resolutionContext - attribute resolution context