votorola.a.voter
Interface CommandResponder

All Known Implementing Classes:
CommandResponder.Base, CR_Doubt, CR_Hello, CR_Help, CR_Set, CR_Trust, CR_Undoubt, CR_Unset, CR_Untrust, CR_Unvote, CR_Version, CR_Vote

public interface CommandResponder

A responder to a user command.


Nested Class Summary
static class CommandResponder.AnonymousIssueException
          Thrown when a command cannot be accepted because it was issued anonymously.
static class CommandResponder.Base
          Base implementation of a command responder.
static class CommandResponder.Session
          A user session in a command response inteface.
static class CommandResponder.X
          Command responder utilities.
 
Method Summary
 boolean acceptsAnonymousIssue()
          Returns true if the command may be issued by an anonymous or unauthenticated user; false if an authenticated user email address is required.
 String commandName(CommandResponder.Session session)
          Returns the localized name of the command.
 void help(CommandResponder.Session session)
          Replies with instructions on using the command.
 Exception respond(String[] argv, CommandResponder.Session session)
          Responds to an invocation of the command.
 

Method Detail

acceptsAnonymousIssue

boolean acceptsAnonymousIssue()
Returns true if the command may be issued by an anonymous or unauthenticated user; false if an authenticated user email address is required.


commandName

String commandName(CommandResponder.Session session)
Returns the localized name of the command.


help

void help(CommandResponder.Session session)
Replies with instructions on using the command.


respond

Exception respond(String[] argv,
                  CommandResponder.Session session)
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
Throws:
CommandResponder.AnonymousIssueException - if session is anonymous, but the responder requires a voter email address