inescID.revs.database
Class DB_ElectionConfiguration

java.lang.Object
  extended byinescID.revs.database.CommonDatabase
      extended byinescID.revs.database.DB_ElectionConfiguration
Direct Known Subclasses:
DB_Anonymizer, DB_Counter, DB_EC_Voters

public class DB_ElectionConfiguration
extends CommonDatabase


Field Summary
(package private)  java.sql.PreparedStatement preCountElectionsByConfiguration
           
(package private)  java.sql.PreparedStatement preDeleteConfiguration
           
(package private)  java.sql.PreparedStatement preDeleteElection
           
(package private)  java.sql.PreparedStatement preGetConfiguration
           
(package private)  java.sql.PreparedStatement preGetConfigurationIdByDescription
           
(package private)  java.sql.PreparedStatement preGetConfigurations
           
(package private)  java.sql.PreparedStatement preGetConfigurationsIdDescription
           
(package private)  java.sql.PreparedStatement preGetElection
           
(package private)  java.sql.PreparedStatement preGetElectionIdByDescription
           
(package private)  java.sql.PreparedStatement preGetElections
           
(package private)  java.sql.PreparedStatement preGetElectionsByConfiguration
           
(package private)  java.sql.PreparedStatement preGetElectionsIdDescription
           
(package private)  java.sql.PreparedStatement preGetElectionsIdDescriptionByConfiguration
           
(package private)  java.sql.PreparedStatement preGetLastId
           
(package private)  java.sql.PreparedStatement preInsertConfiguration
           
(package private)  java.sql.PreparedStatement preInsertElection
           
(package private)  java.sql.PreparedStatement preUpdateConfiguration
           
(package private)  java.sql.PreparedStatement preUpdateElection
           
(package private)  java.sql.PreparedStatement preUpdateElectionKey
           
 
Fields inherited from class inescID.revs.database.CommonDatabase
clock, con, driver, password, preInsereControlo, preURL, url, user
 
Constructor Summary
DB_ElectionConfiguration()
           
DB_ElectionConfiguration(java.lang.String db, java.lang.String user, java.lang.String password)
           
 
Method Summary
 void alterTableConfiguration(boolean update, Configuration configuration)
           
 void alterTableElection(boolean update, Election election)
           
 int countElectionsByConfiguration(int id)
           
 void createTables(java.lang.String error)
           
 int deleteConfiguration(int id)
           
 void deleteElection(int id)
           
 int getAvailableConfigurationId()
           
 int getAvailableElectionId()
           
 Configuration getConfiguration(int id)
           
 int getConfigurationIdByDescription(java.lang.String description)
           
 java.util.Vector getConfigurations()
           
 java.util.Vector getConfigurationsIdDescription()
           
 Election getElection(int id)
           
 int getElectionIdByDescription(java.lang.String description)
           
 java.util.Vector getElections()
           
 java.util.Vector getElectionsByConfiguration(int configuration)
           
 java.util.Vector getElectionsIdDescription()
           
 java.util.Vector getElectionsIdDescriptionByConfiguration(int configuration)
           
 int getLastID()
           
 void init()
           
(package private)  void prepareCount()
           
protected  void prepareDelete()
           
protected  void prepareGet()
           
protected  void prepareInsert()
           
protected  void prepareUpdate()
           
 void removeTables(java.lang.String error)
           
protected  void tableConfiguration()
           
protected  void tableElection()
           
 void updateElectionKey(int election, java.security.Key key)
           
 boolean verifyElectionPeriod(int election)
           
 
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

preInsertElection

java.sql.PreparedStatement preInsertElection

preInsertConfiguration

java.sql.PreparedStatement preInsertConfiguration

preUpdateElection

java.sql.PreparedStatement preUpdateElection

preUpdateElectionKey

java.sql.PreparedStatement preUpdateElectionKey

preUpdateConfiguration

