edu.vt.middleware.ldap.props
Class LdapProperties

java.lang.Object
  extended by edu.vt.middleware.ldap.props.LdapProperties

public final class LdapProperties
extends Object

LdapProperties attempts to load the configuration properties from a properties file in the classpath for a PropertyConfig object. The default properties file is '/ldap.properties'.

Version:
$Revision: 1743 $ $Date: 2010-11-19 12:00:18 -0500 (Fri, 19 Nov 2010) $
Author:
Middleware Services

Field Summary
static String PROPERTIES_FILE
          Default file to read properties from, value is "/ldap.properties".
 
Constructor Summary
LdapProperties(PropertyConfig pc)
          This will create a new LdapProperties for the supplied properties config.
LdapProperties(PropertyConfig pc, InputStream is)
          This will create a new LdapProperties with the supplied properties properties config and input stream.
 
Method Summary
 void configure()
          Calls PropertyConfig.setEnvironmentProperties(Properties).
 Properties getProperties()
          This returns the name of the properties being used by this LdapProperties.
 boolean isPropertySet(String key)
          This returns whether the supplied key has already been set.
 void setProperty(String key, String value)
          This sets the supplied key and value in the ldap properties.
 void useDefaultPropertiesFile()
          This will load properties from the default properties file.
 void useProperties(InputStream is)
          This will load properties from the supplied input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTIES_FILE

public static final String PROPERTIES_FILE
Default file to read properties from, value is "/ldap.properties".

See Also:
Constant Field Values
Constructor Detail

LdapProperties

public LdapProperties(PropertyConfig pc)
This will create a new LdapProperties for the supplied properties config.

Parameters:
pc - object to set properties for

LdapProperties

public LdapProperties(PropertyConfig pc,
                      InputStream is)
This will create a new LdapProperties with the supplied properties properties config and input stream.

Parameters:
pc - object to set properties for
is - InputStream containing properties
Method Detail

useDefaultPropertiesFile

public void useDefaultPropertiesFile()
This will load properties from the default properties file.


useProperties

public void useProperties(InputStream is)
This will load properties from the supplied input stream.

Parameters:
is - InputStream containing properties

getProperties

public Properties getProperties()
This returns the name of the properties being used by this LdapProperties.

Returns:
Properties

setProperty

public void setProperty(String key,
                        String value)
This sets the supplied key and value in the ldap properties. The key will be prepended with the appropriate namespace.

Parameters:
key - String
value - String

isPropertySet

public boolean isPropertySet(String key)
This returns whether the supplied key has already been set. The key will be prepended with the appropriate namespace.

Parameters:
key - String
Returns:
boolean

configure

public void configure()
Calls PropertyConfig.setEnvironmentProperties(Properties).



Copyright © 2003-2010 Virginia Tech. All Rights Reserved.