inescID.revs.database
Class DB_Counter

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

public class DB_Counter
extends DB_ElectionConfiguration


Field Summary
(package private)  java.sql.PreparedStatement preGetEncryptedVotes
           
(package private)  java.sql.PreparedStatement preGetEncryptedVotesByElection
           
(package private)  java.sql.PreparedStatement preGetVotes
           
(package private)  java.sql.PreparedStatement preGetVotesByElection
           
(package private)  java.sql.PreparedStatement preInsertEncryptedVote
           
(package private)  java.sql.PreparedStatement preUpdateVote
           
 
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_Counter()
           
DB_Counter(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void createTables(java.lang.String error)
           
 java.util.Vector getEncryptedVotes()
           
 java.util.Vector getEncryptedVotesByElection(int election)
           
 java.util.Vector getVotes()
           
 java.util.Vector getVotesByElection(int election, boolean valid)
           
 void insertVote(int election, byte[] encrypted_vote)
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
protected  void prepareUpdate()
           
 void removeTables(java.lang.String error)
           
private  void tableVote()
           
 void updateVote(int id, java.lang.String vote, byte[] random_value, AdministratorSignature[] signatures, boolean valid)
           
 
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, prepareDelete, 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

preInsertEncryptedVote

java.sql.PreparedStatement preInsertEncryptedVote

preUpdateVote

java.sql.PreparedStatement preUpdateVote

preGetVotes

java.sql.PreparedStatement preGetVotes

preGetEncryptedVotes

java.sql.PreparedStatement preGetEncryptedVotes

preGetEncryptedVotesByElection

java.sql.PreparedStatement preGetEncryptedVotesByElection

preGetVotesByElection

java.sql.PreparedStatement preGetVotesByElection
Constructor Detail

DB_Counter

public DB_Counter()
           throws java.sql.SQLException

DB_Counter

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

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

tableVote

private void tableVote()
                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

prepareUpdate

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

updateVote

public void updateVote(int id,
                       java.lang.String vote,
                       byte[] random_value,
                       AdministratorSignature[] signatures,
                       boolean valid)
                throws java.sql.SQLException,
                       java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

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

getVotesByElection

public java.util.Vector getVotesByElection(int election,
                                           boolean valid)
                                    throws java.sql.SQLException,
                                           java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

getEncryptedVotes

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

getEncryptedVotesByElection

public java.util.Vector getEncryptedVotesByElection(int election)
                                             throws java.sql.SQLException,
                                                    java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception