Interface AnonymizationHandler

All Superinterfaces:
com.broadleafcommerce.common.extension.data.DataRoutePartitionAware, org.springframework.core.Ordered

public interface AnonymizationHandler extends org.springframework.core.Ordered, com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
Component for applying anonymized data to an entity containing personal identifiable information.
  • Field Summary

    Fields inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware

    ALL_MATCH

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    anonymize(String boundedContextIdentifier, Object context)
    Given an identifier, find the associated entity containing personal identifiable information and apply anonymized data for all relevant fields.
    empty(String type, String field)
    Default implementation for creating a standard AnonymizationRecord for an empty field.
    fail(String boundedContextIdentifier, String type, Throwable e, boolean failFlow)
    Default implementation for create an AnonymizationRecord detailing a failed attempt to update a field.
    default int
     
    process(String boundedContextIdentifier, String type, String field, Supplier<String> fetch, Consumer<String> apply, String anonymizedValue)
    Default implementation for processing anonymization for a standard field

    Methods inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware

    getDataRoutePartition
  • Method Details

    • anonymize

      List<AnonymizationRecord> anonymize(String boundedContextIdentifier, @Nullable Object context)
      Given an identifier, find the associated entity containing personal identifiable information and apply anonymized data for all relevant fields.
      Parameters:
      boundedContextIdentifier - Identifier for an entity containing personal identifiable information. Usually customer id.
      context - ContextInfo from data tracking used to inform fetch request filtration. Optional.
      Returns:
      Information for each updated field regarding what was changed
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • process

      default AnonymizationRecord process(String boundedContextIdentifier, String type, String field, Supplier<String> fetch, Consumer<String> apply, String anonymizedValue)
      Default implementation for processing anonymization for a standard field
      Parameters:
      boundedContextIdentifier - Identifier for an entity containing personal identifiable information. Usually customer id.
      type - The class simple name for the entity
      field - The field that is being updated on the entity
      fetch - The get mutator on the entity for the field
      apply - The set mutator on the entity for the field
      anonymizedValue - The anonymization data to which the field is being set
      Returns:
      The details regarding the field change
    • empty

      default AnonymizationRecord empty(String type, String field)
      Default implementation for creating a standard AnonymizationRecord for an empty field.
      Parameters:
      type - The class simple name for the entity
      field - The field that is being updated on the entity
      Returns:
      The details regarding the field change
    • fail

      default AnonymizationRecord fail(String boundedContextIdentifier, String type, Throwable e, boolean failFlow)
      Default implementation for create an AnonymizationRecord detailing a failed attempt to update a field.
      Parameters:
      boundedContextIdentifier - Identifier for an entity containing personal identifiable information. Usually customer id.
      type - The class simple name for the entity
      e - The exception that caused the failuer
      failFlow - Whether or not this problem should stop the remainder of the anonymization process.
      Returns:
      The details regarding the field change