Class 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 Details

  • Constructor Details

    • PairwiseIdDataConnector

      public PairwiseIdDataConnector()
  • Method Details

    • getSourceAttributeInformation

      @Nullable @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 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.