org.hd.d.pg2k.svrCore
Class CoreConsts

java.lang.Object
  extended by org.hd.d.pg2k.svrCore.CoreConsts

public final class CoreConsts
extends java.lang.Object

This holds fundamental compile-time constants for all parts of PG2K.


Field Summary
static java.util.Set<java.lang.String> ALL_FS_CONF_FILENAMES
          Immutable Set of all configuration filenames (as String values).
static java.lang.String APP_DEFAULT_NAME
          Default name by which whole app is known internally.
static int ASYNC_MIN_POWER_SAVE_NON_CRITICAL_DATA_FLUSH_MS
          Target minimum interval of flushes of non-critical data to disc or persistent store in power-save mode; strictly positive (ms).
static java.lang.String ATTR_I18N_DESC_PREFIX
          Prefix of i18n-ed attribute word descriptions.
static boolean AVOID_UNSAFE_TCP_TIMEOUTS
          If true, avoid using connection and read timeouts on sockets.
static int BULK_DATA_TRANSFER_SIZE
          Suggested transfer size of exhibit data (and some other bulk data).
static java.text.SimpleDateFormat DEFAULT_DATE_FORMAT
          Our preferred simple date formater for all locales; yyyy/MM/dd Japanese style.
static int DEFAULT_TEMPORAL_SLACKNESS_S
          Default temporal slackness in seconds; strictly positive.
static java.lang.String DESCRIPTION_FILE_SUFFIX
          Description suffix on full path name of exhibit.
static int DESCRIPTION_MAX_CHARS
          Maximum length of description entry (or entries) in characters.
static java.lang.String DO_NOTHING_PAGE_RRURL
          Do-nothing page root-relative URL that will accept any parameters and does no work.
static java.lang.String FILE_ENCODING_8859_1
          8-bit ISO-8859-1 file encoding.
static java.lang.String FILE_ENCODING_ASCII7
          7-bit ASCII file encoding, also by definition valid ISO-8859-1 and UTF-8.
static java.lang.String FILE_ENCODING_UTF_8
          8-bit UTF-8 file encoding.
static java.lang.String FS_CONF_ROOT
          Default base dir for meta-data load from filesystem.
static java.lang.String FS_CONF_SECPROPS
          Filesystem path below conf root for load/save of private security properties.
static java.lang.String FS_CONF_SYSPROPS
          Filesystem path below conf root for load/save of global system properties.
static java.lang.String FS_DATA_CACHE_FILENAME
          Name of static properties cache file usually within data directory.
static java.lang.String FS_DATA_ROOT
          Default dase dir for exhibit data load from filesystem.
static long GALLERY_EPOC_START
          Approximate start date of the Gallery, primarily for validating timestamps, etc; strictly positive.
static java.lang.String GEN_PREFIX_debugFlag
          GenProps debug flag tree root, including trailing dot.
static java.lang.String GLOBAL_PROPS_NAME
          Name of properties class/file on classpath containing simple global properties.
static java.lang.String HASH_CRC32
          Checksum/hash for data to correspond to use in tools such as [G]ZIP; not "secure".
static java.lang.String HASH_MD5
          Alternative fast hash for data integrity; reasonably "secure".
static java.lang.String HASH_SHA1
          Preferred hash for data integrity; reasonably "secure".
static java.lang.String HMAC_ALG
          HMAC authentication hash algorithm to protect data in transit.
static java.lang.String JNDI_COMPENV_PREFIX
          java:comp/env usual JNDI namespace prefix for EJBs...
static java.lang.String JNDI_SHORT_NAME_ExhibitFacade
          Short JNDI name by which ExhibitFacade front-end (session) bean is accessed.
static java.lang.String JNDI_SHORT_NAME_PropsFacade
          Short JNDI name by which PropsFacade front-end (session) bean is accessed.
static java.lang.String LOCDB_PROPS_NAME
          Name of properties class/file on classpath or in exhibits area containing built-in location-map data.
static java.lang.String MAIN_DATA_HOST
          Name of main exhibit and catalogue-page server host(s); generally sessionless.
static long MAX_EXHIBIT_AGE_NEW_MS
          Max age of an exhibit to be considered "new", in milliseconds; strictly positive.
static int MAX_EXHIBIT_AGE_NEW_S
          Max age of an exhibit to be considered "new", in seconds; strictly positive.
