|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectElectoralService
@ThreadRestricted(value="holds lock()") public abstract class ElectoralService
A facility for voters to access and maintain a specific class of electoral data on a subserver.
| Field Summary | |
|---|---|
protected Object |
configurationContext
Stored as a convenience for subclass initialization, may be nulled afterwards by subclass. |
protected ReentrantLock |
lock
|
protected String |
name
|
protected String |
serviceEmail
|
protected ElectoralSubserver.Run |
subserverRun
|
| Constructor Summary | |
|---|---|
protected |
ElectoralService(ElectoralSubserver.Run subserverRun,
String name,
Object configurationContext)
Partially creates an ElectoralService. |
| Method Summary | |
|---|---|
abstract File |
configurationFile()
The primary configuration file for this electoral service. |
Exception |
dispatch(String[] argArray,
CommandResponder.Session commandSession)
Looks up the responder of the specified command, and sends the command to it. |
Exception |
dispatch(String[] argArray,
CommandResponder.Session commandSession,
CommandResponder responder)
Sends a command to its responder, if one is specified. |
static void |
ensureSchema(Database database,
String name)
Ensures the database has a schema for the specified electoral service, creating it if necessary. |
boolean |
equals(Object o)
Returns true iff o is an electoral service with the same service email address. |
Exception |
help(String[] argv,
CommandResponder.Session session)
Responds to a help command on behalf of the nominal responder, per respond(argv,session). |
protected void |
helpA(ReplyBuilder replyB,
CommandResponder.Session session)
|
protected void |
helpB(ReplyBuilder replyB,
CommandResponder.Session session)
|
protected void |
helpC(ReplyBuilder replyB,
CommandResponder.Session session)
|
protected void |
init(ArrayList<CommandResponder> responderList)
|
ReentrantLock |
lock()
Returns the thread access lock for this service. |
String |
name()
The name that identifies this service, uniquely among all services on the subserver. |
CommandResponder |
responderByClassName(String className)
Returns the responder of a particular class name, or null if there is none. |
CommandResponder |
responderForCommand(String[] argArray,
CommandResponder.Session commandSession)
Returns the responder for the specified command, or null if there is none. |
CommandResponder[] |
responders()
Returns an array of all responders. |
String |
serviceEmail()
The email address that identifies this service. |
ElectoralSubserver.Run |
subserverRun()
The subserver run, in which this service is provided. |
abstract String |
summaryDescription()
A brief description of this service, in sentence form. |
abstract String |
title()
The title of this service, in title case. |
String |
toString()
Returns the service email address. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final ReentrantLock lock
protected final String name
protected final String serviceEmail
protected final ElectoralSubserver.Run subserverRun
protected Object configurationContext
| Constructor Detail |
|---|
protected ElectoralService(ElectoralSubserver.Run subserverRun,
String name,
Object configurationContext)
configurationContext - per configurationContext| Method Detail |
|---|
@ThreadRestricted(value="constructor") protected final void init(ArrayList<CommandResponder> responderList)
responderList - listing only the service-specific responders
(general responders will be added here)@ThreadSafe public abstract File configurationFile()
votorola-directory/services/service-name/service.js
The language is JavaScript. There are restrictions on the character encoding.
public Exception dispatch(String[] argArray,
CommandResponder.Session commandSession)
argArray - an array containing the command name and arguments,
per CommandResponder.respond(argv,session)
CommandResponder.respond(String[],CommandResponder.Session)
public final Exception dispatch(String[] argArray,
CommandResponder.Session commandSession,
CommandResponder responder)
argArray - an array containing the command name and arguments,
per CommandResponder.respond(argv,session)responder - the responder for the command, or null if there is none
responderForCommand(String[],CommandResponder.Session),
CommandResponder.respond(String[],CommandResponder.Session)
@ThreadSafe
public static void ensureSchema(Database database,
String name)
throws SQLException
SQLException
public Exception help(String[] argv,
CommandResponder.Session session)
public final ReentrantLock lock()
ElectoralSubserver.Run.singleServiceLock()@ThreadSafe public final String name()
The name must not exceed 63 characters in length. This is a PostgreSQL limit. (The next limit would be to 'avoid local parts [of email addresses] longer than 64 characters', per qmail addresses(5).)
The name ought to be unique among all services of the subserver, and all other subservers that share the same server name.
serviceEmail()public final CommandResponder responderByClassName(String className)
public final CommandResponder responderForCommand(String[] argArray,
CommandResponder.Session commandSession)
argArray - array of command name and arguments,
per CommandResponder.respond(argv,session)public final CommandResponder[] responders()
@ThreadSafe public String serviceEmail()
@ThreadSafe public final ElectoralSubserver.Run subserverRun()
public abstract String summaryDescription()
public abstract String title()
@ThreadSafe public final boolean equals(Object o)
equals in class Object@ThreadSafe public final String toString()
toString in class Object
protected final void helpA(ReplyBuilder replyB,
CommandResponder.Session session)
protected final void helpB(ReplyBuilder replyB,
CommandResponder.Session session)
protected final void helpC(ReplyBuilder replyB,
CommandResponder.Session session)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||