dk.netarkivet.common.utils
Class Settings

java.lang.Object
  extended by dk.netarkivet.common.utils.Settings

public class Settings
extends java.lang.Object

Provides access to general application settings. The settings are retrieved from an settings.xml file.


Field Summary
static java.lang.String APPLICATIONNAME
          The name of the application, fx.
static java.lang.String ARC_REPOSITORY_CLIENT
          The class that implements the ArcRepositoryClient.
static java.lang.String ARCREPOSITORY_GET_TIMEOUT
          How many milliseconds we will wait before giving up on a lookup request to the Arcrepository
static java.lang.String ARCREPOSITORY_STORE_RETRIES
          Number of times to try sending a store message before failing, including the first attempt.
static java.lang.String ARCREPOSITORY_STORE_TIMEOUT
          Timeout in milliseconds before retrying when calling ArcRepositoryClient.store()
static java.lang.String BITARCHIVE_ACCEPTABLE_HEARTBEAT_DELAY
          If we haven't heard from a bit archive within this many milliseconds, we don't excpect it to be online and won't wait for them to reply on a batch job.
static java.lang.String BITARCHIVE_BATCH_JOB_TIMEOUT
          The BitarchiveMonitorServer will listen for BatchEndedMessages for this many milliseconds before it decides that a batch job is taking too long and returns just the replies it has received at that point.
static java.lang.String BITARCHIVE_HEARTBEAT_FREQUENCY
          The frequency in milliseconds of heartbeats that are sent by each BitarchiveServer to the BitarchiveMonitor.
static java.lang.String BITARCHIVE_LIMIT_FOR_RECORD_DATATRANSFER_IN_FILE
          When the length record exceeds this number, the contents of the record will be transferred using a RemoteFile.
static java.lang.String BITARCHIVE_MIN_SPACE_LEFT
          The minimum amount of bytes left *in any dir* that we will allow a bitarchive machine to accept uploads with.
static java.lang.String BITARCHIVE_SERVER_FILEDIR
          These are the directories where ARC files are stored (in a subdir).
static java.lang.String CACHE_DIR
          The name of the directory where cache data global to the entire machine can be stored.
static java.lang.String CRAWLER_TIMEOUT_NON_RESPONDING
          The timeout value (in seconds) used in HeritrixLauncher for aborting crawl.
static java.lang.String DB_BACKUP_INIT_HOUR
          The earliest time of day backup will be initiated, 0..24 hours.
static java.lang.String DB_SPECIFICS_CLASS
          The class that defines DB-specific methods
static java.lang.String DB_URL
          URL to use to connect to the database.
(package private) static java.lang.String DEFAULT_FILEPATH
          The default place where the settings file can be found.
static java.lang.String DEFAULT_SEEDLIST
          Default seed list to use when new domains are created.
static java.lang.String DIR_ARCREPOSITORY_BITPRESERVATION
          Absolute or relative path to dir containing results of file-list-batch-jobs and checksumming batch jobs for bit preservation
static java.lang.String DIR_COMMONTEMPDIR
          Common temporary directory for all applications.
static java.lang.String DIRS_ARCREPOSITORY_ADMIN
          Absolute/relative path to where the "central list of files and checksums" (admin.data) is written.
static java.lang.String DOMAIN_CONFIG_MAXRATE
          Default download rate for domain configuration.
static java.lang.String DOMAIN_DEFAULT_CONFIG
          The name of a configuration that is created by default and which is initially used for snapshot harvests.