static long MAX_EXPECTED_LOW_POWER_RUN_MS
          Maximum time that we expect the system to have to remain in low-power mode in one stretch (ms); strictly positive.
static int MAX_INTERACTIVE_DELAY_MS
          Time short enough not to be noticable to users in GUI interactions, ms; strictly positive.
static int MAX_PASSWORD_LEN
          Maximum password length for all (eg Web) logins; strictly positive.
static int MAX_PEER_CLOCK_SKEW_MS
          Maximum permissable clock skew between any two PG2K server instances, ms; strictly positive.
static int MAX_TYPICAL_RPC_RTT_MS
          Maximum time that a typical inter-server RPC call should take (eg round the Earth, over the Internet), ms; strictly positive.
static int MIN_PASSWORD_LEN
          Minimum password length for all (eg Web) logins; strictly positive.
static java.lang.String PRIV_ROLE_NAME
          Role name (user/group) to for most priv actions.
static java.lang.String SYMTIME_I18N_PREFIX
          Prefix of i18n-ed symbolic filter times.
static java.lang.String TUNNEL_URI
          Tunnel URL on server.
static java.lang.String WAR_CTXTPARAM_AGGRESSIVE_CACHE
          Name of WAR context-param boolean flag to set cache aggressiveness.
static java.lang.String WAR_CTXTPARAM_BOOTURL
          Name of WAR context-param boot-server URL.
static java.lang.String WAR_CTXTPARAM_DISPOSITION
          Name of WAR context-param `master/slave/etc' flag.
static java.lang.String WAR_CTXTPARAM_DISPOSITION_MASTER
          Master (J2EE) taking data from EJBs (and probably not with / context root).
static java.lang.String WAR_CTXTPARAM_DISPOSITION_SLAVE
          Slave (pure WAR) taking data over HTTP tunnel, with / context root.
static java.lang.String WAR_CTXTPARAM_DISPOSITION_WARONLY
          Master (pure WAR) taking data from filesystem, with / context root.
static java.lang.String WAR_SYSPROPNAME_DISPOSITION_PRESET
          The WAR context-param `master/slave' flag can be set early with this named system property.
 
Constructor Summary
CoreConsts()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_DEFAULT_NAME

public static final java.lang.String APP_DEFAULT_NAME
Default name by which whole app is known internally.

See Also:
Constant Field Values

PRIV_ROLE_NAME

public static final java.lang.String PRIV_ROLE_NAME
Role name (user/group) to for most priv actions.

See Also:
Constant Field Values

FILE_ENCODING_8859_1

public static final java.lang.String FILE_ENCODING_8859_1
8-bit ISO-8859-1 file encoding.

See Also:
Constant Field Values

FILE_ENCODING_UTF_8

public static final java.lang.String FILE_ENCODING_UTF_8
8-bit UTF-8 file encoding.

See Also:
Constant Field Values

FILE_ENCODING_ASCII7

public static final java.lang.String FILE_ENCODING_ASCII7
7-bit ASCII file encoding, also by definition valid ISO-8859-1 and UTF-8.

See Also:
Constant Field Values

MAIN_DATA_HOST

public static final java.lang.String MAIN_DATA_HOST
Name of main exhibit and catalogue-page server host(s); generally sessionless. This may be an alias to one or more hosts.

This is rendered all lower-case to slightly improve compressability in certain contexts, and is also prefixless (eg no "www.") to be in canonical form.

This is also a base name of which some subdomains are significant, eg as mirrors.

See Also:
Constant Field Values

DEFAULT_TEMPORAL_SLACKNESS_S

public static final int DEFAULT_TEMPORAL_SLACKNESS_S
Default temporal slackness in seconds; strictly positive. This is the default slackness or inconsistency that we will allow in the system in order to gain efficiency.

This can be used, for example, as a default time for which exhibits and catalogue pages may be cached by a client, and that we might internally cache exhibit properties, etc.

Note that it may sometimes be necessary to ensure that multiples of this interval cannot be catenated in bad cases.

See Also:
Constant Field Values

GALLERY_EPOC_START

public static final long GALLERY_EPOC_START
Approximate start date of the Gallery, primarily for validating timestamps, etc; strictly positive. No exhibit timestamp or accession date should be older than this (nor newer than "now" allowing for clock skew).

Other dates may be validated with reference this value.

It is probably accurate enough to use in synthetic copyright notices too.

The Gallery started in 1996/1997.

For reference:

See Also:
Constant Field Values

JNDI_COMPENV_PREFIX

