oemware.core
Class ServiceConf

java.lang.Object
  extended by oemware.core.ServiceConf

public final class ServiceConf
extends java.lang.Object

The service config object. This wraps both the instance and the node conf together. The instance conf is checked first and if nothing is found, the node conf is checked.

Version:
$Id: ServiceConf.java 13 2008-06-15 19:43:04Z oemware $

Constructor Summary
ServiceConf(InstanceConf pGlobalNodeConf, InstanceConf pNodeConf, InstanceConf pInstanceConf)
          Construct a new instance.
 
Method Summary
 java.lang.String getBaseDir()
           
 java.lang.String getDataDir()
           
 java.lang.String getEnvName()
           
 InstanceConf getInstanceConf()
           
 short getInstanceId()
           
 int getIntProperty(java.lang.String pName)
          Returns an integer property value (works same as string version).
 int getIntProperty(java.lang.String pName, int pDefault)
          Returns an integer property value (works same as string version).
 long getLongProperty(java.lang.String pName, long pDefault)
          Returns a long property value (works same as string version).
 InstanceConf getNodeConf()
           
 short getNodeId()
           
 java.lang.String getProperty(java.lang.String pName)
          Returns the property
 java.lang.String getProperty(java.lang.String pName, java.lang.String pDefault)
          Returns the property
 java.lang.String getServiceName()
           
 short getShortProperty(java.lang.String pName)
          Returns a short property value (works same as string version).
 short getShortProperty(java.lang.String pName, short pDefault)
          Returns a short property value (works same as string version).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceConf

public ServiceConf(InstanceConf pGlobalNodeConf,
                   InstanceConf pNodeConf,
                   InstanceConf pInstanceConf)
            throws ServiceException
Construct a new instance.

Parameters:
pGlobalNodeConf - The global node conf.
pNodeConf - The node conf.
pInstanceConf - The instance conf.
Throws:
ServiceException
Method Detail

getNodeConf

public final InstanceConf getNodeConf()

getInstanceConf

public final InstanceConf getInstanceConf()

getProperty

public final java.lang.String getProperty(java.lang.String pName)
                                   throws ServiceException
Returns the property

Parameters:
pName - The property name (required).
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getProperty

public final java.lang.String getProperty(java.lang.String pName,
                                          java.lang.String pDefault)
                                   throws ServiceException
Returns the property

Parameters:
pName - The property name (required).
pDefault - Is returned if not found in config files.
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getIntProperty

public final int getIntProperty(java.lang.String pName)
                         throws ServiceException
Returns an integer property value (works same as string version).

Parameters:
pName - The property name (required).
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getIntProperty

public final int getIntProperty(java.lang.String pName,
                                int pDefault)
                         throws ServiceException
Returns an integer property value (works same as string version).

Parameters:
pName - The property name (required).
pDefault - The default value to pass if not found in config file.
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getShortProperty

public final short getShortProperty(java.lang.String pName)
                             throws ServiceException
Returns a short property value (works same as string version).

Parameters:
pName - The property name (required).
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getShortProperty

public final short getShortProperty(java.lang.String pName,
                                    short pDefault)
                             throws ServiceException
Returns a short property value (works same as string version).

Parameters:
pName - The property name (required).
pDefault - Is returned if not in config file.
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getLongProperty

public final long getLongProperty(java.lang.String pName,
                                  long pDefault)
                           throws ServiceException
Returns a long property value (works same as string version).

Parameters:
pName - The property name (required).
pDefault - Is returned if not in config file.
Returns:
The value. An exception is thrown if not available.
Throws:
ServiceException

getServiceName

public final java.lang.String getServiceName()

getEnvName

public final java.lang.String getEnvName()

getNodeId

public final short getNodeId()

getBaseDir

public final java.lang.String getBaseDir()

getDataDir

public final java.lang.String getDataDir()

getInstanceId

public final short getInstanceId()


Copyright © 2008 Deft Labs - Released under LGPL, Version 3.0