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 TypeMethodDescriptionGiven an identifier, find the associated entity containing personal identifiable information and apply anonymized data for all relevant fields.default AnonymizationRecord
Default implementation for creating a standardAnonymizationRecord
for an empty field.default AnonymizationRecord
Default implementation for create anAnonymizationRecord
detailing a failed attempt to update a field.default int
getOrder()
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 fieldMethods inherited from interface com.broadleafcommerce.common.extension.data.DataRoutePartitionAware
getDataRoutePartition
-
Method Details
-
anonymize
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 interfaceorg.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 entityfield
- The field that is being updated on the entityfetch
- The get mutator on the entity for the fieldapply
- The set mutator on the entity for the fieldanonymizedValue
- The anonymization data to which the field is being set- Returns:
- The details regarding the field change
-
empty
Default implementation for creating a standardAnonymizationRecord
for an empty field.- Parameters:
type
- The class simple name for the entityfield
- 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 anAnonymizationRecord
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 entitye
- The exception that caused the failuerfailFlow
- Whether or not this problem should stop the remainder of the anonymization process.- Returns:
- The details regarding the field change
-