public static final java.lang.String JNDI_COMPENV_PREFIX
java:comp/env usual JNDI namespace prefix for EJBs...

See Also:
Constant Field Values

JNDI_SHORT_NAME_ExhibitFacade

public static final java.lang.String JNDI_SHORT_NAME_ExhibitFacade
Short JNDI name by which ExhibitFacade front-end (session) bean is accessed.

See Also:
Constant Field Values

JNDI_SHORT_NAME_PropsFacade

public static final java.lang.String JNDI_SHORT_NAME_PropsFacade
Short JNDI name by which PropsFacade front-end (session) bean is accessed.

See Also:
Constant Field Values

FS_DATA_ROOT

public static final java.lang.String FS_DATA_ROOT
Default dase dir for exhibit data load from filesystem.

See Also:
Constant Field Values

FS_CONF_ROOT

public static final java.lang.String FS_CONF_ROOT
Default base dir for meta-data load from filesystem.

See Also:
Constant Field Values

FS_CONF_SYSPROPS

public static final java.lang.String FS_CONF_SYSPROPS
Filesystem path below conf root for load/save of global system properties.

See Also:
Constant Field Values

FS_CONF_SECPROPS

public static final java.lang.String FS_CONF_SECPROPS
Filesystem path below conf root for load/save of private security properties.

See Also:
Constant Field Values

FS_DATA_CACHE_FILENAME

public static final java.lang.String FS_DATA_CACHE_FILENAME
Name of static properties cache file usually within data directory. For most purposes this is read-only, but some applications are able to write to it to atomically update it.

See Also:
Constant Field Values

ALL_FS_CONF_FILENAMES

public static final java.util.Set<java.lang.String> ALL_FS_CONF_FILENAMES
Immutable Set of all configuration filenames (as String values).


GLOBAL_PROPS_NAME

public static final java.lang.String GLOBAL_PROPS_NAME
Name of properties class/file on classpath containing simple global properties. This does not include a file suffix.

See Also:
Constant Field Values

LOCDB_PROPS_NAME

public static final java.lang.String LOCDB_PROPS_NAME
Name of properties class/file on classpath or in exhibits area containing built-in location-map data. This does not include a file suffix.

See Also:
Constant Field Values

WAR_CTXTPARAM_AGGRESSIVE_CACHE

public static final java.lang.String WAR_CTXTPARAM_AGGRESSIVE_CACHE
Name of WAR context-param boolean flag to set cache aggressiveness.

See Also:
Constant Field Values

WAR_CTXTPARAM_DISPOSITION

public static final java.lang.String WAR_CTXTPARAM_DISPOSITION
Name of WAR context-param `master/slave/etc' flag.

See Also:
Constant Field Values

WAR_CTXTPARAM_DISPOSITION_MASTER

public static final java.lang.String WAR_CTXTPARAM_DISPOSITION_MASTER
Master (J2EE) taking data from EJBs (and probably not with / context root).

See Also:
Constant Field Values

WAR_CTXTPARAM_DISPOSITION_WARONLY

public static final java.lang.String WAR_CTXTPARAM_DISPOSITION_WARONLY
Master (pure WAR) taking data from filesystem, with / context root.

See Also:
Constant Field Values

WAR_CTXTPARAM_DISPOSITION_SLAVE

public static final java.lang.String WAR_CTXTPARAM_DISPOSITION_SLAVE
Slave (pure WAR) taking data over HTTP tunnel, with / context root.

See Also:
Constant Field Values

WAR_SYSPROPNAME_DISPOSITION_PRESET

public static final java.lang.String WAR_SYSPROPNAME_DISPOSITION_PRESET
The WAR context-param `master/slave' flag can be set early with this named system property. This allows the WAR front-end to start-up faster in some circumstances, but if this is not set, or not set to a usable value, the WAR front-end will resort to its default method of determining master/slave disposition.

The property value must not conflict with that deduced my the default methods, if this property is defined at all.

See Also:
Constant Field Values

WAR_CTXTPARAM_BOOTURL

public static final java.lang.String WAR_CTXTPARAM_BOOTURL
Name of WAR context-param boot-server URL.

See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

public static final java.text.SimpleDateFormat DEFAULT_DATE_FORMAT
Our preferred simple date formater for all locales; yyyy/MM/dd Japanese style. FIXME: note that SimpleDateFormat is not immutable.


DESCRIPTION_MAX_CHARS

