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 (package private) java.lang.StringCOLUMNNAMEstatic charCSV_SEPERATOR_CHAR
-
Constructor Summary
Constructors Constructor Description ARXWrapper()
-
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.criteria.PrivacyCriteriongetPrivacyModel(PrivacyModel model, java.util.Map<java.lang.String,java.lang.String> params)Returns an ArxPrivacyCriterionobject for the desired privacy object selected by the user.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.org.deidentifier.arx.DatasetHierarchies(org.deidentifier.arx.Data data, AnonymizationPayload payload)Returns an ARXDataobject that sets the hierarchies to be used on the different fields in the data set.org.deidentifier.arx.ARXConfigurationsetPrivacyModels(org.deidentifier.arx.ARXConfiguration config, AnonymizationPayload payload)Returns an ARXARXConfigurationobject that sets the privacy models defined by the payload.org.deidentifier.arx.DatasetSensitivityModels(org.deidentifier.arx.Data data, AnalysationPayload analysationPayload)Returns an ARXDataobject that holds the data set along with an assigned attribute type for each table row.org.deidentifier.arx.DatasetSensitivityModels(org.deidentifier.arx.Data data, AnonymizationPayload payload)Returns an ARXDataobject that holds the data set along with an assigned attribute type for each table row.org.deidentifier.arx.ARXConfigurationsetSuppressionLimit(org.deidentifier.arx.ARXConfiguration config)Sets the suppression limit configuration for anonymization in the ARXARXConfigurationobject, then returns it.
-
-
-
Field Detail
-
CSV_SEPERATOR_CHAR
public static final char CSV_SEPERATOR_CHAR
- See Also:
- Constant Field Values
-
COLUMNNAME
final java.lang.String COLUMNNAME
- See Also:
- Constant Field Values
-
-
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
-
setSuppressionLimit
public org.deidentifier.arx.ARXConfiguration setSuppressionLimit(org.deidentifier.arx.ARXConfiguration config)
Sets the suppression limit configuration for anonymization in the ARXARXConfigurationobject, then returns it.- Parameters:
config- an ARXARXConfigurationobject that holds the anonymization/data set settings- Returns:
- an ARX
ARXConfigurationobject with the suppression setting
-
setSensitivityModels
public org.deidentifier.arx.Data setSensitivityModels(org.deidentifier.arx.Data data, AnonymizationPayload payload)Returns an ARXDataobject that holds the data set along with an assigned attribute type for each table row.- Parameters:
data- tabular data set to be anonymizedpayload- map containing parameters that defines the attribute types used on which data set field- Returns:
- an ARX
Datathat contains the data set with assigned field attribute types
-
setSensitivityModels
public org.deidentifier.arx.Data setSensitivityModels(org.deidentifier.arx.Data data, AnalysationPayload analysationPayload)Returns an ARXDataobject that holds the data set along with an assigned attribute type for each table row.- Parameters:
data- tabular data set to be analysied for re-identification riskanalysationPayload- map containing parameters that defines the attribute types used on which data set field- Returns:
- an ARX
Datathat contains the data set with assigned field attribute types
-
setPrivacyModels
public org.deidentifier.arx.ARXConfiguration setPrivacyModels(org.deidentifier.arx.ARXConfiguration config, AnonymizationPayload payload)Returns an ARXARXConfigurationobject that sets the privacy models defined by the payload.- Parameters:
config- an ARXARXConfigurationobject that holds the anonymize/data set settingspayload- map containing parameters that defines the privacy models to be used- Returns:
- an ARX
ARXConfigurationobject with the assigned privacy models settings
-
setHierarchies
public org.deidentifier.arx.Data setHierarchies(org.deidentifier.arx.Data data, AnonymizationPayload payload)Returns an ARXDataobject that sets the hierarchies to be used on the different fields in the data set.- Parameters:
data- tabular data set to be anonymizedpayload- map containing parameters that defines the hierarchies to be used on which data set fields- Returns:
- an ARX
Dataobject with the hierarchies assigned to the data set fields
-
getPrivacyModel
public org.deidentifier.arx.criteria.PrivacyCriterion getPrivacyModel(PrivacyModel model, java.util.Map<java.lang.String,java.lang.String> params)
Returns an ArxPrivacyCriterionobject for the desired privacy object selected by the user.- Parameters:
model- enum representing the privacy model type we want createdparams- map containing parameters that defines which settings to be used to created the privacy model- Returns:
- the
PrivacyCriterionobject created with the specified parameters
-
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
-
-