org.eaglei.repository
Class Configuration

java.lang.Object
  extended by org.eaglei.repository.Configuration

public class Configuration
extends java.lang.Object

This is a singleton class that manages configuration info. It is created by the Lifecycle singleton. Important configuration variables: - Sesame repository object (not the connection, but what makes connections) - Default namespace - Title (in configuration)

Version:
$Id: $
Author:
Larry Stone Started April 2010

Field Summary
static java.lang.String DATAMODEL_SOURCE
          Contains URL of datamodel source within this webapp
static java.lang.String INSTANCE_CSS
          CSS stylesheet for HTML dissemination output, if any
static java.lang.String INSTANCE_JS
          List of JavaScript URLs to be included in HTML dissemination output
static java.lang.String INSTANCE_XSLT
          stylesheet for transforming HTML dissemination output, if any
static java.lang.String LOGDIR
          optional alternate log directory
static java.lang.String NAMESPACE
          namespace URI prefix for local resources
static java.lang.String SESAMEDIR
          required subdirectory for sesame nativestore files
static java.lang.String SESAMEINDEXES
          optional sesame nativestore index configuration
static java.lang.String TITLE
          title of repository for UI labels
 
Method Summary
 java.lang.String getBranch()
          Get the source SCM branch, if any.
 java.lang.String getConfigurationProperty(java.lang.String key)
          getConfigurationProperty
 java.lang.String getConfigurationProperty(java.lang.String key, java.lang.String dflt)
          return default if there is no value for the indicated property.
 java.lang.String[] getConfigurationPropertyArray(java.lang.String key, java.lang.String[] dfault)
          Gets a configuration property with multiple values, returned in an array.
 boolean getConfigurationPropertyAsBoolean(java.lang.String key, boolean dflt)
          return boolean value of a config property
 java.lang.String getDefaultNamespace()
          Get value of default namespace prefix for URIs created by the repository.
 java.io.File getHomeDirectory()
          getHomeDirectory - get configured repository home directory.
static Configuration getInstance()
          Get the singleton instance.
 java.lang.String getProjectVersion()
          Get the Maven project version
 java.lang.String getRevision()
          Get the source revision, e.g.
 java.io.File getSesameDirectory()
          Return the directory (creating it if necessary) for Sesame NativeStore files.
 java.lang.String getSesameVersion()
          Get version of Sesame triplestore libraries
 java.lang.String getTimestamp()
          Get the time when this software version was built Depends on the build properties file left in place by maven.
 void initialize()
          Explicit initialization, invoked by bootstrap sequence in Lifecycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
namespace URI prefix for local resources

See Also:
Constant Field Values

LOGDIR

public static final java.lang.String LOGDIR
optional alternate log directory

See Also:
Constant Field Values

SESAMEDIR

public static final java.lang.String SESAMEDIR
required subdirectory for sesame nativestore files

See Also:
Constant Field Values

SESAMEINDEXES

public static final java.lang.String SESAMEINDEXES
optional sesame nativestore index configuration

See Also:
Constant Field Values

TITLE

public static final java.lang.String TITLE
title of repository for UI labels

See Also:
Constant Field Values

INSTANCE_XSLT

public static final java.lang.String INSTANCE_XSLT
stylesheet for transforming HTML dissemination output, if any

See Also:
Constant Field Values

INSTANCE_CSS

public static final java.lang.String INSTANCE_CSS
CSS stylesheet for HTML dissemination output, if any

See Also:
Constant Field Values

INSTANCE_JS

public static final java.lang.String INSTANCE_JS
List of JavaScript URLs to be included in HTML dissemination output

See Also:
Constant Field Values

DATAMODEL_SOURCE

public static final java.lang.String DATAMODEL_SOURCE
Contains URL of datamodel source within this webapp

See Also:
Constant Field Values
Method Detail

getInstance

public static Configuration getInstance()
Get the singleton instance. Will return null unless the initialization has run.

Returns:
the singleton, a Configuration object.

initialize

public void initialize()
                throws java.io.IOException
Explicit initialization, invoked by bootstrap sequence in Lifecycle.

Throws:
java.io.IOException

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Get value of default namespace prefix for URIs created by the repository. This is a critically important value that ought to be configured by the administrator, so that URIs are resolved correctly by the server. Since it is so essential, we have to provide a usable default. Also, sanity-check the configured value. It must be a legal absolute URI.

Returns:
the default namespace prefix as a String object.

getConfigurationProperty

public java.lang.String getConfigurationProperty(java.lang.String key)

getConfigurationProperty

Parameters:
key - a String object.
Returns:
property value or null if not set.

getConfigurationProperty

public java.lang.String getConfigurationProperty(java.lang.String key,
                                                 java.lang.String dflt)
return default if there is no value for the indicated property.

Parameters:
key - a String object.
dflt - default value to return if not set a String object.
Returns:
the property value or dflt if not set.

getConfigurationPropertyArray

public java.lang.String[] getConfigurationPropertyArray(java.lang.String key,
                                                        java.lang.String[] dfault)
Gets a configuration property with multiple values, returned in an array. The values are expected to be separated by comma and optional whitespace. Returns the default value (which may be null) when there is no such key

Parameters:
key - a String object.
Returns:
property value as an array of String objects, or null if not set.

getConfigurationPropertyAsBoolean

public boolean getConfigurationPropertyAsBoolean(java.lang.String key,
                                                 boolean dflt)
return boolean value of a config property

Parameters:
key - a String object.
dflt - default value to return if no config found.
Returns:
the property value parsed as boolean or dflt if not set.

getProjectVersion

public java.lang.String getProjectVersion()
Get the Maven project version

Returns:
version as an opaque a String object.

getRevision

public java.lang.String getRevision()
Get the source revision, e.g. the subversion revision number. Depends on the build properties file left in place by maven.

Returns:
revision as an opaque a String object.

getBranch

public java.lang.String getBranch()
Get the source SCM branch, if any. Depends on the build properties file left in place by maven.

Returns:
branch or tag name, or null if on the trunk.

getTimestamp

public java.lang.String getTimestamp()
Get the time when this software version was built Depends on the build properties file left in place by maven.

Returns:
time as an opaque a String object.

getHomeDirectory

public java.io.File getHomeDirectory()
                              throws java.io.IOException

getHomeDirectory - get configured repository home directory.

Find the root of the repository configuration and data hierarchy. It will be the first one of these that exists: a. value of system property "org.eaglei.repository.home" b. otherwise, default is "$HOME/eaglei/repository/" (where $HOME == System.getProperty("user.home") in Java-land) ALSO, this sets the system property to the default if it was unset before, so e.g. Apache config interpolation will work.

Returns:
repository home directory as a File object.
Throws:
java$io$IOException - if any.
java.io.IOException

getSesameVersion

public java.lang.String getSesameVersion()
                                  throws java.io.IOException
Get version of Sesame triplestore libraries

Returns:
textual version string of Sesame
Throws:
java.io.IOException

getSesameDirectory

public java.io.File getSesameDirectory()
                                throws java.io.IOException
Return the directory (creating it if necessary) for Sesame NativeStore files.

Throws:
java.io.IOException


Copyright © 2009-2011 Eagle-I. All Rights Reserved.