public static final int DESCRIPTION_MAX_CHARS
Maximum length of description entry (or entries) in characters.

See Also:
Constant Field Values

DESCRIPTION_FILE_SUFFIX

public static final java.lang.String DESCRIPTION_FILE_SUFFIX
Description suffix on full path name of exhibit.

See Also:
Constant Field Values

MIN_PASSWORD_LEN

public static final int MIN_PASSWORD_LEN
Minimum password length for all (eg Web) logins; strictly positive.

See Also:
Constant Field Values

MAX_PASSWORD_LEN

public static final int MAX_PASSWORD_LEN
Maximum password length for all (eg Web) logins; strictly positive.

See Also:
Constant Field Values

MAX_INTERACTIVE_DELAY_MS

public static final int MAX_INTERACTIVE_DELAY_MS
Time short enough not to be noticable to users in GUI interactions, ms; strictly positive. Humans are said not to notice delays of 100ms or less.

See Also:
Constant Field Values

MAX_TYPICAL_RPC_RTT_MS

public static final int MAX_TYPICAL_RPC_RTT_MS
Maximum time that a typical inter-server RPC call should take (eg round the Earth, over the Internet), ms; strictly positive. This allows a realistic connection set-up and tear-down time on top of a generous time to process a moderately-complex request.

Some RPCs call may legitimately take (much) longer than this, so this should be used as a limit to stop blocking interactively for a response, but not to kill the request entirely (ie so that we can still hope to make progress in the background for next time).

This should be at least second or more, and possibly over ten seconds, but not so long as to completely kill interactivity of generated (HTML) pages that force RPCs.

Some observed legitimate RPCs take ~10s--20s because of bandwidth limits, eg for large event sets, even after compression.

(Note that in Windows NT the hard-wired initial HTTP TCP timeout was 3s, which seems to have been a little too short for legitimate long-delay paths.)

See Also:
Constant Field Values

HASH_CRC32

public static final java.lang.String HASH_CRC32
Checksum/hash for data to correspond to use in tools such as [G]ZIP; not "secure". Not a secure hash, but used "as if" in some non-critical places as a quick cross-check, and used in ZIP archive so quick to compare against ZIP entries.

See Also:
Constant Field Values

HASH_SHA1

public static final java.lang.String HASH_SHA1
Preferred hash for data integrity; reasonably "secure".

See Also:
Constant Field Values

HASH_MD5

public static final java.lang.String HASH_MD5
Alternative fast hash for data integrity; reasonably "secure". Not as secure as SHA-1, but possibly a good alternative/cross-check, and commonly used for simple integrity checking, eg with the HTTP Content-MD5 header.

See Also:
Constant Field Values

HMAC_ALG

public static final java.lang.String HMAC_ALG
HMAC authentication hash algorithm to protect data in transit. Although we use a MAC primarily to guard against data corruption on the wire, we also want to provide some protection against tampering and replay attacks, eg someone trying to slip p0rn or warez or trojans into the datastream to a slave.

Thus we want a strong-ish hash that is relatively collision-free, though hopefully not too expensive to compute nor contributing too much message overhead (ie too large a hash/MAC).

Note that our key generation and distribution is not necessarily very robust, ie anyone with access to any of the servers as root could steal the key, and thus tamper/insert to their heart's content, so we should not go overboard. This mechanism should prevent corruption and casual tampering by ISPs, transparent proxies, broken routers, and others that can play "man-in-the-middle", but without admin access to any servers. Note that this does not prevent any "man-in-the-middle" from observing all our traffic; we only need authetication, not encryption.

Note that not all communications need to be guarded by this MAC; in particular read-only operations by lightweight clients may not be (at least in part so that we do not need to distribute the secret key to them) which may save some CPU cycles and a little bandwidth. In particular we may respond without a MAC to a request without a (valid) MAC, which may also make it harder for an imposter to probe for our key.

The algorithm must be supported by the JDK or a plugged-in provider.

MD5 and SHA-1 are showing signs of age and weakness, so we need to use something of at least SHA-256 (256-bit) strength. All implementations wishing to communicate must agree on this algorithm.

See Also:
Constant Field Values

MAX_EXHIBIT_AGE_NEW_S

public static final int MAX_EXHIBIT_AGE_NEW_S
Max age of an exhibit to be considered "new", in seconds; strictly positive. A value of a few weeks to a few months is probably appropriate given observed visitor frequency and upload rate of new exhibits.

