votorola.a
Class ElectoralSubserver

java.lang.Object
  extended by ElectoralSubserver

@ThreadSafe
public final class ElectoralSubserver
extends Object

An electoral subserver.

See Also:
design.xht#electoral-subserver

Nested Class Summary
static class ElectoralSubserver.ConfigurationContext
          A context for configuring an electoral subserver.
static class ElectoralSubserver.DatabaseCC
          A context for configuring a PostgreSQL database for an electoral subserver.
static class ElectoralSubserver.NoSuchServiceException
          Thrown when an unknown electoral service is requested.
 class ElectoralSubserver.Run
          A run of the electoral subserver.
static interface ElectoralSubserver.UserSession
          A session between a user and a running subserver.
 
Constructor Summary
ElectoralSubserver(String name)
          Constructs an ElectoralSubserver.
 
Method Summary
 File cacheDirectory()
          The directory for storage of files that are generated at runtime, and persisted from run to run.
(package private)  File configurationFile()
          The configuration file for this subserver.
 String domainName()
          The Internet domain name of this electoral subserver.
 String name()
          The name of the user account on the local host, that identifies this subserver.
 String registerName()
          The service name that identifies the electoral register for this subserver.
 File servicesDirectory()
          The directory of electoral services that are automatically launched for each run of the subserver.
 String shortTitle()
          A short version of the title, restricted to roughly SHORT_STRING_LENGTH_MAX characters.
 String summaryDescription()
          A brief description of this electoral subserver, in sentence form.
 String title()
          The title of this subserver, in title case.
 File votorolaDirectory()
          The root directory (/home/subserver-name/votorola) of all subserver configuration files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElectoralSubserver

public ElectoralSubserver(String name)
                   throws ScriptException
Constructs an ElectoralSubserver.

Parameters:
name - per name()
Throws:
ScriptException
Method Detail

cacheDirectory

public File cacheDirectory()
The directory for storage of files that are generated at runtime, and persisted from run to run. The directory is created at runtime if it did not already exist.

See Also:
ElectoralSubserver.ConfigurationContext.setCacheDirectoryPath(String), VApplication.cacheDirectory()

configurationFile

File configurationFile()
The configuration file for this subserver. It is located at:
votorolaDirectory/subserver.js

The language is JavaScript. There are restrictions on the character encoding.


domainName

public String domainName()
The Internet domain name of this electoral subserver.

See Also:
ElectoralSubserver.ConfigurationContext.setDomainName(String)

name

public String name()
The name of the user account on the local host, that identifies this subserver.

See Also:
a/design.xht#electoral-subserver-account

registerName

public String registerName()
The service name that identifies the electoral register for this subserver.

See Also:
ElectoralSubserver.Run.register(), ElectoralSubserver.ConfigurationContext.setRegisterName(String)

servicesDirectory

public File servicesDirectory()
The directory of electoral services that are automatically launched for each run of the subserver. (In future, multiple directories might be configured. But for now, it's just this one.) It is located at:
votorolaDirectory/services


shortTitle

public String shortTitle()
A short version of the title, restricted to roughly SHORT_STRING_LENGTH_MAX characters.

See Also:
title(), ElectoralSubserver.ConfigurationContext.setShortTitle(String)

summaryDescription

public String summaryDescription()
A brief description of this electoral subserver, in sentence form. It is intended for display, for example, as an introductory paragraph.

See Also:
ElectoralSubserver.ConfigurationContext.setSummaryDescription(String)

title

public String title()
The title of this subserver, in title case. Normally it includes the informal name of the subserver's overall district (town or region, for example).

See Also:
shortTitle(), ElectoralSubserver.ConfigurationContext.setTitle(String)

votorolaDirectory

public File votorolaDirectory()
The root directory (/home/subserver-name/votorola) of all subserver configuration files.