inescID.revs.database
Class DB_Administrator

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_Administrator

public class DB_Administrator
extends DB_EC_Voters


Field Summary
(package private)  PasswordGenerator password_generator
           
(package private)  java.sql.PreparedStatement preDeleteVoterElection
           
(package private)  java.sql.PreparedStatement preGetVoterElectionSignature
           
(package private)  java.sql.PreparedStatement preGetVoterPassword
           
(package private)  java.sql.PreparedStatement preInsertVoterElection
           
 
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_Administrator()
           
DB_Administrator(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void alterTableVoter(boolean update, int voter, byte[] password)
           
 void createTables(java.lang.String error)
           
 void deleteVoterElection(int voter)
           
 Election getElection(int id)
           
 byte[] getVoterElectionSignature(int voter, int election)
           
 byte[] getVoterPassword(int voter)
           
 void insertTableVoterElection(int voter, int election, byte[] signature)
           
protected  void prepareDelete()
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
 void removeTables(java.lang.String error)
           
protected  void tableVoterElection()
           
 
Methods inherited from class inescID.revs.database.DB_EC_Voters
addVoters2Group, alterTableVoter, deleteVoter, deleteVoter2GroupByGroup, deleteVoter2GroupByVoter, getElectionsByVoter, getGroupsByVoter, getVoter, getVoters, getVoters2Group, getVotersWithoutPassword, insertTableVoter2Group, prepareUpdate, tableVoter, tableVoter2Group, verifyVoterElection
 
Methods inherited from class inescID.revs.database.DB_ElectionConfiguration
alterTableConfiguration, alterTableElection, countElectionsByConfiguration, deleteConfiguration, deleteElection, getAvailableConfigurationId, getAvailableElectionId, getConfiguration, getConfigurationIdByDescription, getConfigurations, getConfigurationsIdDescription, getElectionIdByDescription, getElections, getElectionsByConfiguration, getElectionsIdDescription, getElectionsIdDescriptionByConfiguration, getLastID, init, prepareCount, 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

preInsertVoterElection

java.sql.PreparedStatement preInsertVoterElection

preGetVoterPassword

java.sql.PreparedStatement preGetVoterPassword

preGetVoterElectionSignature

java.sql.PreparedStatement preGetVoterElectionSignature

preDeleteVoterElection

java.sql.PreparedStatement preDeleteVoterElection

password_generator

PasswordGenerator password_generator
Constructor Detail

DB_Administrator

public DB_Administrator()
                 throws java.sql.SQLException

DB_Administrator

public DB_Administrator(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_EC_Voters

removeTables

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

tableVoterElection

protected void tableVoterElection()
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareInsert

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

alterTableVoter

public void alterTableVoter(boolean update,
                            int voter,
                            byte[] password)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

insertTableVoterElection

public void insertTableVoterElection(int voter,
                                     int election,
                                     byte[] signature)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

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.security.spec.InvalidKeySpecException,
                            java.sql.SQLException
Overrides:
getElection in class DB_ElectionConfiguration
Throws:
java.security.spec.InvalidKeySpecException
java.sql.SQLException

getVoterPassword

public byte[] getVoterPassword(int voter)
                        throws java.sql.SQLException,
                               java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

getVoterElectionSignature

public byte[] getVoterElectionSignature(int voter,
                                        int election)
                                 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_EC_Voters
Throws:
java.sql.SQLException

deleteVoterElection

public void deleteVoterElection(int voter)
                         throws java.sql.SQLException
Throws:
java.sql.SQLException