no.feide.moria.directory.backend
Class JNDIBackendFactory

java.lang.Object
  extended by no.feide.moria.directory.backend.JNDIBackendFactory
All Implemented Interfaces:
DirectoryManagerBackendFactory

public class JNDIBackendFactory
extends java.lang.Object
implements DirectoryManagerBackendFactory

Factory class for JNDI backends.


Field Summary
private  int backendTimeouts
          The number of seconds before a backend connection times out.
private  java.lang.String guessedAttribute
          The name of the attribute used to guess the user element's (R)DN, if it cannot be found by searching.
private  java.lang.String usernameAttribute
          The name of the attribute containing the username.
private  boolean useSSL
          Whether the backend should use SSL.
 
Constructor Summary
JNDIBackendFactory()
           
 
Method Summary
 DirectoryManagerBackend createBackend(java.lang.String sessionTicket)
          Creates a new JNDIBackend instance.
 void setConfig(org.jdom.Element config)
          Sets the factory-specific configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

backendTimeouts

private int backendTimeouts
The number of seconds before a backend connection times out. Default is 15 seconds.


useSSL

private boolean useSSL
Whether the backend should use SSL. Default is false.


usernameAttribute

private java.lang.String usernameAttribute
The name of the attribute containing the username.


guessedAttribute

private java.lang.String guessedAttribute
The name of the attribute used to guess the user element's (R)DN, if it cannot be found by searching.

Constructor Detail

JNDIBackendFactory

public JNDIBackendFactory()
Method Detail

setConfig

public final void setConfig(org.jdom.Element config)
                     throws DirectoryManagerConfigurationException
Sets the factory-specific configuration. Must be called before creating a new backend, or the backend will not work as intended.

Note that using this method with an updated configuration that modifies any JVM global settings (currently all settings in the Security element) is likely to cause any open backend connections to fail.

Specified by:
setConfig in interface DirectoryManagerBackendFactory
Parameters:
config - The configuration for this backend factory. The root node must be a JNDI element, containing an optional Security element, which in turn may contain an optional Truststore element. If the Truststore exists, it must contain the attributes filename and password, giving the truststore file location and password, respectively. The JNDI element may contain an optional attribute timeout, which gives the number of seconds before a backend connection should time out. If this value is a negative number, the timeout value will be set to zero (meaning the connection will never time out). Also, the JNDI element may contain an attribute guessedAttribute, which should give the name of an attribute used to construct "guessed" user element (R)DNs if the actual element cannot be found by searching (the default value is uid). Finally the JNDI element must contain an attribute usernameAttribute, which should give the name of the attribute holding the username.
Throws:
java.lang.IllegalArgumentException - If config is null.
DirectoryManagerConfigurationException - If the configuration element is not a JNDI Backend element, or if the optional Truststore element is found, but without either of the filename or password attributes. Also thrown if the timeout attribute contains an illegal timeout value, if the username attribute does not exist, if the guess attribute does not exist, or if the filename file does not exist.
See Also:
DirectoryManagerBackendFactory.setConfig(Element)

createBackend

public final DirectoryManagerBackend createBackend(java.lang.String sessionTicket)
Creates a new JNDIBackend instance.

Specified by:
createBackend in interface DirectoryManagerBackendFactory
Parameters:
sessionTicket - The session ticket passed on to instances of DirectoryManagerBackend (actually JNDIBackend instances) for logging purposes. May be null or an empty string.
Returns:
The new JNDIBackend.
See Also:
DirectoryManagerBackendFactory.createBackend(String)


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.