org.edg.data.reptor
Class Configuration

java.lang.Object
  extended byorg.edg.data.reptor.Configuration

public class Configuration
extends java.lang.Object

Configuration class to manage the ReplicaManager configuration file and configuration options.

Version:
$Id: Configuration.java,v 1.23 2004/08/12 13:31:54 jamesc Exp $
Author:
James Casey, Peter Kunszt

Constructor Summary
Configuration(java.lang.String configResource, java.lang.String vo)
          Initialize the properties from the given resource
 
Method Summary
 void addTimingAppender(org.apache.log4j.Logger theLogger)
           
 java.lang.String getConfigResource()
          Return the configuration file this Configuration was created from
 java.lang.String getDefaultComputingElementHost()
          Return the default CE host
 java.lang.String getDefaultStorageElementHost()
          Return the default SE host
 java.lang.String getProperty(java.lang.String key)
          Get the property identified by a certain key.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Get the property identified by a certain key, or if it's not available, the default value.
 java.lang.String getStorageHost(java.lang.String seHost)
           
 java.lang.String getVO()
          Return the VO name
 InfoService infoService()
          Return the InfoService interface
 boolean isSecure()
          Return whether the security flag is set
 boolean isVerbose()
          Return whether the verbosity flag is set
 void makeTimingAppender(java.lang.String fileName)
           
static java.util.Properties readConfig(java.lang.String configResource)
          Read the configuration resource.
 void setSecure()
          Set the insecure flag
 void setVerbose()
          Set the verbosity flag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.lang.String configResource,
                     java.lang.String vo)
              throws org.edg.data.util.InvalidConfigurationException,
                     InfoServiceException
Initialize the properties from the given resource

Parameters:
configResource - The resource on the classpath to load the properties from.
Throws:
org.edg.data.util.InvalidConfigurationException - if the file cannot be accessed for some reason.
InfoServiceException
Method Detail

setVerbose

public void setVerbose()
Set the verbosity flag


setSecure

public void setSecure()
Set the insecure flag


isVerbose

public boolean isVerbose()
Return whether the verbosity flag is set

Returns:
true or false

isSecure

public boolean isSecure()
Return whether the security flag is set

Returns:
true or false

getConfigResource

public java.lang.String getConfigResource()
Return the configuration file this Configuration was created from

Returns:
configuration resource

infoService

public InfoService infoService()
Return the InfoService interface

Returns:
info service

getVO

public java.lang.String getVO()
Return the VO name

Returns:
the VO name

getProperty

public java.lang.String getProperty(java.lang.String key)
Get the property identified by a certain key.

Parameters:
key - The string identifying the property.
Returns:
the property value, if any or null if the property does not exist.

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Get the property identified by a certain key, or if it's not available, the default value.

Parameters:
key - The string identifying the property.
defaultValue - The string identifying the default for this property.
Returns:
the property value.

getDefaultComputingElementHost

public java.lang.String getDefaultComputingElementHost()
Return the default CE host

Returns:
the Computing Element that is the default one.

getDefaultStorageElementHost

public java.lang.String getDefaultStorageElementHost()
Return the default SE host

Returns:
the Storage Element that is the default one.

readConfig

public static java.util.Properties readConfig(java.lang.String configResource)
                                       throws org.edg.data.util.InvalidConfigurationException
Read the configuration resource.

Parameters:
configResource - the file name.
Throws:
org.edg.data.util.InvalidConfigurationException - if the configuration resource was not found on the classpath or can't be read.

makeTimingAppender

public void makeTimingAppender(java.lang.String fileName)

addTimingAppender

public void addTimingAppender(org.apache.log4j.Logger theLogger)

getStorageHost

public java.lang.String getStorageHost(java.lang.String seHost)