Package net.shibboleth.idp.attribute.resolver

# Class PluginDependencySupport

java.lang.Object
net.shibboleth.idp.attribute.resolver.PluginDependencySupport

public final class PluginDependencySupport extends Object
Support class for working with dependencies both `ResolverAttributeDefinitionDependency` and `ResolverDataConnectorDependency`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Log.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`PluginDependencySupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private static void`
`addAttribute(IdPAttribute source, Map<String,List<IdPAttributeValue>> target)`
Adds the values of the given attribute to the target collection of attribute values.
`static Map<String,List<IdPAttributeValue>>`
`getAllAttributeValues(AttributeResolverWorkContext workContext, Collection<ResolverAttributeDefinitionDependency> attributeDependencies, Collection<ResolverDataConnectorDependency> dataConnectorDependencies)`
Gets the values from all dependencies.
`static List<IdPAttributeValue>`
`getMergedAttributeValues(AttributeResolverWorkContext workContext, Collection<ResolverAttributeDefinitionDependency> attributeDependencies, Collection<ResolverDataConnectorDependency> dataConnectorDependencies, String attributeDefinitionId)`
Gets the values, as a single list, from all dependencies.
`private static void`
`mergeAttributeValues(IdPAttribute source, List<IdPAttributeValue> target)`
Adds the values of the given attribute to the set of attribute values.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### LOG

private static final org.slf4j.Logger LOG
Log.

## Constructor Details

### PluginDependencySupport

private PluginDependencySupport()
Constructor.

## Method Details

### getMergedAttributeValues

@Nonnull @Live public static List<IdPAttributeValue> getMergedAttributeValues(@Nonnull AttributeResolverWorkContext workContext, @Nonnull Collection<ResolverAttributeDefinitionDependency> attributeDependencies, @Nonnull Collection<ResolverDataConnectorDependency> dataConnectorDependencies, @Nonnull String attributeDefinitionId)
Gets the values, as a single list, from all dependencies. It is therefore used inside Attribute Definitions which only process a single attribute as input.

NOTE, this method does *not* actually trigger any attribute definition or data connector resolution, it only looks for the cached results of previously resolved plugins within the current work context.

Parameters:
  `workContext` - current attribute resolver work context
  `attributeDependencies` - set of dependencies on attribute definitions
  `dataConnectorDependencies` - set of dependencies on data connector definitions
  `attributeDefinitionId` - the attributeID that these values will be associated with.
Returns:
  the merged value set. Returns an empty set if we were given a DataConnector as a dependency, but not attribute name

### getAllAttributeValues

@Nonnull @Live public static Map<String,List<IdPAttributeValue>> getAllAttributeValues(@Nonnull AttributeResolverWorkContext workContext, @Nonnull Collection<ResolverAttributeDefinitionDependency> attributeDependencies, @Nonnull Collection<ResolverDataConnectorDependency> dataConnectorDependencies)
Gets the values from all dependencies. Attributes, with the same identifier but from different resolver plugins, will have their values merged into a single list within this method's returned map. This method is the equivalent of calling `getMergedAttributeValues(AttributeResolverWorkContext, Collection, Collection, String)` for all attributes resolved by all the given dependencies. This is therefore used when an attribute definition may have multiple input attributes (for instance scripted or templated definitions).

NOTE, this method does *not* actually trigger any attribute definition or data connector resolution, it only looks for the cached results of previously resolved plugins within the current work context.

Parameters:
  `workContext` - current attribute resolver work context
  `dataConnectorDependencies` - set of dependencies on data connector definitions
  `attributeDependencies` - set of dependencies
Returns:
  the merged value set

### addAttribute

private static void addAttribute(@Nullable IdPAttribute source, @Nonnull Map<String,List<IdPAttributeValue>> target)
Adds the values of the given attribute to the target collection of attribute values.

Parameters:
  `source` - the source attribute
  `target` - current set attribute values

### mergeAttributeValues

private static void mergeAttributeValues(@Nullable IdPAttribute source, @Nonnull @Live List<IdPAttributeValue> target)
Adds the values of the given attribute to the set of attribute values.

Parameters:
  `source` - the source attribute
  `target` - current set attribute values