See Also:
Constant Field Values

MAX_EXHIBIT_AGE_NEW_MS

public static final long MAX_EXHIBIT_AGE_NEW_MS
Max age of an exhibit to be considered "new", in milliseconds; strictly positive. A value of a few weeks to a few months is probably appropriate given observed visitor frequency and upload rate of new exhibits.

See Also:
Constant Field Values

AVOID_UNSAFE_TCP_TIMEOUTS

public static final boolean AVOID_UNSAFE_TCP_TIMEOUTS
If true, avoid using connection and read timeouts on sockets. Under JDK 1.5.0 (and probably 1.4.x), using read and connection timeouts forces the VM to use non-blocking I/O which in turn can lead to fd leaks and other problems.

See Also:
Constant Field Values

BULK_DATA_TRANSFER_SIZE

public static final int BULK_DATA_TRANSFER_SIZE
Suggested transfer size of exhibit data (and some other bulk data). We will usually copy (exhibit) data around in chunks of about this size (or a small power-of-2 multiple of this size). This applies to transfer to/from local media, such as disc, and over slow (eg network) media.

This is large enough to be efficient and to allow the OS to be buffering up data for good throughput over TCP/IP for example, but small enough not to require stupid amounts of memory or time (and in particular to retain reasonable interactivity).

A power of two for efficiency in various places.

A size of about 1kByte to 64kBytes is probably reasonable; 16kB or less seems good to retain interactivity.

See Also:
Constant Field Values

DO_NOTHING_PAGE_RRURL

public static final java.lang.String DO_NOTHING_PAGE_RRURL
Do-nothing page root-relative URL that will accept any parameters and does no work.

See Also:
Constant Field Values

TUNNEL_URI

public static final java.lang.String TUNNEL_URI
Tunnel URL on server.

See Also:
Constant Field Values

GEN_PREFIX_debugFlag

public static final java.lang.String GEN_PREFIX_debugFlag
GenProps debug flag tree root, including trailing dot.

See Also:
Constant Field Values

MAX_PEER_CLOCK_SKEW_MS

public static final int MAX_PEER_CLOCK_SKEW_MS
Maximum permissable clock skew between any two PG2K server instances, ms; strictly positive. Of the order of a few minutes is good.

See Also:
Constant Field Values

ATTR_I18N_DESC_PREFIX

public static final java.lang.String ATTR_I18N_DESC_PREFIX
Prefix of i18n-ed attribute word descriptions. The required attribute word can be appended to this and looked up in the common catalogue for a (possibly localised) description: many not be present for all attributes.

See Also:
Constant Field Values

SYMTIME_I18N_PREFIX

public static final java.lang.String SYMTIME_I18N_PREFIX
Prefix of i18n-ed symbolic filter times. The symbolic name should be appended to this and looked up in the common catalogue for a (possibly localised) description: many not be present for all attributes.

See Also:
Constant Field Values

ASYNC_MIN_POWER_SAVE_NON_CRITICAL_DATA_FLUSH_MS

public static final int ASYNC_MIN_POWER_SAVE_NON_CRITICAL_DATA_FLUSH_MS
Target minimum interval of flushes of non-critical data to disc or persistent store in power-save mode; strictly positive (ms). This should probably be a small multiple of the underlying disc write interval, eg for the default linux-laptop-mode disc-flush interval which is 10 minutes, allowing for the fact that various components may cache private data asynchronously.

System components that observe this value should take especial care to flush when the application/JVM shuts down to avoid losing large amounts of data.

This is not intended to regulate the flushing of critical data.

Several tens of minutes is probably good.

See Also:
Constant Field Values

MAX_EXPECTED_LOW_POWER_RUN_MS

public static final long MAX_EXPECTED_LOW_POWER_RUN_MS
Maximum time that we expect the system to have to remain in low-power mode in one stretch (ms); strictly positive. We attempt to be able to postpone most CPU/disc/etc-intensive operations at least this long without too much difficulty.

This should be long enough to last for mid-winter RE system lows, for example. Typically this might be several days to even as much as a few weeks, though systems not running fully or partially off RE power will probably only run for a few hours in low-power mode each day at most, eg to avoid local grid peak load or peak carbon-intensity.

See Also:
Constant Field Values
Constructor Detail

CoreConsts

public CoreConsts()

DHD Multimedia Gallery V1.50.55

Copyright (c) 1996-2008, Damon Hart-Davis. All rights reserved.