Package no.oslomet.aaas.anonymizer
Class ARXAnonymizer
- java.lang.Object
-
- no.oslomet.aaas.anonymizer.ARXAnonymizer
-
- All Implemented Interfaces:
Anonymizer
@Component public class ARXAnonymizer extends java.lang.Object implements Anonymizer
Anonymizer class using the ARX library to implement the anonymization
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigurationFactoryconfigFactoryprivate DataFactorydataFactoryprivate org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description ARXAnonymizer(DataFactory dataFactory, ConfigurationFactory configFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnonymizeResultanonymize(Request payload)Method to run anonymization on data in the payload with the provided parameters in the payloadprivate java.util.List<java.lang.String[]>createRawDataList(org.deidentifier.arx.ARXResult result)Returns a String that contains the anonymized data.private AnonymizeResultpackageResult(org.deidentifier.arx.ARXResult result, Request payload)Returns anAnonymizeResultobject containing a packaged results from the anonymized dataset
-
-
-
Field Detail
-
dataFactory
private final DataFactory dataFactory
-
configFactory
private final ConfigurationFactory configFactory
-
logger
private final org.slf4j.Logger logger
-
-
Constructor Detail
-
ARXAnonymizer
@Autowired public ARXAnonymizer(DataFactory dataFactory, ConfigurationFactory configFactory)
-
-
Method Detail
-
anonymize
public AnonymizeResult anonymize(Request payload)
Description copied from interface:AnonymizerMethod to run anonymization on data in the payload with the provided parameters in the payload- Specified by:
anonymizein interfaceAnonymizer- Parameters:
payload- Model object containing the data to be anonymized and params to use in anonymization- Returns:
- AnonymizeResult result object containing the best case anonymization and statistics
-
packageResult
private AnonymizeResult packageResult(org.deidentifier.arx.ARXResult result, Request payload)
Returns anAnonymizeResultobject containing a packaged results from the anonymized dataset- Parameters:
result- an ARXARXResultobject containing the anonymized data and meta datapayload- aRequestobject containing the dataset to be anonymized and the meta data to determine the settings and attributes on how to anonymized and analyze the data set- Returns:
- an
AnonymizeResultobject containing a packaged results from the anonymized dataset
-
createRawDataList
private java.util.List<java.lang.String[]> createRawDataList(org.deidentifier.arx.ARXResult result)
Returns a String that contains the anonymized data. This method is used to prepare the data set to be easily read and imported in the response payload.- Parameters:
result- an ARXARXResultobject that holds the anonymized data set.- Returns:
- a String containing the anonymized data set.
-
-