com.infoengine.au
Class DirectoryProperties

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 com.infoengine.au.DirectoryProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class DirectoryProperties
extends java.util.Properties

This class implements a Properties class that obtains properties from a directory service.

Version:
1.0 8/6/2000
See Also:
Serialized Form

Constructor Summary
DirectoryProperties()
          Constructs an empty property list with no default values and no association to a directory entry.
DirectoryProperties(java.util.Properties defaults)
          Constructs an empty property list with the specified defaults, and no association to a directory entry.
DirectoryProperties(java.util.Properties defaults, java.lang.String url)
          Constructs a property list with specified defaults, and with an association to a specified directory entry.
DirectoryProperties(java.lang.String url)
          Constructs a property list with no defaults, but with an association to a specified directory entry.
 
Method Summary
static java.lang.String getDirectoryProperty(java.lang.String url, java.lang.String key)
          Returns a specified property from a specified attribute of a specified directory entry.
static java.lang.String getDirectoryProperty(java.lang.String url, java.lang.String key, java.lang.String defaultValue)
          Returns a specified property from a specified attribute of a specified directory entry.
 java.lang.String getUrl()
          Returns the URL of the directory entry from which properties were loaded.
 void setUrl(java.lang.String url)
          Sets the URL of the directory entry from which properties are obtained.
 
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, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryProperties

public DirectoryProperties()
Constructs an empty property list with no default values and no association to a directory entry.


DirectoryProperties

public DirectoryProperties(java.util.Properties defaults)
Constructs an empty property list with the specified defaults, and no association to a directory entry.

Parameters:
defaults - the defaults.

DirectoryProperties

public DirectoryProperties(java.lang.String url)
                    throws IEException,
                           java.io.IOException
Constructs a property list with no defaults, but with an association to a specified directory entry.

Parameters:
url - The LDAP URL of a directory entry. The URL must specify the attribute(s) to be read from the entry.
Throws:
IEException - if the URL can not be used to read the specified directory entry successfully, or the JNDI adapter can not be loaded or initialized successfully
java.io.IOException - if properties can not be loaded successfully from the specified entry.

DirectoryProperties

public DirectoryProperties(java.util.Properties defaults,
                           java.lang.String url)
                    throws IEException,
                           java.io.IOException
Constructs a property list with specified defaults, and with an association to a specified directory entry.

Parameters:
defaults - the defaults.
url - The LDAP URL of a directory entry. The URL must specify the attribute(s) to be read from the entry.
Throws:
IEException - if the URL can not be used to read the specified directory entry successfully, or the JNDI adapter can not be loaded or initialized successfully
java.io.IOException - if properties can not be loaded successfully from the specified entry.
Method Detail

setUrl

public void setUrl(java.lang.String url)
            throws IEException,
                   java.io.IOException
Sets the URL of the directory entry from which properties are obtained.

Parameters:
url - The LDAP URL of a directory entry. The URL must specify the attribute(s) containing properties to be read from the entry.
Throws:
IEException - if the URL can not be used to read the specified directory entry successfully.
java.io.IOException - if properties can not be loaded successfully from the specified entry.

getUrl

public java.lang.String getUrl()
Returns the URL of the directory entry from which properties were loaded.

Returns:
The LDAP URL of the directory entry currently associated with the stream.

getDirectoryProperty

public static java.lang.String getDirectoryProperty(java.lang.String url,
                                                    java.lang.String key)
                                             throws IEException,
                                                    java.io.IOException
Returns a specified property from a specified attribute of a specified directory entry.

Parameters:
url - The LDAP URL of a directory entry. The URL must specify the attribute(s) containing properties to be read from the entry.
key - The name of the property to return.
Returns:
The value of the specified property, or null if the specified property is not found in the directory entry.
Throws:
IEException - if the URL can not be used to read the specified directory entry successfully.
java.io.IOException - if properties can not be loaded successfully from the specified entry.

getDirectoryProperty

public static java.lang.String getDirectoryProperty(java.lang.String url,
                                                    java.lang.String key,
                                                    java.lang.String defaultValue)
                                             throws IEException,
                                                    java.io.IOException
Returns a specified property from a specified attribute of a specified directory entry.

Parameters:
url - The LDAP URL of a directory entry. The URL must specify the attribute(s) containing properties to be read from the entry.
key - The name of the property to return.
defaultValue - The value to return when the specified property can not be found in the specified directory entry.
Returns:
The value of the specified property, or the default value if the specified property is not found in the directory entry.
Throws:
IEException - if the URL can not be used to read the specified directory entry successfully.
java.io.IOException - if properties can not be loaded successfully from the specified entry.