org.griphyn.vdl.util
Class ChimeraProperties

java.lang.Object
  extended by org.griphyn.vdl.util.ChimeraProperties

public class ChimeraProperties
extends Object

A Central Properties class that keeps track of all the properties used by Chimera. All other classes access the methods in this class to get the value of the property. It access the VDSProperties class to read the property file.

Version:
$Revision: 364 $
Author:
Jens-S. V??ckler, Yong Zhao
See Also:
VDSProperties

Field Summary
static String DAX_SCHEMA_LOCATION
           
static String DB_ALL_PREFIX
           
static String DBDRIVER_ALL_PREFIX
           
static String IVR_SCHEMA_LOCATION
           
private  String m_home
          The value of the PEGASUS_HOME environment variable.
private static ChimeraProperties m_instance
          Implements the Singleton access.
private  VDSProperties m_props
          The object holding all the properties pertaining to the VDS system.
static String VDL_SCHEMA_LOCATION
          Default values for schema locations.
 
Constructor Summary
private ChimeraProperties()
          Constructor that is called only once, when creating the Singleton instance.
 
Method Summary
 String getDatabaseDriverName(String dbDriverPrefix)
          Gets then name of the database driver from the properties.
 Properties getDatabaseDriverProperties(String dbDriverPrefix)
          Obtains database driver specific properties.
 String getDatabaseSchemaName(String dbSchemaPrefix)
          Gets the name of the database schema name from the properties.
 Properties getDatabaseSchemaProperties(String dbSchemaPrefix)
          Obtains the database schema specific properties.
 String getDatabaseURL(String dbDriverPrefix)
          Gets the Database URL from Properties file, the URL is a contact string to the database.
 File getDataDir()
          Accessor to $PEGASUS_HOME/share.
 String getDAXSchemaLocation()
          Gets the location of the DAX XML schema from properties, if available.
 File getLocalStateDir()
          Accessor to $PEGASUS_HOME/var.
 String getPTCSchemaLocation()
          Helps the load database to locate the invocation record XML schema, if available.
 String getPTCSchemaName()
          Obtains the fully qualified class name of the PTC-implementing database schema.
 String getRCLocation()
          Get the rc.data file location, which is used by shell planner
 String getReplicaCatalogName(String dbReplicaPrefix)
          Gets the name of the replica catalog implementating class from the properties.
 Properties getReplicaCatalogProperties(String dbReplicaPrefix)
          Obtains all properties to handle the experimental replica catalog interface.
 File getSysConfDir()
          Accessor to $PEGASUS_HOME/etc.
 String getTCLocation()
          Get the tc.data file location, which is used by shell planner
 String getVDCSchemaName()
          Get the fully qualified class name of the VDC-implementing database schema.
 String getVDLSchemaLocation()
          Gets the location the VDLx XML schema from properties, if available.
 String getVDSHome()
          Accessor: Obtains the root directory of the VDS/Chimera runtime system.
private  VDSProperties getVDSPropertiesInstance()
          Gets the handle to the property file.
 String getWFSchemaName()
          Obtains the fully qualified class name of the WF-implementing database schema.
static ChimeraProperties instance()
          To get a reference to the the object.
 Properties matchingSubset(String prefix)
          Extracts a specific property key subset from the known properties.
 void setupLogging(Logging logger)
          Set up logging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VDL_SCHEMA_LOCATION

public static final String VDL_SCHEMA_LOCATION
Default values for schema locations.

See Also:
Constant Field Values

DAX_SCHEMA_LOCATION

public static final String DAX_SCHEMA_LOCATION
See Also:
Constant Field Values

IVR_SCHEMA_LOCATION

public static final String IVR_SCHEMA_LOCATION
See Also:
Constant Field Values

DB_ALL_PREFIX

public static final String DB_ALL_PREFIX
See Also:
Constant Field Values

DBDRIVER_ALL_PREFIX

public static final String DBDRIVER_ALL_PREFIX
See Also:
Constant Field Values

m_instance

private static ChimeraProperties m_instance
Implements the Singleton access.


m_home

private String m_home
The value of the PEGASUS_HOME environment variable.


m_props

private VDSProperties m_props
The object holding all the properties pertaining to the VDS system.

Constructor Detail

ChimeraProperties

private ChimeraProperties()
                   throws IOException,
                          MissingResourceException
Constructor that is called only once, when creating the Singleton instance.

Throws:
IOException
MissingResourceException
Method Detail

instance

public static ChimeraProperties instance()
                                  throws IOException,
                                         MissingResourceException
To get a reference to the the object.

Throws:
IOException
MissingResourceException

getVDSPropertiesInstance

private VDSProperties getVDSPropertiesInstance()
                                        throws IOException,
                                               MissingResourceException
Gets the handle to the property file.

Throws:
IOException
MissingResourceException

setupLogging

public void setupLogging(Logging logger)
Set up logging


getSysConfDir

public File getSysConfDir()
Accessor to $PEGASUS_HOME/etc. The files in this directory have a low change frequency, are effectively read-only, they reside on a per-machine basis, and they are valid usually for a single user.

Returns:
the "etc" directory of the VDS runtime system.

getVDSHome

public String getVDSHome()
Accessor: Obtains the root directory of the VDS/Chimera runtime system.

Returns:
the root directory of the VDS runtime system, as initially set from the system properties.

