inescID.revs.database
Class DB_EC_Voters

java.lang.Object
  extended byinescID.revs.database.CommonDatabase
      extended byinescID.revs.database.DB_ElectionConfiguration
          extended byinescID.revs.database.DB_EC_Voters
Direct Known Subclasses:
DB_Administrator, DB_Commissioner, DB_Distributor

public class DB_EC_Voters
extends DB_ElectionConfiguration


Field Summary
static java.lang.String ALL_VOTERS_GROUP
           
static int ALL_VOTERS_GROUP_ID
           
static java.lang.String EMPTY_VOTERS_GROUP
           
static int EMPTY_VOTERS_GROUP_ID
           
(package private)  java.sql.PreparedStatement preDeleteVoter
           
(package private)  java.sql.PreparedStatement preDeleteVoter2GroupByGroup
           
(package private)  java.sql.PreparedStatement preDeleteVoter2GroupByVoter
           
(package private)  java.sql.PreparedStatement preGetAllVotersID
           
(package private)  java.sql.PreparedStatement preGetElectionsByGroup
           
(package private)  java.sql.PreparedStatement preGetGroupsByVoter
           
(package private)  java.sql.PreparedStatement preGetVoter
           
(package private)  java.sql.PreparedStatement preGetVoters
           
(package private)  java.sql.PreparedStatement preGetVoters2Group
           
(package private)  java.sql.PreparedStatement preGetVotersWithoutPassword
           
(package private)  java.sql.PreparedStatement preInsertVoter
           
(package private)  java.sql.PreparedStatement preInsertVoter2Group
           
(package private)  java.sql.PreparedStatement preUpdateVoter
           
(package private)  java.sql.PreparedStatement 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_EC_Voters()
           
DB_EC_Voters(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void addVoters2Group(Voters2Group group)
           
 void alterTableVoter(boolean update, int id, java.lang.String name)
           
 void createTables(java.lang.String error)
           
 void deleteVoter(int id)
           
 void deleteVoter2GroupByGroup(int id)
           
 void deleteVoter2GroupByVoter(int id)
           
 java.util.Vector getElectionsByVoter(int voter)
           
 java.util.Vector getGroupsByVoter(int id_voter)
           
 IdDescription getVoter(int id)
           
 java.util.Vector getVoters()
           
 Voters2Group getVoters2Group(int id_group)
           
 java.util.Vector getVotersWithoutPassword()
           
 void insertTableVoter2Group(int voter, int group)
           
protected  void prepareDelete()
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
protected  void prepareUpdate()
           
 void removeTables(java.lang.String error)
           
protected  void tableVoter()
           
protected  void tableVoter2Group()
           
 boolean verifyVoterElection(int voter, int election)
           
 
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, 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

EMPTY_VOTERS_GROUP

public static final java.lang.String EMPTY_VOTERS_GROUP
See Also:
Constant Field Values

ALL_VOTERS_GROUP

public static final java.lang.String ALL_VOTERS_GROUP
See Also:
Constant Field Values

EMPTY_VOTERS_GROUP_ID

public static final int EMPTY_VOTERS_GROUP_ID
See Also:
Constant Field Values

ALL_VOTERS_GROUP_ID

public static final int ALL_VOTERS_GROUP_ID
See Also:
Constant Field Values

preInsertVoter

java.sql.PreparedStatement preInsertVoter

preUpdateVoter

java.sql.PreparedStatement preUpdateVoter

preGetVoter

java.sql.PreparedStatement preGetVoter

preGetVoters

java.sql.PreparedStatement preGetVoters

preGetVotersWithoutPassword

java.sql.PreparedStatement preGetVotersWithoutPassword

preDeleteVoter

java.sql.PreparedStatement preDeleteVoter

preInsertVoter2Group

java.sql.PreparedStatement preInsertVoter2Group

preGetVoters2Group

java.sql.PreparedStatement preGetVoters2Group

preGetAllVotersID

java.sql.PreparedStatement preGetAllVotersID

preGetElectionsByGroup

java.sql.PreparedStatement preGetElectionsByGroup

preGetGroupsByVoter

java.sql.PreparedStatement preGetGroupsByVoter

preVerifyVoterElection

java.sql.PreparedStatement preVerifyVoterElection

preDeleteVoter2GroupByVoter

java.sql.PreparedStatement preDeleteVoter2GroupByVoter

preDeleteVoter2GroupByGroup

java.sql.PreparedStatement preDeleteVoter2GroupByGroup
Constructor Detail

DB_EC_Voters

public DB_EC_Voters()
             throws java.sql.SQLException

DB_EC_Voters

public DB_EC_Voters(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

tableVoter

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

tableVoter2Group

protected void tableVoter2Group()
                         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

prepareUpdate

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

alterTableVoter

public void alterTableVoter(boolean update,
                            int id,
                            java.lang.String name)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

addVoters2Group

public void addVoters2Group(Voters2Group group)
                     throws java.sql.SQLException
Throws:
java.sql.SQLException

insertTableVoter2Group

public void insertTableVoter2Group(int voter,
                                   int group)
                            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

getElectionsByVoter

public java.util.Vector getElectionsByVoter(int voter)
                                     throws java.security.spec.InvalidKeySpecException,
                                            java.sql.SQLException
Throws:
java.security.spec.InvalidKeySpecException
java.sql.SQLException

verifyVoterElection

public boolean verifyVoterElection(int voter,
                                   int election)
                            throws java.sql.SQLException,
                                   java.lang.Exception
Throws:
java.sql.SQLException
java.lang.Exception

getVoter

public IdDescription getVoter(int id)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

getVoters

public java.util.Vector getVoters()
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getVotersWithoutPassword

public java.util.Vector getVotersWithoutPassword()
                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getGroupsByVoter

public java.util.Vector getGroupsByVoter(int id_voter)
                                  throws java.sql.SQLException
Throws:
java.sql.SQLException

getVoters2Group

public Voters2Group getVoters2Group(int id_group)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareDelete

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

deleteVoter

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

deleteVoter2GroupByVoter

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

deleteVoter2GroupByGroup

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