votorola.a.register.trust
Class DoubtSignal.Table

java.lang.Object
  extended by DoubtSignal.Table
Enclosing class:
DoubtSignal

@ThreadSafe
public static final class DoubtSignal.Table
extends Object

A relational store of doubt signals, backing an electoral register's doubt signaling network.


Constructor Summary
DoubtSignal.Table(String registerName, Database database)
          Constructs a Table, physical creating it if it does not already exist.
 
Method Summary
(package private)  Database database()
          Returns the database in which this table is stored.
 DoubtSignal get(String voter0Email, String voter1Email)
          Retrieves a signal from this table.
 List<DoubtSignalNode> getSignalNodesTo(String voter1Email, ListNodeC.Table listNodeTable)
          Retrieves signals that extend to the specified destination voter, together with their source nodes.
 List<DoubtSignal> getSignalsFrom(String voter0Email)
          Retrieves all signals that extend from the specified source voter.
(package private)  void remove(ElectoralSubserver.UserSession voter0Session, String voter1Email)
          Removes a signal from this table, if it is stored there.
 void runFrom(ListNodeC.Table listNodeTable, DoubtSignalNode.Runner runner)
          Passes all signals of this table, and their source nodes, through the specified runner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubtSignal.Table

public DoubtSignal.Table(String registerName,
                         Database database)
                  throws SQLException
Constructs a Table, physical creating it if it does not already exist.

Parameters:
registerName - the name of the register, and of the table's schema (which is assumed to already exist)
database - per database()
Throws:
SQLException
Method Detail

database

Database database()
Returns the database in which this table is stored.


get

public DoubtSignal get(String voter0Email,
                       String voter1Email)
                throws SQLException
Retrieves a signal from this table.

Returns:
signal as stored in the table; or null, if none is stored
Throws:
SQLException

getSignalsFrom

public List<DoubtSignal> getSignalsFrom(String voter0Email)
                                 throws SQLException
Retrieves all signals that extend from the specified source voter. The signals are pre-ordered by voter1Email.

Throws:
SQLException

getSignalNodesTo

public List<DoubtSignalNode> getSignalNodesTo(String voter1Email,
                                              ListNodeC.Table listNodeTable)
                                       throws SQLException
Retrieves signals that extend to the specified destination voter, together with their source nodes. Retrieves all signals, except those sent from list-barred sources.

Throws:
SQLException

remove

void remove(ElectoralSubserver.UserSession voter0Session,
            String voter1Email)
      throws SQLException
Removes a signal from this table, if it is stored there.

Throws:
SQLException

runFrom

public void runFrom(ListNodeC.Table listNodeTable,
                    DoubtSignalNode.Runner runner)
             throws SQLException
Passes all signals of this table, and their source nodes, through the specified runner.

Throws:
SQLException