Package com.orchestranetworks.instance

# Interface RepositoryAnonymizer

public interface RepositoryAnonymizer
Allows anonymizing records.

Since:
  5.9.0
See Also:
  - `Repository.newAnonymizer()`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `RepositoryAnonymizer.RecordContext`
  Provides access to a record to be anonymized, granting the privilege to modify the value of its fields.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `anonymizeHistory(Consumer<RepositoryAnonymizer.RecordContext> aRecordAnonymizer)`
  Anonymizes the history records as specified by this object.
  `RepositoryAnonymizer`
  `setDatasetReference(AdaptationReference aDataset)`
  Specifies the dataset reference in which records must be anonymized.
  `RepositoryAnonymizer`
  `setRecordKey(PrimaryKey aRecordKey)`
  Specifies the functional primary key of the records to be anonymized.
  `RepositoryAnonymizer`
  `setTable(Path aTablePath, SchemaLocation aDataModel)`
  Specifies the table to be impacted by the anonymization.

- ## Method Details

  - ### setTable

    RepositoryAnonymizer setTable(Path aTablePath, SchemaLocation aDataModel)
    Specifies the table to be impacted by the anonymization.
    Since:
      5.9.0

  - ### setDatasetReference

    RepositoryAnonymizer setDatasetReference(AdaptationReference aDataset)
    Specifies the dataset reference in which records must be anonymized.
    Since:
      5.9.0
    See Also:
      - `Adaptation.getDatasetReference()`

  - ### setRecordKey

    RepositoryAnonymizer setRecordKey(PrimaryKey aRecordKey)
    Specifies the functional primary key of the records to be anonymized.
    Since:
      5.9.0

  - ### anonymizeHistory

    void anonymizeHistory(Consumer<RepositoryAnonymizer.RecordContext> aRecordAnonymizer)
    Anonymizes the history records as specified by this object. All the history records having the specified primary key in the `specified table` for the `dataset reference` will be anonymized.

    Some fields cannot be modified:

    - the primary key fields of the record,
    - the history technical fields (these fields are documented in the Javadoc of the method `AdaptationTable.getHistory()`).

    Limitations:

    - The specified dataset must be defined in * at least one open dataspace. If it is defined only in closed * dataspaces, or has been deleted from all open dataspaces, an * `IllegalStateException` is thrown.
    - In case of dataset inheritance, only the specified dataset will be impacted. Its children dataset would have to be anonymized individually.
    Parameters:
      `aRecordAnonymizer` - Anonymization operation to be applied; the `accept` method will be called for every record to be anonymized.
    Throws:
      `IllegalStateException` - If the specification of this object is incomplete or not consistent, or if history is not activated by the data model for the specified table.
    Since:
      5.9.0
    See Also:
      - `AdaptationTable.getHistory()`