Votorola

votorola.a
Class Pollserver.ConstructionContext

java.lang.Object
  extended by Pollserver.ConstructionContext
Enclosing class:
Pollserver

@ThreadSafe
public static final class Pollserver.ConstructionContext
extends Object

A context for configuring a pollserver. The pollserver is configured by its startup configuration file, which contains a script (s) for that purpose. During construction of the pollserver, an instance of this context (psCC) is passed to s, via s::contructingPollserver(psCC).


Method Summary
 Pollserver.DatabaseCC geocodeDatabase()
          The context for configuring the database of the pollserver's geocode table.
 int getPollCacheCapacity()
           
 String getServerName()
           
 String getShortTitle()
           
 String getSummaryDescription()
           
 Pollserver.TestUseMode getTestUseMode()
           
 String getTitle()
           
 URI getWikiLocation()
           
 String getWikiPassword()
           
 URI getWikiScriptLocation()
           
 String name()
          The name of the pollserver.
 Pollserver.DatabaseCC outputDatabase()
          The context for configuring the pollserver's output database.
 void setPollCacheCapacity(int _pollCacheCapacity)
          Sets the maximum number of entries in the poll cache.
 void setServerName(String serverName)
          Specifies the fully qualified name of the computer on which this pollserver is hosted.
 void setSummaryDescription(String summaryDescription)
          Sets the summary description of the pollserver.
 void setTestUseMode(Pollserver.TestUseMode testUseMode)
          Sets the test use mode of the pollserver.
 void setTitle(String title, String shortTitle)
          Sets the title of the pollserver.
 void setWikiLocation(String s)
          Sets the base URI for requesting wiki pages.
 void setWikiLocation(URI uri)
          Sets the base URI for requesting wiki pages.
 void setWikiPassword(String p)
          Sets the password for this pollserver's wiki account.
 void setWikiScriptLocation(String s)
          Sets the base URI for requesting wiki scripts.
 void setWikiScriptLocation(URI uri)
          Sets the base URI for requesting wiki scripts.
 Pollserver.DatabaseCC userDatabase()
          The context for configuring the pollserver's user database.
 Pollserver.DatabaseCC voterInputDatabase()
          The context for configuring the pollserver's voter input database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

geocodeDatabase

public Pollserver.DatabaseCC geocodeDatabase()
The context for configuring the database of the pollserver's geocode table. At runtime, a table named "geocode" is created in this database, if it does not already exist.


getPollCacheCapacity

public int getPollCacheCapacity()
See Also:
Poll.PollserverScope.pollCacheCapacity(), setPollCacheCapacity(int)

setPollCacheCapacity

@ThreadRestricted(value="constructor")
public void setPollCacheCapacity(int _pollCacheCapacity)
Sets the maximum number of entries in the poll cache. The default value is 500 polls.

See Also:
Poll.PollserverScope.pollCacheCapacity()

getServerName

public String getServerName()
See Also:
Pollserver.serverName(), setServerName(String)

setServerName

@ThreadRestricted(value="constructor")
public void setServerName(String serverName)
Specifies the fully qualified name of the computer on which this pollserver is hosted. The default value is the system hostname as determined at runtime, or failing that "localhost".

See Also:
Pollserver.serverName()

getShortTitle

public String getShortTitle()
See Also:
Pollserver.shortTitle(), setTitle(String,String)

getSummaryDescription

public String getSummaryDescription()
See Also:
Pollserver.summaryDescription(), setSummaryDescription(String)

setSummaryDescription

@ThreadRestricted(value="constructor")
public void setSummaryDescription(String summaryDescription)
Sets the summary description of the pollserver. The default value is a placeholder with configuration instructions for the administrator.

Throws:
IllegalArgumentException - if the description contains any newline characters, because they might render inconsistently across different types of user interface.
See Also:
Pollserver.summaryDescription()

getTestUseMode

