Package no.oslomet.aaas.utils
Class ARXWrapper
- java.lang.Object
-
- no.oslomet.aaas.utils.ARXWrapper
-
@Component public class ARXWrapper extends java.lang.ObjectDelivers an interface for reaching the underlying arx functionality of
-
-
Field Summary
Fields Modifier and Type Field Description private ARXConfigurationSetterarxConfigurationSetterprivate ARXModelSetterarxModelSetterprivate static charCSV_SEPERATOR_CHAR
-
Constructor Summary
Constructors Constructor Description ARXWrapper(ARXConfigurationSetter arxConfigurationSetter, ARXModelSetter arxModelSetter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.deidentifier.arx.ARXResultanonymize(org.deidentifier.arx.ARXAnonymizer anonymizer, org.deidentifier.arx.ARXConfiguration config, AnonymizationPayload payload)Returns an ARXARXResultobject that holds the anonymized data set.java.lang.StringgetAnonymizeData(org.deidentifier.arx.ARXResult result)Returns a String that contains the anonymized data.org.deidentifier.arx.ARXAnonymizersetAnonymizer(org.deidentifier.arx.ARXAnonymizer anonymizer)Returns an ARXARXAnonymizerobjects that sets the settings for anonymizing the data set.org.deidentifier.arx.DatasetData(java.lang.String rawdata)Returns an ARXDataobject created from the provided String.
-
-
-
Field Detail
-
arxConfigurationSetter
private ARXConfigurationSetter arxConfigurationSetter
-
arxModelSetter
private ARXModelSetter arxModelSetter
-
CSV_SEPERATOR_CHAR
private static final char CSV_SEPERATOR_CHAR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ARXWrapper
@Autowired public ARXWrapper(ARXConfigurationSetter arxConfigurationSetter, ARXModelSetter arxModelSetter)
-
-
Method Detail
-
setData
public org.deidentifier.arx.Data setData(java.lang.String rawdata)
Returns an ARXDataobject created from the provided String. The object is a table of records/fields made from the provided string.- Parameters:
rawdata- String containing tabular data set- Returns:
- the
Dataobject created with the records/fields defined by the string of raw data
-
setAnonymizer
public org.deidentifier.arx.ARXAnonymizer setAnonymizer(org.deidentifier.arx.ARXAnonymizer anonymizer)
Returns an ARXARXAnonymizerobjects that sets the settings for anonymizing the data set.- Parameters:
anonymizer- an ARXARXAnonymizerobject that will hold the anonymization settings- Returns:
- an ARX
ARXAnonymizerobject that holds the anonymization settings
-
anonymize
public org.deidentifier.arx.ARXResult anonymize(org.deidentifier.arx.ARXAnonymizer anonymizer, org.deidentifier.arx.ARXConfiguration config, AnonymizationPayload payload) throws java.io.IOExceptionReturns an ARXARXResultobject that holds the anonymized data set. This method uses the payload parameter to create the ARXDataobject, and sets the attribute types for each field in the data set. The method will then use that ARXDataobject along with the defined settings, taken from the ARXARXAnonymizerandARXConfigurationobjects to create the anonymized data set.- Parameters:
anonymizer- an ARXARXAnonymizerobject that will hold the anonymization settingsconfig- an ARXARXConfigurationobject that will hold the anonymize/data set settingspayload- map containing parameters that sets the records/fields for the data set and the parameters used to anonymize and analyse the data set- Returns:
- an ARX
ARXResultobject that holds the anonymized data set - Throws:
java.io.IOException- that shows the error message when anonymizing the data set fails
-
getAnonymizeData
public java.lang.String getAnonymizeData(org.deidentifier.arx.ARXResult result) throws java.io.IOExceptionReturns 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.
- Throws:
java.io.IOException- shows the error message when saving the data set to aByteArrayInputStreamobject fails
-
-