votorola.a.register.trust
Class CR_Trust

java.lang.Object
  extended by CommandResponder.Base
      extended by CR_Trust
All Implemented Interfaces:
CommandResponder
Direct Known Subclasses:
CR_Untrust

public class CR_Trust
extends CommandResponder.Base

Responder for the command 'trust' - to extend trust to another voter.

See Also:
http://zelea.com/project/votorola/a/mail/guide.xht#trust

Nested Class Summary
 
Nested classes/interfaces inherited from interface CommandResponder
CommandResponder.AnonymousIssueException, CommandResponder.Base, CommandResponder.Session, CommandResponder.X
 
Field Summary
 
Fields inherited from class CommandResponder.Base
electoralService, keyPrefix
 
Constructor Summary
CR_Trust(Register register)
          Constructs a CR_Trust.
CR_Trust(Register register, String keyPrefix)
          Constructs a CR_Trust as a subclass.
 
Method Summary
protected  void appendTrustList(RegistrationC registration, CommandResponder.Session session)
          Appends a list of trusted voters to the reply.
protected  void commitTrustAndEcho(String destinationEmail, boolean toAdd, RegistrationC registration, CommandResponder.Session session)
          Commits the addition or removal of a trusted voter, and appends an echo of the change to the reply.
static String edgeWarning(Register register, Registration voter0, Registration voter1, BundleFormatter bunA)
          Returns a localized edge extension warning; or null if the edge appears to be extendable.
protected  Register register()
           
 Exception respond(String[] argv, CommandResponder.Session session)
          Responds to an invocation of the command.
 
Methods inherited from class CommandResponder.Base
acceptsAnonymousIssue, canonicalEmail, commandName, compileBaseOptions, help, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CR_Trust

public CR_Trust(Register register)
Constructs a CR_Trust.


CR_Trust

CR_Trust(Register register,
         String keyPrefix)
Constructs a CR_Trust as a subclass.

Method Detail

edgeWarning

@ThreadSafe
public static String edgeWarning(Register register,
                                            Registration voter0,
                                            Registration voter1,
                                            BundleFormatter bunA)
Returns a localized edge extension warning; or null if the edge appears to be extendable. The warning is either a bar prediction, or a message explaining why a bar prediction is not possible.


respond

public Exception respond(String[] argv,
                         CommandResponder.Session session)
Description copied from interface: CommandResponder
Responds to an invocation of the command.

Parameters:
argv - array of command name (index 0) and any arguments (indeces 1..*)
Returns:
any soft exception, of temporary cause (which might clear up on a retry); or null if none occured

appendTrustList

protected void appendTrustList(RegistrationC registration,
                               CommandResponder.Session session)
                        throws IOException,
                               NoSuchMethodException,
                               ScriptException,
                               SQLException
Appends a list of trusted voters to the reply.

Parameters:
session - with wrapping turned off in its reply builder
Throws:
IOException
NoSuchMethodException
ScriptException
SQLException

commitTrustAndEcho

protected void commitTrustAndEcho(String destinationEmail,
                                  boolean toAdd,
                                  RegistrationC registration,
                                  CommandResponder.Session session)
                           throws SQLException,
                                  VoterInputTable.BadInputException
Commits the addition or removal of a trusted voter, and appends an echo of the change to the reply.

Parameters:
toAdd - true to add trust, false to remove it
session - with wrapping turned off in its reply builder
Throws:
SQLException
VoterInputTable.BadInputException

register

protected Register register()