@ThreadRestricted(value="holds lock()") public final class PollService extends VoterService implements Comparable<PollService>, InputStore, Poll
Modifier and Type | Class and Description |
---|---|
static class |
PollService.ConstructionContext
A context for configuring the construction of a PollService.
|
static class |
PollService.VoteServerScope
API for all polls within the scope of a vote-server.
|
VoterService.IllegalNameException, VoterService.NoSuchServiceException
InputStore.U
Modifier and Type | Field and Description |
---|---|
static Pattern |
POLL_NAME_PATTERN
The allowable pattern of a poll name.
|
constructionContext, lock, name, NAME_MAX_LENGTH, NAME_PATTERN, vsRun
NOT_A_POLL, TEST_POLL_NAME
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PollService p)
Compares based on caseless short name, cased short name, caseless full name, and
finally cased full name.
|
(package private) JavaScriptIncluder |
configurationScript()
The compiled configuration script for the poll.
|
Count |
countToReport()
The current count to report, or null if there is none.
|
Count |
countToReportT()
Siezes the thread-access lock and returns the current count to report, or null if
there is none.
|
Exception |
dispatch(String[] argArray,
CommandResponder.Session commandSession)
Looks up the responder of the specified command, and sends the command
to it.
|
String |
displayTitle()
An informal, descriptive title for the poll in wiki-style title case, or null if
there is none.
|
Set<String> |
divisionalComponents()
The set of divisions whose members are exclusively eligible to vote in this poll.
|
String |
divisionPageName()
The polling division, specified by its pollwiki pagename.
|
String |
divisionSmallMapPageName()
A small map of the polling division, specified by its pollwiki pagename.
|
String |
issueType()
The issue type of the poll, specified by the short name of its page in the
pollwiki, i.e. without the namespace.
|
ActivityEvent |
newChangeEventOrNull(Vote oldVote,
Vote newVote)
Either constructs an event to record the change that occured between oldVote and
newVote; or returns null, if no significant change occured.
|
static StringBuilder |
pollNameToXMLColonName(StringBuilder b)
Converts a poll name to an XML name by replacing all instances of slashes '/' with
colons ':'.
|
long |
populationSize()
The estimated number of eligible voters for this poll.
|
String |
populationSizeExplanation()
An explanation of the population size.
|
String |
shortName()
The short name of this poll, which is the part after the last slash '/' character.
|
File |
startupConfigurationFile()
The startup configuration file for this service.
|
String |
summaryDescription()
A short description that summarizes this service.
|
String |
title()
The title of this service in wiki-style title case.
|
InputTable |
voterInputTable()
The relational store of voter input for this service.
|
String |
wgLogoImageLocation()
The wiki logo (wgLogo) image location for this poll, or null if none is specified.
|
String |
wgLogoLinkTarget()
The wiki logo (wgLogo) link target for this poll.
|
static StringBuilder |
xmlColonNameToPollName(StringBuilder b)
Converts an XML name to a poll name by replacing all instances of colons ':' with
slashes '/'.
|
dispatch, equals, help, helpA_1, helpA_2, helpA_3, helpA, helpB, helpC, init, isNonPoll, lock, name, responderByClassName, responderForCommand, responders, serviceDirectory, toString, vsRun
public static final Pattern POLL_NAME_PATTERN
@Warning(value="thread restricted object") JavaScriptIncluder configurationScript()
public Count countToReport() throws IOException, SQLException
IOException
SQLException
Count.VoteServerScope.readyToReportLink()
@ThreadSafe public Count countToReportT() throws IOException, SQLException
IOException
SQLException
@ThreadSafe public Set<String> divisionalComponents()
PollService.ConstructionContext.addDivisionalComponent(String)
,
zelea.com/w/Property:Division#Divisions@ThreadSafe public String divisionPageName()
PollService.ConstructionContext.setDivisionPageName(String)
,
zelea.com/w/Property:Division@ThreadSafe public String divisionSmallMapPageName()
PollService.ConstructionContext.setDivisionSmallMapPageName(String)
,
zelea.com/w/Property:Small_mappublic ActivityEvent newChangeEventOrNull(Vote oldVote, Vote newVote)
public static StringBuilder pollNameToXMLColonName(StringBuilder b)
xmlColonNameToPollName(StringBuilder)
@ThreadSafe public long populationSize()
PollService.ConstructionContext.setPopulationSize(long)
,
zelea.com/w/Property:Population size@ThreadSafe public String populationSizeExplanation()
@ThreadSafe public final String shortName()
VoterService.name
@ThreadSafe public String wgLogoImageLocation()
@ThreadSafe public String wgLogoLinkTarget()
public static StringBuilder xmlColonNameToPollName(StringBuilder b)
pollNameToXMLColonName(StringBuilder)
@ThreadSafe public int compareTo(PollService p)
compareTo
in interface Comparable<PollService>
VoterService.name()
,
shortName()
@ThreadSafe public InputTable voterInputTable()
InputStore
voterInputTable
in interface InputStore
VoteServer.Run.database()
@ThreadSafe public String displayTitle()
Poll
displayTitle
in interface Poll
PollService.ConstructionContext.setDisplayTitle(String)
@ThreadSafe public String issueType()
Poll
issueType
in interface Poll
PollService.ConstructionContext.setIssueType(String)
public Exception dispatch(String[] argArray, CommandResponder.Session commandSession)
VoterService
dispatch
in class VoterService
argArray
- an array containing the command name and arguments,
per CommandResponder.respond(argv,session).CommandResponder.respond(String[],CommandResponder.Session)
@ThreadSafe public File startupConfigurationFile()
VoterService
startupConfigurationFile
in class VoterService
PollService.VoteServerScope.configurationFile()
@ThreadSafe public String summaryDescription()
VoterService
summaryDescription
in class VoterService
PollService.ConstructionContext.setSummaryDescription(String)
@ThreadSafe public String title()
title
in class VoterService