Package no.nav.arxaas.anonymizer
Class ARXAnonymizer
- java.lang.Object
-
- no.nav.arxaas.anonymizer.ARXAnonymizer
-
- All Implemented Interfaces:
Anonymizer
@Component public class ARXAnonymizer extends Object implements Anonymizer
Anonymizer class using the ARX library to implement the arxaas
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigurationFactoryconfigFactoryprivate DataFactorydataFactoryprivate static StringexceptionErrorprivate 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 arxaas on data in the payload with the provided parameters in the payloadprivate List<String[]>createRawDataList(org.deidentifier.arx.ARXResult result)Returns a String that contains the anonymized data.private org.deidentifier.arx.ARXConfigurationgetARXConfiguration(Request payload)Retruns anARXConfigurationobject containing the arxaas settings defined by the request payload.private org.deidentifier.arx.ARXResultgetARXResult(org.deidentifier.arx.Data data, org.deidentifier.arx.ARXConfiguration config)Returns anARXResultobject containing the anonymized dataset based on the arxaas settgings provided which dataset to anonymize.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
-
exceptionError
private static final String exceptionError
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ARXAnonymizer
@Autowired public ARXAnonymizer(DataFactory dataFactory, ConfigurationFactory configFactory)
-
-
Method Detail
-
anonymize
public AnonymizeResult anonymize(Request payload)
Method to run arxaas on data in the payload with the provided parameters in the payload- Specified by:
anonymizein interfaceAnonymizer- Parameters:
payload-Requestobject containing the data to be anonymized and params to use in arxaas- Returns:
- an
AnonymizeResultobject containing the best case arxaas and statistics
-
getARXResult
private org.deidentifier.arx.ARXResult getARXResult(org.deidentifier.arx.Data data, org.deidentifier.arx.ARXConfiguration config)Returns anARXResultobject containing the anonymized dataset based on the arxaas settgings provided which dataset to anonymize.- Parameters:
data- aDataobject to be anonymizedconfig- anARXConfigurationobject containing the settings on how to anonymize the data- Returns:
- an
ARXResultobject containing the anonymized dataset.
-
getARXConfiguration
private org.deidentifier.arx.ARXConfiguration getARXConfiguration(Request payload)
Retruns anARXConfigurationobject containing the arxaas settings defined by the request payload.- Parameters:
payload- aRequestobject containing the settings to be applied when anonymizing the dataset- Returns:
- an
ARXConfigurationobject containing the settings on how to anonymized the dataset
-
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 List<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.
-
-