getLocalStateDir

public File getLocalStateDir()
Accessor to $PEGASUS_HOME/var. The files in this directory have a high change frequency, are effectively read-write, they reside on a per-machine basis, and they are valid usually for a single user.

Returns:
the "var" directory of the VDS runtime system.

getDataDir

public File getDataDir()
Accessor to $PEGASUS_HOME/share. The files in this directory have a low change frequency, are effectively read-only, can be shared via a networked FS, and they are valid for multiple users.

Returns:
the "share" directory of the VDS runtime system.

getVDCSchemaName

public String getVDCSchemaName()
Get the fully qualified class name of the VDC-implementing database schema. If no properties are configured, it returns the file-based VDC-schema implementation.

Returns:
the fully-qualified name of the class which implements the VDC according to properties.
See Also:
SingleFileSchema

getPTCSchemaName

public String getPTCSchemaName()
Obtains the fully qualified class name of the PTC-implementing database schema.

Returns:
the fully-qualified name of the class which implements the PTC according to properties, or null, if no such class exists.

getWFSchemaName

public String getWFSchemaName()
Obtains the fully qualified class name of the WF-implementing database schema.

Returns:
the fully-qualified name of the class which implements the WF according to properties, or null, if no such class exists.

getVDLSchemaLocation

public String getVDLSchemaLocation()
Gets the location the VDLx XML schema from properties, if available. Please note that the schema location URL in the instance document is only a hint, and may be overriden by the findings of this method.

Returns:
a location pointing to a definition document of the XML schema that can read VDLx. Result may be null, if such a document is unknown or unspecified.
See Also:
VDLxParser.VDLxParser( String )

getDAXSchemaLocation

public String getDAXSchemaLocation()
Gets the location of the DAX XML schema from properties, if available. Please note that the schema location URL in the instance document is only a hint, and may be overriden by the findings of this method.

Returns:
a location pointing to a definition document of the XML schema that can read DAX. Result may be null, if such a document is unknown or unspecified.
See Also:
DAXParser.DAXParser( String )

getPTCSchemaLocation

public String getPTCSchemaLocation()
Helps the load database to locate the invocation record XML schema, if available. Please note that the schema location URL in the instance document is only a hint, and may be overriden by the findings of this method.

Returns:
a location pointing to a definition document of the XML schema that can read DAX. Result may be null, if such a document is unknown or unspecified.
See Also:
InvocationParser.InvocationParser( String )

getRCLocation

public String getRCLocation()
Get the rc.data file location, which is used by shell planner


getTCLocation

public String getTCLocation()
Get the tc.data file location, which is used by shell planner


getDatabaseSchemaName

public String getDatabaseSchemaName(String dbSchemaPrefix)
Gets the name of the database schema name from the properties.

Parameters:
dbSchemaPrefix - is the database schema key name in the properties file, which happens to be the pointer to the class to load.
Returns:
the database schema name, result may be null, if such property is not specified.

getDatabaseDriverName

public String getDatabaseDriverName(String dbDriverPrefix)
Gets then name of the database driver from the properties. A specific match is preferred over the any match.

Parameters:
dbDriverPrefix - is the database schema key name in the properties file, which happens to be the pointer to the class to load.
Returns:
the database driver name, result may be null, if such property is not specified.

getDatabaseURL

public String getDatabaseURL(String dbDriverPrefix)
Gets the Database URL from Properties file, the URL is a contact string to the database. The URL contact string is removed from the regular properties which are passed to the JDBC driver.

Parameters:
dbDriverPrefix - is the database schema key name.
Returns:
the database url, result may be null, if the driver URL is not specified.
See Also:
getDatabaseDriverProperties( String )

matchingSubset

public Properties matchingSubset(String prefix)
Extracts a specific property key subset from the known properties. The prefix is removed from the keys in the resulting dictionary.

Parameters:
prefix - is the key prefix to filter the properties by.
Returns:
a property dictionary matching the filter key. May be an empty dictionary, if no prefix matches were found.

getDatabaseDriverProperties

public Properties getDatabaseDriverProperties(String dbDriverPrefix)
Obtains database driver specific properties.

Parameters:
dbDriverPrefix - is the database driver property key prefix for which to obtain properties.
Returns:
a property set to be filled with driver specific properties. May be null if no such properties specified.

getDatabaseSchemaProperties

public Properties getDatabaseSchemaProperties(String dbSchemaPrefix)
Obtains the database schema specific properties.

Parameters:
dbSchemaPrefix - is the database schema key name in the properties file
Returns:
a property set to be filled with schema specific properties. May be null if no such properties specified.

getReplicaCatalogName

public String getReplicaCatalogName(String dbReplicaPrefix)
Gets the name of the replica catalog implementating class from the properties.

Parameters:
dbReplicaPrefix - is the replica catalog class name in the properties file.
Returns:
the replica catalog implementing class name, result may be null, if such property is not specified.

getReplicaCatalogProperties

public Properties getReplicaCatalogProperties(String dbReplicaPrefix)
Obtains all properties to handle the experimental replica catalog interface.

Parameters:
dbReplicaPrefix - is the prefix for the replica catalog's implementation configuration.
Returns:
all properties, excluding the prefix itself, for the RC.


Copyright © 2007 The University of Southern California. All Rights Reserved.