inescID.revs.database
Class DB_Anonymizer

java.lang.Object
  extended byinescID.revs.database.CommonDatabase
      extended byinescID.revs.database.DB_ElectionConfiguration
          extended byinescID.revs.database.DB_Anonymizer

public class DB_Anonymizer
extends DB_ElectionConfiguration


Field Summary
(package private)  java.sql.PreparedStatement mainInsertEncryptedVote
           
protected  boolean mainVoteTable
           
(package private)  java.sql.PreparedStatement preDeleteVote
           
(package private)  java.sql.PreparedStatement preDeleteVote1
           
(package private)  java.sql.PreparedStatement preDeleteVote2
           
(package private)  java.sql.PreparedStatement preGetVotes1
           
(package private)  java.sql.PreparedStatement preGetVotes2
           
(package private)  java.sql.PreparedStatement preInsertEncryptedVote1
           
(package private)  java.sql.PreparedStatement preInsertEncryptedVote2
           
(package private)  java.sql.PreparedStatement secondaryGetVotes
           
 
Fields inherited from class inescID.revs.database.DB_ElectionConfiguration
preCountElectionsByConfiguration, preDeleteConfiguration, preDeleteElection, preGetConfiguration, preGetConfigurationIdByDescription, preGetConfigurations, preGetConfigurationsIdDescription, preGetElection, preGetElectionIdByDescription, preGetElections, preGetElectionsByConfiguration, preGetElectionsIdDescription, preGetElectionsIdDescriptionByConfiguration, preGetLastId, preInsertConfiguration, preInsertElection, preUpdateConfiguration, preUpdateElection, preUpdateElectionKey
 
Fields inherited from class inescID.revs.database.CommonDatabase
clock, con, driver, password, preInsereControlo, preURL, url, user
 
Constructor Summary
DB_Anonymizer()
           
DB_Anonymizer(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void changeVoteTables()
           
 void createTables(java.lang.String error)
           
 void deleteVote(int id)
           
 java.util.Vector getVotes()
           
 void insertVote(int election, byte[] encrypted_vote)
           
protected  void prepareDelete()
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
 void removeTables(java.lang.String error)
           
protected  void setMainVoteTable()
           
protected  void setSecondaryVoteTable()
           
private  void tableVote1()
           
private  void tableVote2()
           
 
Methods inherited from class inescID.revs.database.DB_ElectionConfiguration
alterTableConfiguration, alterTableElection, countElectionsByConfiguration, deleteConfiguration, deleteElection, getAvailableConfigurationId, getAvailableElectionId, getConfiguration, getConfigurationIdByDescription, getConfigurations, getConfigurationsIdDescription, getElection, getElectionIdByDescription, getElections, getElectionsByConfiguration, getElectionsIdDescription, getElectionsIdDescriptionByConfiguration, getLastID, init, prepareCount, prepareUpdate, tableConfiguration, tableElection, updateElectionKey, verifyElectionPeriod
 
Methods inherited from class inescID.revs.database.CommonDatabase
connectDB, createPingTable, createTables, DBInit, finalize, redoTables, removeTables, verify
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preInsertEncryptedVote1

java.sql.PreparedStatement preInsertEncryptedVote1

preInsertEncryptedVote2

java.sql.PreparedStatement preInsertEncryptedVote2

mainInsertEncryptedVote

java.sql.PreparedStatement mainInsertEncryptedVote

preDeleteVote

java.sql.PreparedStatement preDeleteVote

preDeleteVote1

java.sql.PreparedStatement preDeleteVote1

preDeleteVote2

java.sql.PreparedStatement preDeleteVote2

preGetVotes1

java.sql.PreparedStatement preGetVotes1

preGetVotes2

java.sql.PreparedStatement preGetVotes2

secondaryGetVotes

java.sql.PreparedStatement secondaryGetVotes

mainVoteTable

protected boolean mainVoteTable
Constructor Detail

DB_Anonymizer

public DB_Anonymizer()
              throws java.sql.SQLException

DB_Anonymizer

public DB_Anonymizer(java.lang.String db,
                     java.lang.String user,
                     java.lang.String password)
              throws java.lang.ClassNotFoundException,
                     java.sql.SQLException,
                     java.security.NoSuchAlgorithmException
Method Detail

changeVoteTables

public void changeVoteTables()

setMainVoteTable

protected void setMainVoteTable()

setSecondaryVoteTable

protected void setSecondaryVoteTable()

createTables

public void createTables(java.lang.String error)
Overrides:
createTables in class DB_ElectionConfiguration

removeTables

public void removeTables(java.lang.String error)
Overrides:
removeTables in class DB_ElectionConfiguration

tableVote1

private void tableVote1()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

tableVote2

private void tableVote2()
                 throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareInsert

protected void prepareInsert()
                      throws java.sql.SQLException
Overrides:
prepareInsert in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

insertVote

public void insertVote(int election,
                       byte[] encrypted_vote)
                throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareGet

protected void prepareGet()
                   throws java.sql.SQLException
Overrides:
prepareGet in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

getVotes

public java.util.Vector getVotes()
                          throws java.sql.SQLException,
                                 java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

prepareDelete

protected void prepareDelete()
                      throws java.sql.SQLException
Overrides:
prepareDelete in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

deleteVote

public void deleteVote(int id)
                throws java.sql.SQLException
Throws:
java.sql.SQLException