java.sql.PreparedStatement preUpdateConfiguration

preGetElectionsIdDescription

java.sql.PreparedStatement preGetElectionsIdDescription

preGetElection

java.sql.PreparedStatement preGetElection

preGetElectionIdByDescription

java.sql.PreparedStatement preGetElectionIdByDescription

preGetElections

java.sql.PreparedStatement preGetElections

preGetElectionsByConfiguration

java.sql.PreparedStatement preGetElectionsByConfiguration

preGetElectionsIdDescriptionByConfiguration

java.sql.PreparedStatement preGetElectionsIdDescriptionByConfiguration

preGetConfigurationsIdDescription

java.sql.PreparedStatement preGetConfigurationsIdDescription

preGetConfiguration

java.sql.PreparedStatement preGetConfiguration

preGetConfigurationIdByDescription

java.sql.PreparedStatement preGetConfigurationIdByDescription

preGetConfigurations

java.sql.PreparedStatement preGetConfigurations

preDeleteElection

java.sql.PreparedStatement preDeleteElection

preDeleteConfiguration

java.sql.PreparedStatement preDeleteConfiguration

preGetLastId

java.sql.PreparedStatement preGetLastId

preCountElectionsByConfiguration

java.sql.PreparedStatement preCountElectionsByConfiguration
Constructor Detail

DB_ElectionConfiguration

public DB_ElectionConfiguration()
                         throws java.sql.SQLException

DB_ElectionConfiguration

public DB_ElectionConfiguration(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 CommonDatabase

removeTables

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

tableElection

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

tableConfiguration

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

prepareInsert

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

prepareUpdate

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

alterTableElection

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

updateElectionKey

public void updateElectionKey(int election,
                              java.security.Key key)
                       throws java.sql.SQLException
Throws:
java.sql.SQLException

alterTableConfiguration

public void alterTableConfiguration(boolean update,
                                    Configuration configuration)
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareGet

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

getLastID

public int getLastID()
              throws java.sql.SQLException
Throws:
java.sql.SQLException

getElectionIdByDescription

public int getElectionIdByDescription(java.lang.String description)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

getAvailableElectionId

public int getAvailableElectionId()
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

getAvailableConfigurationId

public int getAvailableConfigurationId()
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

getConfigurationIdByDescription

public int getConfigurationIdByDescription(java.lang.String description)
                                    throws java.sql.SQLException
Throws:
java.sql.SQLException

getElectionsIdDescription

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

getElectionsIdDescriptionByConfiguration

public java.util.Vector getElectionsIdDescriptionByConfiguration(int configuration)
                                                          throws java.sql.SQLException
Throws:
java.sql.SQLException

getElection

public Election getElection(int id)
                     throws java.security.spec.InvalidKeySpecException,
                            java.sql.SQLException
Throws:
java.security.spec.InvalidKeySpecException
java.sql.SQLException

getElectionsByConfiguration

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

getElections

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

getConfigurationsIdDescription

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

getConfigurations

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

getConfiguration

public Configuration getConfiguration(int id)
                               throws java.sql.SQLException
Throws:
java.sql.SQLException

prepareDelete

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

deleteElection

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

deleteConfiguration

public int deleteConfiguration(int id)
                        throws java.lang.Exception
Throws:
java.lang.Exception

prepareCount

void prepareCount()
            throws java.sql.SQLException
Throws:
java.sql.SQLException

countElectionsByConfiguration

public int countElectionsByConfiguration(int id)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

verifyElectionPeriod

public boolean verifyElectionPeriod(int election)
                             throws java.sql.SQLException,
                                    java.security.spec.InvalidKeySpecException
Throws:
java.sql.SQLException
java.security.spec.InvalidKeySpecException

init

public void init()
          throws java.security.NoSuchAlgorithmException,
                 java.sql.SQLException
Throws:
java.security.NoSuchAlgorithmException
java.sql.SQLException