org.gridbus.broker.farming.common
Class BrokerProperties

java.lang.Object
  |
  +--org.gridbus.broker.farming.common.BrokerProperties

public class BrokerProperties
extends java.lang.Object

This is the class which contains the global properties for the broker (loaded from Broker.properties file at runtime)

Author:
Srikumar Venugopal (srikumar@cs.mu.oz.au)

Field Summary
static java.lang.String VERSION
          Represents the version of the Broker
 
Constructor Summary
BrokerProperties()
           
 
Method Summary
static java.util.Properties getBrokerProperties()
           
static java.lang.String getProperty(java.lang.String key)
          Returns a specified property or null if it doesn't exist.
static java.lang.String getProperty(java.lang.String key, java.lang.String def)
          Returns a single property value for the given "key"
static void setBrokerProperties(java.util.Properties prop)
          Sets all the broker properties at once
static void setProperty(java.lang.String key, java.lang.String val)
          Sets the property key with the value val
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Represents the version of the Broker

See Also:
Constant Field Values
Constructor Detail

BrokerProperties

public BrokerProperties()
Method Detail

getProperty

public static java.lang.String getProperty(java.lang.String key)
                                    throws GridBrokerException
Returns a specified property or null if it doesn't exist.

Parameters:
key - The name or 'key' of the property
Returns:
String with the property contents, or null if property doesn't exist.
Throws:
GridBrokerException - If BrokerProperties.setBrokerProperties() has not been called.

getProperty

public static java.lang.String getProperty(java.lang.String key,
                                           java.lang.String def)
Returns a single property value for the given "key"

Parameters:
key - : the name of the property to get
def - : default value to return
Returns:
property value

setBrokerProperties

public static void setBrokerProperties(java.util.Properties prop)
Sets all the broker properties at once

Parameters:
prop - : Properties object which contains all the properties

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String val)
                        throws GridBrokerException
Sets the property key with the value val

Parameters:
key - : name of the property to set
val - : value of the property to be set
Throws:
GridBrokerException

getBrokerProperties

public static java.util.Properties getBrokerProperties()
Returns:
the broker Properties