anonymizer
Class Anonymizer

java.lang.Object
  extended by anonymizer.Anonymizer
Direct Known Subclasses:
Anatomy, Datafly, Incognito_K, Incognito_L, Incognito_T, Mondrian

public abstract class Anonymizer
extends java.lang.Object

An abstract class for anonymization methods. Basic functions include reading data from a source and outputtung the results.

Every class that extends Anonymizer should implement methods for (1) creating an equivalence table, (2) creating an anonymized records table, (3) insertion into equivalence table, (3) insertion into anonymized records table and obviously, (5) anonymization.


Field Summary
protected  AnonRecordTable anonTable
          Current working anonRecords table
protected  Configuration conf
          Configuration object
protected  EquivalenceTable eqTable
          Current working equivalence table
protected  SQLWrapper sqlwrapper
          Embedded database connection object
protected  int suppressionThreshold
          Suppression threshold (required only if the method allows suppression)
 
Constructor Summary
Anonymizer(Configuration conf)
          Class constructor
 
Method Summary
abstract  void anonymize()
          Anonymizes the input
static void anonymizeDataset(Configuration conf)
           
static void anonymizeDataset(java.lang.String[] args)
          Anonymize an input based on the specified argument list.
protected abstract  AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
          Creates the anonymized records table
protected abstract  EquivalenceTable createEquivalenceTable(java.lang.String tableName)
          Creates the equivalence table
private  void generateDistributions()
          Generates quasi-identifier distributions for each quasi-identifier
protected abstract  void insertTupleToAnonTable(java.lang.String[] vals, long eid)
          Insert a tuple to the anonRecords table
protected abstract  long insertTupleToEquivalenceTable(java.lang.String[] vals)
          Insert a tuple to the equivalence table
protected  java.util.LinkedList<java.lang.Long> isReadyForSuppression(java.lang.String anonRecordTable)
          Checks if the generalized data is ready for suppression
static void main(java.lang.String[] args)
           
 void outputResults_Anatomy()
          Output the results and close the connection to the database
 void outputResults_GenVals()
          Output the results and close the connection to the database
 void outputResults_GenValsDist()
          Output the results and close the connection to the database
 void outputResults()
          Output the results and close the connection to the database
 void readData()
          Read input data
protected  void suppressEquivalences(java.util.LinkedList<java.lang.Long> suppressionList)
          Suppress the equivalences with provided IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected Configuration conf
Configuration object


eqTable

protected EquivalenceTable eqTable
Current working equivalence table


anonTable

protected AnonRecordTable anonTable
Current working anonRecords table


sqlwrapper

protected SQLWrapper sqlwrapper
Embedded database connection object


suppressionThreshold

protected int suppressionThreshold
Suppression threshold (required only if the method allows suppression)

Constructor Detail

Anonymizer

public Anonymizer(Configuration conf)
Class constructor

Method Detail

createEquivalenceTable

protected abstract EquivalenceTable createEquivalenceTable(java.lang.String tableName)
Creates the equivalence table

Parameters:
tableName - Name of the table
Returns:
The table that was just created

createAnonRecordsTable

protected abstract AnonRecordTable createAnonRecordsTable(java.lang.String tableName)
Creates the anonymized records table

Parameters:
tableName - Name of the table
Returns:
The table that was just created

insertTupleToEquivalenceTable

protected abstract long insertTupleToEquivalenceTable(java.lang.String[] vals)
                                               throws java.lang.Exception
Insert a tuple to the equivalence table

Parameters:
vals - All values of the tuple to be inserted (as read from the source, i.e., before any generalization)
Returns:
Equivalence id of the equivalence to which the tuple belongs
Throws:
java.lang.Exception

insertTupleToAnonTable

protected abstract void insertTupleToAnonTable(java.lang.String[] vals,
                                               long eid)
                                        throws java.lang.Exception
Insert a tuple to the anonRecords table

Parameters:
vals - All values of the tuple to be inserted (as read from the source, i.e., before any generalization)
eid - Equivalence id of the equivalence to which the tuple belongs
Throws:
java.lang.Exception

readData

public void readData()
              throws java.lang.Exception
Read input data

Throws:
java.lang.Exception

anonymize

public abstract void anonymize()
                        throws java.lang.Exception
Anonymizes the input

Throws:
java.lang.Exception

isReadyForSuppression

protected java.util.LinkedList<java.lang.Long> isReadyForSuppression(java.lang.String anonRecordTable)
                                                              throws java.lang.Exception
Checks if the generalized data is ready for suppression

Parameters:
anonRecordTable - Name of the current anonymization record table
Returns:
Empty list if already k-anonymous, List of EIDs of equivalences that should be suppressed if ready for suppression, null otherwise.
Throws:
java.lang.Exception

suppressEquivalences

protected void suppressEquivalences(java.util.LinkedList<java.lang.Long> suppressionList)
Suppress the equivalences with provided IDs.

Parameters:
suppressionList - IDs of equivalences to be suppressed

outputResults

public void outputResults()
                   throws java.lang.Exception
Output the results and close the connection to the database

Throws:
java.lang.Exception

outputResults_GenVals

public void outputResults_GenVals()
                           throws java.lang.Exception
Output the results and close the connection to the database

Throws:
java.lang.Exception

outputResults_GenValsDist

public void outputResults_GenValsDist()
                               throws java.lang.Exception
Output the results and close the connection to the database

Throws:
java.lang.Exception

generateDistributions

private void generateDistributions()
                            throws java.lang.Exception
Generates quasi-identifier distributions for each quasi-identifier

Throws:
java.lang.Exception

outputResults_Anatomy

public void outputResults_Anatomy()
                           throws java.lang.Exception
Output the results and close the connection to the database

Throws:
java.lang.Exception

anonymizeDataset

public static void anonymizeDataset(java.lang.String[] args)
                             throws java.lang.Exception
Anonymize an input based on the specified argument list.

Parameters:
args - list of program arguments.
Throws:
java.lang.Exception

anonymizeDataset

public static void anonymizeDataset(Configuration conf)
                             throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)