inescID.revs.database
Class DB_Distributor

java.lang.Object
  extended byinescID.revs.database.CommonDatabase
      extended byinescID.revs.database.DB_ElectionConfiguration
          extended byinescID.revs.database.DB_EC_Voters
              extended byinescID.revs.database.DB_Distributor

public class DB_Distributor
extends DB_EC_Voters


Field Summary
(package private)  EncryptionTool encrypt
           
(package private)  java.sql.PreparedStatement preGetElectionBallot
           
(package private)  java.sql.PreparedStatement preUpdateElectionBallot
           
 
Fields inherited from class inescID.revs.database.DB_EC_Voters
ALL_VOTERS_GROUP, ALL_VOTERS_GROUP_ID, EMPTY_VOTERS_GROUP, EMPTY_VOTERS_GROUP_ID, preDeleteVoter, preDeleteVoter2GroupByGroup, preDeleteVoter2GroupByVoter, preGetAllVotersID, preGetElectionsByGroup, preGetGroupsByVoter, preGetVoter, preGetVoters, preGetVoters2Group, preGetVotersWithoutPassword, preInsertVoter, preInsertVoter2Group, preUpdateVoter, preVerifyVoterElection
 
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_Distributor()
           
DB_Distributor(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void alterTableElection(boolean update, Election election)
           
 Election getElection(int id)
           
 java.security.SignedObject getElectionBallot(int election)
           
 java.util.Vector getElections()
           
 java.util.Vector getElectionsByConfiguration(int configuration)
           
 java.util.Vector getElectionsByVoter(int voter)
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
protected  void prepareUpdate()
           
protected  void tableElection()
           
 void updateElectionBallot(int election, java.security.SignedObject ballot)
           
 
Methods inherited from class inescID.revs.database.DB_EC_Voters
addVoters2Group, alterTableVoter, createTables, deleteVoter, deleteVoter2GroupByGroup, deleteVoter2GroupByVoter, getGroupsByVoter, getVoter, getVoters, getVoters2Group, getVotersWithoutPassword, insertTableVoter2Group, prepareDelete, removeTables, tableVoter, tableVoter2Group, verifyVoterElection
 
Methods inherited from class inescID.revs.database.DB_ElectionConfiguration
alterTableConfiguration, countElectionsByConfiguration, deleteConfiguration, deleteElection, getAvailableConfigurationId, getAvailableElectionId, getConfiguration, getConfigurationIdByDescription, getConfigurations, getConfigurationsIdDescription, getElectionIdByDescription, getElectionsIdDescription, getElectionsIdDescriptionByConfiguration, getLastID, init, prepareCount, tableConfiguration, 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

preUpdateElectionBallot

java.sql.PreparedStatement preUpdateElectionBallot

preGetElectionBallot

java.sql.PreparedStatement preGetElectionBallot

encrypt

EncryptionTool encrypt
Constructor Detail

DB_Distributor

public DB_Distributor()
               throws java.sql.SQLException

DB_Distributor

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

tableElection

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

prepareInsert

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

prepareUpdate

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

alterTableElection

public void alterTableElection(boolean update,
                               Election election)
                        throws java.sql.SQLException
Overrides:
alterTableElection in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

updateElectionBallot

public void updateElectionBallot(int election,
                                 java.security.SignedObject ballot)
                          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_EC_Voters
Throws:
java.sql.SQLException

getElection

public Election getElection(int id)
                     throws java.sql.SQLException
Overrides:
getElection in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

getElectionsByConfiguration

public java.util.Vector getElectionsByConfiguration(int configuration)
                                             throws java.sql.SQLException
Overrides:
getElectionsByConfiguration in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

getElections

public java.util.Vector getElections()
                              throws java.sql.SQLException
Overrides:
getElections in class DB_ElectionConfiguration
Throws:
java.sql.SQLException

getElectionBallot

public java.security.SignedObject getElectionBallot(int election)
                                             throws java.sql.SQLException,
                                                    java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

getElectionsByVoter

public java.util.Vector getElectionsByVoter(int voter)
                                     throws java.sql.SQLException
Overrides:
getElectionsByVoter in class DB_EC_Voters
Throws:
java.sql.SQLException