public Pollserver.TestUseMode getTestUseMode()
See Also:
Pollserver.testUseMode(), setTestUseMode(Pollserver.TestUseMode)

setTestUseMode

@ThreadRestricted(value="constructor")
public void setTestUseMode(Pollserver.TestUseMode testUseMode)
Sets the test use mode of the pollserver. The default value is TestUseMode.OFF.

See Also:
Pollserver.testUseMode()

getTitle

public String getTitle()
See Also:
Pollserver.title(), setTitle(String,String)

setTitle

@ThreadRestricted(value="constructor")
public void setTitle(String title,
                                           String shortTitle)
Sets the title of the pollserver. The default value for the long and short titles is "Local region" and "Local".

See Also:
Pollserver.title(), Pollserver.shortTitle()

getWikiLocation

public URI getWikiLocation()
Returns:
base URI for requesting wiki pages, or null for the default.
See Also:
Pollserver.wikiLocation(), setWikiLocation(String), setWikiLocation(URI)

setWikiLocation

@ThreadRestricted(value="constructor")
public void setWikiLocation(String s)
                     throws URISyntaxException
Sets the base URI for requesting wiki pages. The default value is null, which translates at runtime to "http://wikiScriptLocation/index.php".

Throws:
URISyntaxException
See Also:
Pollserver.wikiLocation()

setWikiLocation

@ThreadRestricted(value="constructor")
public void setWikiLocation(URI uri)
Sets the base URI for requesting wiki pages. The default value is null, which translates at runtime to "http://wikiScriptLocation/index.php".

Throws:
IllegalArgumentException - if the URI ends with a slash '/' character.
See Also:
Pollserver.wikiLocation()

getWikiPassword

public String getWikiPassword()
Returns:
the password for this pollserver's wiki account.
See Also:
Pollserver.wikiPassword(), setWikiPassword(String)

setWikiPassword

@ThreadRestricted(value="constructor")
public void setWikiPassword(String p)
Sets the password for this pollserver's wiki account. The default value is "insecure password".

See Also:
Pollserver.wikiPassword()

getWikiScriptLocation

public URI getWikiScriptLocation()
Returns:
base URI for requesting wiki scripts, or null for the default.
See Also:
Pollserver.wikiScriptLocation(), setWikiScriptLocation(String), setWikiScriptLocation(URI)

setWikiScriptLocation

@ThreadRestricted(value="constructor")
public void setWikiScriptLocation(String s)
                           throws URISyntaxException
Sets the base URI for requesting wiki scripts. The default value is null, which translates at runtime to "http://serverName/mediawiki".

Throws:
URISyntaxException
See Also:
Pollserver.wikiScriptLocation()

setWikiScriptLocation

@ThreadRestricted(value="constructor")
public void setWikiScriptLocation(URI uri)
Sets the base URI for requesting wiki scripts. The default value is null, which translates at runtime to "http://serverName/mediawiki".

Throws:
IllegalArgumentException - if the URI ends with a slash '/' character.
See Also:
Pollserver.wikiScriptLocation()

name

public String name()
The name of the pollserver.

See Also:
Pollserver.name()

outputDatabase

public Pollserver.DatabaseCC outputDatabase()
The context for configuring the pollserver's output database. At runtime, backing tables are created in this database, in support of various mounted service facilities, such as poll counts and voter lists.

See Also:
Pollserver.Run.outputDatabase()

userDatabase

public Pollserver.DatabaseCC userDatabase()
The context for configuring the pollserver's user database. At runtime, a table named "user" is created in this database, if it does not already exist.

See Also:
Pollserver.Run.userTable()

voterInputDatabase

public Pollserver.DatabaseCC voterInputDatabase()
The context for configuring the pollserver's voter input database. At runtime, tables such as in_registration and in_vote are created in this database, if they do not already exist.

See Also:
Pollserver.Run.voterInputDatabase()

Votorola