static java.lang.String DOMAIN_DEFAULT_ORDERXML
          Name of order xml template used for domains if nothing else is specified (e.g.
static java.lang.String ENVIRONMENT_BATCH_LOCATION
          Default bit archive to use for batch jobs (if none is specified)
static java.lang.String ENVIRONMENT_LOCATION_NAMES
          The names of all institutional bit archive locations in the environment, e.g., "KB" and "SB".
static java.lang.String ENVIRONMENT_NAME
          The name of the environment in which this code is running, e.g.
static java.lang.String ENVIRONMENT_THIS_CREDENTIALS
          Credentials to enter in the GUI for "deleting" ARC files in this bit archive.
static java.lang.String ENVIRONMENT_THIS_LOCATION
          For archiving applications, which bit archive are you part of?
static java.lang.String ERRORFACTOR_PERMITTED_BESTGUESS
          Used when calculating expected size of a harvest of some configuration during job-creation process.
static java.lang.String ERRORFACTOR_PERMITTED_PREVRESULT
          Used when calculating expected size of a harvest of some configuration during job-creation process.
static java.lang.String EXPECTED_AVERAGE_BYTES_PER_OBJECT
          How many bytes the average object is expected to be on domains where we don't know any better.
static java.lang.String FTP_COPYTO_RETRIES
          The number of times FTPRemoteFile should try before giving up a copyTo operation.
static java.lang.String FTP_SERVER_NAME
          The default FTP-server used.
static java.lang.String FTP_SERVER_PORT
          The default FTP-server port used.
static java.lang.String FTP_USER_NAME
          The default FTP username.
static java.lang.String FTP_USER_PASSWORD
          The default FTP password.
static java.lang.String HARVEST_CONTROLLER_ISRUNNING_FILE
          The file used to signal that the harvest controller is running.
static java.lang.String HARVEST_CONTROLLER_OLDJOBSDIR
          The directory in which data from old jobs is kept after uploading.
static java.lang.String HARVEST_CONTROLLER_PRIORITY
          Pool to take jobs from
static java.lang.String HARVEST_CONTROLLER_SERVERDIR
          Each job gets a subdir of this dir.
static java.lang.String HTTP_PORT_NUMBER
          The *unique* (per host) port number that may or may not be used to serve http, but is frequently used to identify the process.
static java.lang.String HTTPREMOTEFILE_PORT_NUMBER
          HTTP remotefile port number.
static java.lang.String INACTIVITY_TIMEOUT_IN_SECS
          The timeout setting for aborting a crawl based on crawler-inactivity.
static java.lang.String INDEXREQUEST_TIMEOUT
          The amount of time, in milliseconds, we should wait for replies when issuing a call to generate an index over som jobs.
static java.lang.String INDEXSERVER_CLIENT
          The class instantiated to give access to indices.
static java.lang.String JMS_BROKER_HOST
          The JMS broker host contacted by the JMS connection.
static java.lang.String JMS_BROKER_PORT
          The port the JMS connection should use.
static java.lang.String JMS_BROKER_VENDOR
          Selects the broker vendor to be used.
static java.lang.String JMX_HOST_NAME
          The name of a JMX host.
static java.lang.String JMX_HOST_PORT
          The port of a JMX host.
static java.lang.String JMX_HOSTS_NUMBER_SETTING
          The number of different hosts where MBeanservers reside.
static java.lang.String JMX_MONITOR_ROLE_PASSWORD_SETTING
          The password needed to connect as 'monitorRole' to the MBeanservers.
static java.lang.String JMX_PASSWORD_FILE
          Which file to look for JMX passwords in.
static java.lang.String JMX_PORT
          Which port to use for JMX.
static java.lang.String JMX_RMI_PORT
          Which port to use for JMX's RMI communication.
static java.lang.String JOBS_MAX_RELATIVE_SIZE_DIFFERENCE
          The maximum allowed relative difference in expected number of objects retrieved in a single job definition.
static java.lang.String JOBS_MAX_TOTAL_JOBSIZE
          When this limit is exceeded no more configurations may be added to a job.
static java.lang.String JOBS_MIN_ABSOLUTE_SIZE_DIFFERENCE
          Size differences for jobs below this threshold are ignored, regardless of the limits for the relative size difference.
static java.lang.String LANGUAGE_LOCALE
          A locale the website is available as.
static java.lang.String LANGUAGE_NAME
          The native name of the language for the website locale.
static java.lang.String LOGGING_HISTORY_SIZE
           
static java.lang.String MAIL_RECEIVER
          The receiver of email notifications.
static java.lang.String MAIL_SENDER
          The sender of email notifications.
static java.lang.String MAIL_SERVER
          The mail server to use when sending mails.
static java.lang.String MAX_CONFIGS_PER_JOB_CREATION
          How many domain configurations we will process in one go before making jobs out of them.
static java.lang.String MAX_DOMAIN_SIZE
          Initial guess of #objects in an unknown domain
static java.lang.String NOTIFICATIONS_CLASS
          The implementation class for notifications.
static java.lang.String REMOTE_FILE_CLASS
          The class to use for RemoteFile objects.
static java.lang.String SETTINGS_FILE_NAME_PROPERTY
          The property name specifying the file name of the settings file.
static java.lang.String SITESECTION_CLASS
          The subclass of SiteSection that defines a part of the web interface.
static java.lang.String SITESECTION_DEPLOYPATH
          The URL path for this site section.
static java.lang.String SITESECTION_WEBAPPLICATION
          The directory or war-file containing the web application for a site section.
static java.lang.String VALID_DOMAIN_REGEX
          This setting describes a regular expression used to validate domains against.
static java.lang.String VIEWERPROXY_DIR
          The main directory for the ViewerProxy, used for storing the Lucene index for the jobs being viewed.
static java.lang.String VIEWERPROXY_HOSTNAME
          The name of the server used for viewerproxy links in the GUI.
 
Method Summary
static void create(java.lang.String key, java.lang.String value)
          Create a new setting.
static java.lang.String get(java.lang.String key)
          Gets a setting.
static java.lang.String[] getAll(java.lang.String key)
          Gets a list of settings.
static int getInt(java.lang.String key)
          Gets a setting as an int.
static long getLong(java.lang.String key)
          Gets a setting as a long.
static java.lang.String getSettingsFilePath()
           
static void reload()
          Reloads the settings.
static void set(java.lang.String key, java.lang.String... values)
          Sets the key to one or more values.
static void validateStrings()
          Validate that the strings defined in this class are present in the settings.xml file.
static void validateWithXSD()
          Validate that the settings.xml file conforms to the XSD.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SETTINGS_FILE_NAME_PROPERTY

public static final java.lang.String SETTINGS_FILE_NAME_PROPERTY
The property name specifying the file name of the settings file. If the property is unset, uses DEFAULT_FILEPATH.

See Also:
Constant Field Values

DEFAULT_FILEPATH

static final java.lang.String DEFAULT_FILEPATH
The default place where the settings file can be found.

See Also:
Constant Field Values

DIR_COMMONTEMPDIR

public static final java.lang.String DIR_COMMONTEMPDIR
Common temporary directory for all applications.

See Also:
Constant Field Values

REMOTE_FILE_CLASS

public static final java.lang.String REMOTE_FILE_CLASS
The class to use for RemoteFile objects.

See Also:
Constant Field Values

FTP_SERVER_NAME

public static final java.lang.String FTP_SERVER_NAME
The default FTP-server used.

See Also:
Constant Field Values

FTP_SERVER_PORT

public static final java.lang.String FTP_SERVER_PORT
The default FTP-server port used.

See Also:
Constant Field Values

FTP_USER_NAME

public static final java.lang.String FTP_USER_NAME
The default FTP username.

See Also:
Constant Field Values

FTP_USER_PASSWORD

public static final java.lang.String FTP_USER_PASSWORD
The default FTP password. *

See Also:
Constant Field Values

FTP_COPYTO_RETRIES

public static final java.lang.String FTP_COPYTO_RETRIES
The number of times FTPRemoteFile should try before giving up a copyTo operation.

See Also:
Constant Field Values

HTTPREMOTEFILE_PORT_NUMBER

public static final java.lang.String HTTPREMOTEFILE_PORT_NUMBER
HTTP remotefile port number.

See Also:
Constant Field Values

JMS_BROKER_VENDOR

public static final java.lang.String JMS_BROKER_VENDOR
Selects the broker vendor to be used. Fx. ActiveMQ

See Also:
Constant Field Values

JMS_BROKER_HOST

public static final java.lang.String JMS_BROKER_HOST
The JMS broker host contacted by the JMS connection.

See Also:
Constant Field Values

JMS_BROKER_PORT

public static final java.lang.String JMS_BROKER_PORT
The port the JMS connection should use.

See Also:
Constant Field Values

ENVIRONMENT_NAME

public static final java.lang.String ENVIRONMENT_NAME
The name of the environment in which this code is running, e.g. PROD, RELEASETEST, NHC, ... Common prefix to all JMS channels.

See Also:
Constant Field Values

HTTP_PORT_NUMBER

public static final java.lang.String HTTP_PORT_NUMBER
The *unique* (per host) port number that may or may not be used to serve http, but is frequently used to identify the process.

See Also:
Constant Field Values

ARC_REPOSITORY_CLIENT

public static final java.lang.String ARC_REPOSITORY_CLIENT
The class that implements the ArcRepositoryClient. This class will be instantiated by the ArcRepositoryClientFactory.

See Also:
Constant Field Values

ARCREPOSITORY_GET_TIMEOUT

public static final java.lang.String ARCREPOSITORY_GET_TIMEOUT
How many milliseconds we will wait before giving up on a lookup request to the Arcrepository

See Also:
Constant Field Values

ARCREPOSITORY_STORE_RETRIES

public static final java.lang.String ARCREPOSITORY_STORE_RETRIES
Number of times to try sending a store message before failing, including the first attempt.

See Also:
Constant Field Values

ARCREPOSITORY_STORE_TIMEOUT

public static final java.lang.String ARCREPOSITORY_STORE_TIMEOUT
Timeout in milliseconds before retrying when calling ArcRepositoryClient.store()

See Also:
Constant Field Values

INDEXSERVER_CLIENT

public static final java.lang.String INDEXSERVER_CLIENT
The class instantiated to give access to indices. Will be created by IndexClientFactory.

See Also:
Constant Field Values

INDEXREQUEST_TIMEOUT

public static final java.lang.String INDEXREQUEST_TIMEOUT
The amount of time, in milliseconds, we should wait for replies when issuing a call to generate an index over som jobs.

See Also:
Constant Field Values

CACHE_DIR

public static final java.lang.String CACHE_DIR
The name of the directory where cache data global to the entire machine can be stored. Various kinds of caches should be stored in subdirectories of this.

See Also:
Constant Field Values

DEFAULT_SEEDLIST

public static final java.lang.String DEFAULT_SEEDLIST
Default seed list to use when new domains are created.

See Also:
Constant Field Values

DOMAIN_DEFAULT_CONFIG

public static final java.lang.String DOMAIN_DEFAULT_CONFIG
The name of a configuration that is created by default and which is initially used for snapshot harvests.

See Also:
Constant Field Values

DOMAIN_DEFAULT_ORDERXML

public static final java.lang.String DOMAIN_DEFAULT_ORDERXML
Name of order xml template used for domains if nothing else is specified (e.g. newly created configrations use this)

See Also:
Constant Field Values

DOMAIN_CONFIG_MAXRATE

public static final java.lang.String DOMAIN_CONFIG_MAXRATE
Default download rate for domain configuration. Not currently enforced.

See Also:
Constant Field Values

VALID_DOMAIN_REGEX

public static final java.lang.String VALID_DOMAIN_REGEX
This setting describes a regular expression used to validate domains against.

See Also:
Constant Field Values

DB_SPECIFICS_CLASS

public static final java.lang.String DB_SPECIFICS_CLASS
The class that defines DB-specific methods

See Also:
Constant Field Values

DB_URL

public static final java.lang.String DB_URL
URL to use to connect to the database. If absent or empty, the URL will be constructed in a derby-specific way based on DB_NAME and HARVESTDEFINITION_BASEDIR.

See Also:
Constant Field Values

DB_BACKUP_INIT_HOUR

public static final java.lang.String DB_BACKUP_INIT_HOUR
The earliest time of day backup will be initiated, 0..24 hours. At a time shortly after this, a consistent backup copy of the database will be created.

See Also:
Constant Field Values

ERRORFACTOR_PERMITTED_PREVRESULT

public static final java.lang.String ERRORFACTOR_PERMITTED_PREVRESULT
Used when calculating expected size of a harvest of some configuration during job-creation process. This defines how great a possible factor we will permit a harvest to be larger then the expectation, when basing the expectation on a previous completed job.

See Also:
Constant Field Values

ERRORFACTOR_PERMITTED_BESTGUESS

public static final java.lang.String ERRORFACTOR_PERMITTED_BESTGUESS
Used when calculating expected size of a harvest of some configuration during job-creation process. This defines how great a possible factor we will permit a harvest to be larger then the expectation, when basing the expectation on previous uncompleted harvests or no harvest data at all.

See Also:
Constant Field Values

EXPECTED_AVERAGE_BYTES_PER_OBJECT

public static final java.lang.String EXPECTED_AVERAGE_BYTES_PER_OBJECT
How many bytes the average object is expected to be on domains where we don't know any better. This number should grow over time, as of end of 2005 empirical data shows 38000.

See Also:
Constant Field Values

MAX_DOMAIN_SIZE

public static final java.lang.String MAX_DOMAIN_SIZE
Initial guess of #objects in an unknown domain

See Also:
Constant Field Values

JOBS_MAX_RELATIVE_SIZE_DIFFERENCE

public static final java.lang.String JOBS_MAX_RELATIVE_SIZE_DIFFERENCE
The maximum allowed relative difference in expected number of objects retrieved in a single job definition. Set to MAX_LONG for no splitting.

See Also:
Constant Field Values

JOBS_MIN_ABSOLUTE_SIZE_DIFFERENCE

public static final java.lang.String JOBS_MIN_ABSOLUTE_SIZE_DIFFERENCE
Size differences for jobs below this threshold are ignored, regardless of the limits for the relative size difference. Set to MAX_LONG for no splitting.

See Also:
Constant Field Values

JOBS_MAX_TOTAL_JOBSIZE

public static final java.lang.String JOBS_MAX_TOTAL_JOBSIZE
When this limit is exceeded no more configurations may be added to a job. Set to MAX_LONG for no splitting.

See Also:
Constant Field Values

MAX_CONFIGS_PER_JOB_CREATION

public static final java.lang.String MAX_CONFIGS_PER_JOB_CREATION
How many domain configurations we will process in one go before making jobs out of them. This amount of domains will be stored in memory at the same time. Set to MAX_LONG for no job splitting.

See Also:
Constant Field Values

HARVEST_CONTROLLER_SERVERDIR

public static final java.lang.String HARVEST_CONTROLLER_SERVERDIR
Each job gets a subdir of this dir. Job data is written and Heritrix writes to that subdir.

See Also:
Constant Field Values

HARVEST_CONTROLLER_OLDJOBSDIR

public static final java.lang.String HARVEST_CONTROLLER_OLDJOBSDIR
The directory in which data from old jobs is kept after uploading. Each directory from serverDir will be moved to here if any data remains, either due to failed uploads or because it wasn't attempted uploaded.

See Also:
Constant Field Values

HARVEST_CONTROLLER_PRIORITY

public static final java.lang.String HARVEST_CONTROLLER_PRIORITY
Pool to take jobs from

See Also:
Constant Field Values

INACTIVITY_TIMEOUT_IN_SECS

public static final java.lang.String INACTIVITY_TIMEOUT_IN_SECS
The timeout setting for aborting a crawl based on crawler-inactivity. If the crawler is inactive for this amount of milliseconds the crawl will be aborted. The inactivity is measured on the crawlController.activeToeCount().

See Also:
Constant Field Values

CRAWLER_TIMEOUT_NON_RESPONDING

public static final java.lang.String CRAWLER_TIMEOUT_NON_RESPONDING
The timeout value (in seconds) used in HeritrixLauncher for aborting crawl. when no bytes are being received from web servers.

See Also:
Constant Field Values

HARVEST_CONTROLLER_ISRUNNING_FILE

public static final java.lang.String HARVEST_CONTROLLER_ISRUNNING_FILE
The file used to signal that the harvest controller is running. Sidekick starts HarvestController if this file is not present

See Also:
Constant Field Values

SITESECTION_CLASS

public static final java.lang.String SITESECTION_CLASS
The subclass of SiteSection that defines a part of the web interface.

See Also:
Constant Field Values

SITESECTION_WEBAPPLICATION

public static final java.lang.String SITESECTION_WEBAPPLICATION
The directory or war-file containing the web application for a site section.

See Also:
Constant Field Values

SITESECTION_DEPLOYPATH

public static final java.lang.String SITESECTION_DEPLOYPATH
The URL path for this site section.

See Also:
Constant Field Values

LANGUAGE_LOCALE

public static final java.lang.String LANGUAGE_LOCALE
A locale the website is available as. E.g. 'en_US' or 'da'

See Also:
Constant Field Values

LANGUAGE_NAME

public static final java.lang.String LANGUAGE_NAME
The native name of the language for the website locale. E.g. 'Dansk' or 'English'.

See Also:
Constant Field Values

DIRS_ARCREPOSITORY_ADMIN

public static final java.lang.String DIRS_ARCREPOSITORY_ADMIN
Absolute/relative path to where the "central list of files and checksums" (admin.data) is written. Used by ArcRepository and BitPreservation.

See Also:
Constant Field Values

ENVIRONMENT_LOCATION_NAMES

public static final java.lang.String ENVIRONMENT_LOCATION_NAMES
The names of all institutional bit archive locations in the environment, e.g., "KB" and "SB".

See Also:
Constant Field Values

ENVIRONMENT_BATCH_LOCATION

public static final java.lang.String ENVIRONMENT_BATCH_LOCATION
Default bit archive to use for batch jobs (if none is specified)

See Also:
Constant Field Values

BITARCHIVE_MIN_SPACE_LEFT

public static final java.lang.String BITARCHIVE_MIN_SPACE_LEFT
The minimum amount of bytes left *in any dir* that we will allow a bitarchive machine to accept uploads with. When no dir has more space than this, the bitarchive machine stops listening for uploads. This values should at the very least be greater than the largest ARC file you expect to receive.

See Also:
Constant Field Values

BITARCHIVE_SERVER_FILEDIR

public static final java.lang.String BITARCHIVE_SERVER_FILEDIR
These are the directories where ARC files are stored (in a subdir). If more than one is given, they are used from one end.

See Also:
Constant Field Values

BITARCHIVE_HEARTBEAT_FREQUENCY

public static final java.lang.String BITARCHIVE_HEARTBEAT_FREQUENCY
The frequency in milliseconds of heartbeats that are sent by each BitarchiveServer to the BitarchiveMonitor.

See Also:
Constant Field Values

BITARCHIVE_ACCEPTABLE_HEARTBEAT_DELAY

public static final java.lang.String BITARCHIVE_ACCEPTABLE_HEARTBEAT_DELAY
If we haven't heard from a bit archive within this many milliseconds, we don't excpect it to be online and won't wait for them to reply on a batch job. This number should be significantly greater than heartbeatFrequency to account for temporary network congestion.

See Also:
Constant Field Values

BITARCHIVE_BATCH_JOB_TIMEOUT

public static final java.lang.String BITARCHIVE_BATCH_JOB_TIMEOUT
The BitarchiveMonitorServer will listen for BatchEndedMessages for this many milliseconds before it decides that a batch job is taking too long and returns just the replies it has received at that point.

See Also:
Constant Field Values

ENVIRONMENT_THIS_LOCATION

public static final java.lang.String ENVIRONMENT_THIS_LOCATION
For archiving applications, which bit archive are you part of?

See Also:
Constant Field Values

ENVIRONMENT_THIS_CREDENTIALS

public static final java.lang.String ENVIRONMENT_THIS_CREDENTIALS
Credentials to enter in the GUI for "deleting" ARC files in this bit archive.

See Also:
Constant Field Values

BITARCHIVE_LIMIT_FOR_RECORD_DATATRANSFER_IN_FILE

public static final java.lang.String BITARCHIVE_LIMIT_FOR_RECORD_DATATRANSFER_IN_FILE
When the length record exceeds this number, the contents of the record will be transferred using a RemoteFile. Currently set to 31 MB ( Integer.MAX_VALUE / 64) -->

See Also:
Constant Field Values

DIR_ARCREPOSITORY_BITPRESERVATION

public static final java.lang.String DIR_ARCREPOSITORY_BITPRESERVATION
Absolute or relative path to dir containing results of file-list-batch-jobs and checksumming batch jobs for bit preservation

See Also:
Constant Field Values

VIEWERPROXY_HOSTNAME

public static final java.lang.String VIEWERPROXY_HOSTNAME
The name of the server used for viewerproxy links in the GUI.

See Also:
Constant Field Values

VIEWERPROXY_DIR

public static final java.lang.String VIEWERPROXY_DIR
The main directory for the ViewerProxy, used for storing the Lucene index for the jobs being viewed.

See Also:
Constant Field Values

APPLICATIONNAME

public static final java.lang.String APPLICATIONNAME
The name of the application, fx. "BitarchiveServerApplication".

See Also:
Constant Field Values

LOGGING_HISTORY_SIZE

public static final java.lang.String LOGGING_HISTORY_SIZE
See Also:
Constant Field Values

MAIL_SERVER

public static final java.lang.String MAIL_SERVER
The mail server to use when sending mails. Currently only used for email notifications.

See Also:
Constant Field Values

MAIL_RECEIVER

public static final java.lang.String MAIL_RECEIVER
The receiver of email notifications.

See Also:
Constant Field Values

MAIL_SENDER

public static final java.lang.String MAIL_SENDER
The sender of email notifications.

See Also:
Constant Field Values

NOTIFICATIONS_CLASS

public static final java.lang.String NOTIFICATIONS_CLASS
The implementation class for notifications.

See Also:
Constant Field Values

JMX_PORT

public static final java.lang.String JMX_PORT
Which port to use for JMX.

See Also:
Constant Field Values

JMX_RMI_PORT

public static final java.lang.String JMX_RMI_PORT
Which port to use for JMX's RMI communication.

See Also:
Constant Field Values

JMX_PASSWORD_FILE

public static final java.lang.String JMX_PASSWORD_FILE
Which file to look for JMX passwords in.

See Also:
Constant Field Values

JMX_MONITOR_ROLE_PASSWORD_SETTING

public static final java.lang.String JMX_MONITOR_ROLE_PASSWORD_SETTING
The password needed to connect as 'monitorRole' to the MBeanservers.

See Also:
Constant Field Values

JMX_HOSTS_NUMBER_SETTING

public static final java.lang.String JMX_HOSTS_NUMBER_SETTING
The number of different hosts where MBeanservers reside.

See Also:
Constant Field Values

JMX_HOST_NAME

public static final java.lang.String JMX_HOST_NAME
The name of a JMX host. %d should be replaced with a number between 1 and JMX_HOSTS_NUMBER_SETTING.

See Also:
Constant Field Values

JMX_HOST_PORT

public static final java.lang.String JMX_HOST_PORT
The port of a JMX host. %d should be replaced with a number between 1 and JMX_HOSTS_NUMBER_SETTING.

See Also:
Constant Field Values
Method Detail

getSettingsFilePath

public static java.lang.String getSettingsFilePath()

reload

public static void reload()
Reloads the settings. Usefull if the property dk.netarkivet.settings.file is set after initialisation of the static member. author: SSC


get

public static java.lang.String get(java.lang.String key)
                            throws UnknownID,
                                   IOFailure,
                                   ArgumentNotValid
Gets a setting. First System.property is checked, if the key is registered here the registered value is returned, otherwise the data loaded from the settings.xml file are checked.

Parameters:
key - name of the setting to retrieve
Returns:
the retrieved value
Throws:
ArgumentNotValid - if key is null or the empty string
UnknownID - if no setting loaded matches key
IOFailure - if no settings loaded.

getLong

public static long getLong(java.lang.String key)
                    throws UnknownID,
                           IOFailure,
                           ArgumentNotValid
Gets a setting as a long. This method calls get(key) and then parses the value to long.

Parameters:
key - name of the setting to retrieve
Returns:
the retrieved long
Throws:
ArgumentNotValid - if key is null, the empty string or key is not parseable to long
UnknownID - if no setting loaded matches key
IOFailure - if no settings loaded.

getInt

public static int getInt(java.lang.String key)
Gets a setting as an int. This method calls get(key) and then parses the value to int.

Parameters:
key - name of the setting to retrieve
Returns:
the retrieved int
Throws:
ArgumentNotValid - if key is null, the empty string or key is not parseable to int
UnknownID - if no setting loaded matches key
IOFailure - if no settings loaded.

getAll

public static java.lang.String[] getAll(java.lang.String key)
                                 throws UnknownID,
                                        IOFailure,
                                        ArgumentNotValid
Gets a list of settings. First System.property is checked, if the key is registered here the registered value is returned in a list of length 1, otherwise the data loaded from the settings.xml file are checked.

Parameters:
key - name of the setting to retrieve
Returns:
the retrieved values
Throws:
ArgumentNotValid - if key is null or the empty string
UnknownID - if no setting loaded matches key
IOFailure - if no settings loaded.

create

public static void create(java.lang.String key,
                          java.lang.String value)
                   throws ArgumentNotValid
Create a new setting.

Parameters:
key - the name of the setting
value - the value
Throws:
ArgumentNotValid - if key or value is null or the empty string, or if a corresponding key already exists. author: SSC

set

public static void set(java.lang.String key,
                       java.lang.String... values)
Sets the key to one or more values. The key must exist beforehand.

Parameters:
key - The settings key to add this under, legal keys are fields in this class.
values - The (ordered) list of values to put under this key.
Throws:
ArgumentNotValid - if key or values are null
UnknownID - if the key does not already exist

validateWithXSD

public static void validateWithXSD()
Validate that the settings.xml file conforms to the XSD.


validateStrings

public static void validateStrings()
Validate that the strings defined in this class are present in the settings.xml file. Checks all static String fields that are not explicitly excluded above. This asserts the correspondence between the settings we think we have and those defined in the XSD/.xml file.