com.infoengine.au
Class DirectoryProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended bycom.infoengine.au.DirectoryProperties
All Implemented Interfaces:
Cloneable, Map, Serializable

public class DirectoryProperties
extends Properties

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
private  String url
           
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
DirectoryProperties()
          Constructs an empty property list with no default values and no association to a directory entry.
DirectoryProperties(Properties defaults)
          Constructs an empty property list with the specified defaults, and no association to a directory entry.
DirectoryProperties(Properties defaults, String url)
          Constructs a property list with specified defaults, and with an association to a specified directory entry.
DirectoryProperties(String url)
          Constructs a property list with no defaults, but with an association to a specified directory entry.
 
Method Summary
static String getDirectoryProperty(String url, String key)
          Returns a specified property from a specified attribute of a specified directory entry.
static String getDirectoryProperty(String url, String key, String defaultValue)
          Returns a specified property from a specified attribute of a specified directory entry.
 String getUrl()
          Returns the URL of the directory entry from which properties were loaded.
 void setUrl(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, propertyNames, save, setProperty, store
 
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, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

url

private String url
Constructor Detail

DirectoryProperties

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


DirectoryProperties

public DirectoryProperties(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(String url)
                    throws IEException,
                           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
IOException - if properties can not be loaded successfully from the specified entry.

DirectoryProperties

public DirectoryProperties(Properties defaults,
                           String url)
                    throws IEException,
                           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
IOException - if properties can not be loaded successfully from the specified entry.
Method Detail

setUrl

public void setUrl(String url)
            throws IEException,
                   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.
IOException - if properties can not be loaded successfully from the specified entry.

getUrl

public 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 String getDirectoryProperty(String url,
                                          String key)
                                   throws IEException,
                                          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.
IOException - if properties can not be loaded successfully from the specified entry.

getDirectoryProperty

public static String getDirectoryProperty(String url,
                                          String key,
                                          String defaultValue)
                                   throws IEException,
                                          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.
IOException - if properties can not be loaded successfully from the specified entry.