Package net.shibboleth.idp.attribute.resolver.dc.impl

# Class PairwiseIdDataConnector

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
net.shibboleth.idp.attribute.resolver.AbstractDataConnector
net.shibboleth.idp.attribute.resolver.dc.impl.PairwiseIdDataConnector

All Implemented Interfaces:
  `DataConnector`, `ResolverPlugin<Map<String,IdPAttribute>>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`, `DisposableBean`

public class PairwiseIdDataConnector extends AbstractDataConnector
A `DataConnector` that generates pairwise IDs that depend on a seed `IdPAttribute`.

Since:
  4.0.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`generatedAttribute`
ID of the attribute generated by this data connector.
`private final org.slf4j.Logger`
`log`
Class logger.
`private PairwiseIdStore`
`pidStore`
Source of IDs.
`private String`
`sourceInformation`
Information about the dependency.

## Constructor Summary

Constructors
Constructor
Description
`PairwiseIdDataConnector()`

## Method Summary

Modifier and Type
Method
Description
`protected Map<String,IdPAttribute>`
`doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext)`
Retrieves a collection of attributes from some data source.
`private void`
`doDependencyInformation()`
Do the dance with dependencies.
`protected void`
`doInitialize()`
`protected Map<String,IdPAttribute>`
`encodeAsAttribute(String value)`
Encode the provided string.
`String`
`getGeneratedAttributeId()`
Get the ID of the attribute generated by this connector.
`PairwiseIdStore`
`getPairwiseIdStore()`
Get the underlying pairwise ID store.
`String`
`getSourceAttributeInformation()`
Get the attribute ID whose first value is being used when producing the pairwise ID.
`protected String`
`resolveSourceAttribute(AttributeResolverWorkContext workContext)`
Helper function to locate the source Attribute in the dependencies.
`void`
`setGeneratedAttributeId(String newAttributeId)`
Set the ID of the attribute generated by this connector.
`void`
`setPairwiseIdStore(PairwiseIdStore store)`
Set the underlying pairwise ID store.

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector

`doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptions`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### generatedAttribute

@NonnullAfterInit private String generatedAttribute
ID of the attribute generated by this data connector.

### sourceInformation

@NonnullAfterInit private String sourceInformation
Information about the dependency.

### pidStore

@NonnullAfterInit private PairwiseIdStore pidStore
Source of IDs.

## Constructor Details

### PairwiseIdDataConnector

public PairwiseIdDataConnector()

## Method Details

### getSourceAttributeInformation

@NonnullAfterInit public String getSourceAttributeInformation()
Get the attribute ID whose first value is being used when producing the pairwise ID.

Returns:
  source attribute ID

### getGeneratedAttributeId

@NonnullAfterInit public String getGeneratedAttributeId()
Get the ID of the attribute generated by this connector.

Returns:
  ID of the attribute generated by this connector

### setGeneratedAttributeId

public void setGeneratedAttributeId(@Nullable String newAttributeId)
Set the ID of the attribute generated by this connector.

Parameters:
  `newAttributeId` - what to set.

### getPairwiseIdStore

@NonnullAfterInit public PairwiseIdStore getPairwiseIdStore()
Get the underlying pairwise ID store.

Returns:
  ID store

### setPairwiseIdStore

public void setPairwiseIdStore(@Nonnull PairwiseIdStore store)
Set the underlying pairwise ID store.

Parameters:
  `store` - ID store

### doDependencyInformation

private void doDependencyInformation() throws ComponentInitializationException
Do the dance with dependencies.

Throws:
  `ComponentInitializationException` - if the dependencies are not aligned correctly

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractDataConnector`
Throws:
  `ComponentInitializationException`

### resolveSourceAttribute

@Nullable protected String resolveSourceAttribute(@Nonnull AttributeResolverWorkContext workContext)
Helper function to locate the source Attribute in the dependencies.

Parameters:
  `workContext` - the context to look in
Returns:
  the value, or null in any of the failure cases.

### doDataConnectorResolve

@Nullable @Unmodifiable @NotLive protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException
Retrieves a collection of attributes from some data source.

Specified by:
  `doDataConnectorResolve` in class `AbstractDataConnector`
Parameters:
  `resolutionContext` - current resolution context
  `workContext` - current resolver work context
Returns:
  collected attributes indexed by attribute ID
Throws:
  `ResolutionException` - thrown if there is a problem resolving the attributes

### encodeAsAttribute

@Nullable protected Map<String,IdPAttribute> encodeAsAttribute(@Nullable String value)
Encode the provided string.

Parameters:
  `value` - the value to encode or null if that failed
Returns:
  null or the attribute.