org.apache.juddi.util
Class Config

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by org.apache.juddi.util.Config
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class Config
extends java.util.Properties

This class provides read access to key/value pairs loaded from a properties file.

Author:
Steve Viens (sviens@apache.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Method Summary
static void addProperties(java.util.Properties props)
          Returns a reference to the singleton Properties instance.
static boolean getBooleanProperty(java.lang.String key, boolean defaultValue)
          Get a configuration property as a boolean primitive.
static java.lang.String getDiscoveryURL()
           
static int getIntProperty(java.lang.String key, int defaultValue)
          Get a configuration property as an int primitive.
static long getLongProperty(java.lang.String key, long defaultValue)
          Get a configuration property as an long primitive.
static int getMaxBindingsPerService()
           
static int getMaxBusinessesPerPublisher()
           
static int getMaxNameElementsAllowed()
           
static int getMaxNameLengthAllowed()
           
static int getMaxServicesPerBusiness()
           
static int getMaxTModelsPerPublisher()
           
static java.lang.String getOperator()
           
static java.util.Properties getProperties()
          Returns a reference to the singleton Properties instance.
static java.lang.String getStringProperty(java.lang.String key)
          Retrieves a configuration property as a String object.
static java.lang.String getStringProperty(java.lang.String key, java.lang.String defaultValue)
          Retrieves a configuration property as a String object.
static java.net.URL getURLProperty(java.lang.String key, java.net.URL defaultValue)
          Get a configuration property as a URL object.
static void main(java.lang.String[] args)
           
static void setStringProperty(java.lang.String name, java.lang.String value)
          Sets a property value in jUDDI's property registry.
 java.lang.String toString()
          Returns a String containing a pipe-delimited ('|') list of name/value pairs.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, loadFromXML, propertyNames, save, setProperty, store, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

addProperties

public static void addProperties(java.util.Properties props)
Returns a reference to the singleton Properties instance.


getProperties

public static java.util.Properties getProperties()
Returns a reference to the singleton Properties instance.

Returns:
Config A reference to the singleton Properties instance.

getOperator

public static java.lang.String getOperator()

getDiscoveryURL

public static java.lang.String getDiscoveryURL()

getMaxNameLengthAllowed

public static int getMaxNameLengthAllowed()

getMaxNameElementsAllowed

public static int getMaxNameElementsAllowed()

getMaxBusinessesPerPublisher

public static int getMaxBusinessesPerPublisher()

getMaxServicesPerBusiness

public static int getMaxServicesPerBusiness()

getMaxBindingsPerService

public static int getMaxBindingsPerService()

getMaxTModelsPerPublisher

public static int getMaxTModelsPerPublisher()

getStringProperty

public static java.lang.String getStringProperty(java.lang.String key,
                                                 java.lang.String defaultValue)
Retrieves a configuration property as a String object. Loads the juddi.properties file if not already initialized.

Parameters:
key - Name of the property to be returned.
Returns:
Value of the property as a string or null if no property found.

getIntProperty

public static int getIntProperty(java.lang.String key,
                                 int defaultValue)
Get a configuration property as an int primitive.

Parameters:
key - Name of the numeric property to be returned.
Returns:
Value of the property as an Integer or null if no property found.

getLongProperty

public static long getLongProperty(java.lang.String key,
                                   long defaultValue)
Get a configuration property as an long primitive.

Parameters:
key - Name of the numeric property to be returned.
Returns:
Value of the property as an Long or null if no property found.

getBooleanProperty

public static boolean getBooleanProperty(java.lang.String key,
                                         boolean defaultValue)
Get a configuration property as a boolean primitive. Note that the value of the returned Boolean will be false if the property sought after exists but is not equal to "true" (ignoring case).

Parameters:
key - Name of the numeric property to be returned.
Returns:
Value of the property as an Boolean or null if no property found.

getURLProperty

public static java.net.URL getURLProperty(java.lang.String key,
                                          java.net.URL defaultValue)
Get a configuration property as a URL object.

Parameters:
key - Name of the url property to be returned.
Returns:
Value of the property as an URL or null if no property found.

getStringProperty

public static java.lang.String getStringProperty(java.lang.String key)
Retrieves a configuration property as a String object. Loads the juddi.properties file if not already initialized.

Parameters:
key - Name of the property to be returned.
Returns:
Value of the property as a string or null if no property found.

setStringProperty

public static void setStringProperty(java.lang.String name,
                                     java.lang.String value)
Sets a property value in jUDDI's property registry. Loads the juddi.properties file if not already initialized.

Parameters:
name - Name of the property to be returned.
value - Property value as a string.

toString

public java.lang.String toString()
Returns a String containing a pipe-delimited ('|') list of name/value pairs.

Overrides:
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>
Returns:
String pipe-delimited list of name/value pairs.

main

public static void main(java.lang.String[] args)


Copyright © 2004-2007. All Rights Reserved.