toolbox.allegato
Class JNDIConfig

Package class diagram package JNDIConfig
java.lang.Object
  extended by toolbox.allegato.JNDIConfig

public class JNDIConfig
extends java.lang.Object

Encapsulates the JNDI naming context config specified in an XML document and provides methods to create Context and DirContext instances.


Constructor Summary
JNDIConfig()
          Default constructor.
JNDIConfig(java.lang.String name, XMLProperties xmlProps)
          Creates a new JNDI config with the given XML Properties.
 
Method Summary
 javax.naming.Context createContext()
          Create an initial context with the configuration encapsulated by this config object.
 javax.naming.directory.DirContext createDirContext()
          Create an initial dir context with the configuration encapsulated by this config object.
 java.lang.String getAuthentication()
          Returns the security authentication used by this config object to initialise the initial context.
 java.lang.String getConnectionPooling()
          Returns the connection pooling flag used by this config object to initialise the initial context.
 java.lang.String getCredentials()
          Returns the security credentials used by this config object to initialise the intitial context.
 java.lang.String getFactoryInitial()
          Returns the name fo the initial context factory used by this config object.
 java.lang.String getObjectFactories()
          Returns the value of the object factories property.
 java.lang.String getPrincipal()
          Returns the security principal used by this config object to initialise the intial context.
 java.lang.String getProviderUrl()
          Returns the provider specific URL used by this config object to initialise the initial context.
 java.lang.String getSecurityProtocol()
          Returns the security protocol used by this ocnfiguration object.
 java.lang.String getStateFactories()
          Returns the value of the state factories property.
 java.lang.String getType()
          Returns the type of this config object.
 void setAuthentication(java.lang.String authentication)
          Sets the security authentication used by this config object to initialise the initial context.
 void setConnectionPooling(java.lang.String pooling)
          Sets the connection pooling flag used by this config object to initialise the initial context.
 void setCredentials(java.lang.String credentials)
          Sets the security credentials used by this config object to intialise the initial context.
 void setFactoryInitial(java.lang.String ctxFactory)
          Sets the name of the initial context factory used by this config object.
 void setObjectFactories(java.lang.String objectFactories)
          Sets the value of the object factories property used by this config object.
 void setPrincipal(java.lang.String principal)
          Sets the security principal used by this config object to initialise the initial context.
 void setProviderUrl(java.lang.String url)
          Sets the provider specific URL used by this config object to initialise the initial context.
 void setSecurityProtocol(java.lang.String protocol)
          Sets the security protocol to be used by this configuration.
 void setStateFactories(java.lang.String stateFactories)
          Sets the value of the state factories property used by this config object.
 void setType(java.lang.String type)
          Sets the type of JNDIConfig, file or ldap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JNDIConfig

public JNDIConfig()
Default constructor.


JNDIConfig

public JNDIConfig(java.lang.String name,
                  XMLProperties xmlProps)
           throws ConfException
Creates a new JNDI config with the given XML Properties.

Parameters:
name - The name of the JNDI configuration to create.
xmlProps - XMLProperties object containing a valid JNDIConfig element.
Throws:
ConfException - if an error occured while accessing the configuration properties.
Method Detail

setType

public void setType(java.lang.String type)
Sets the type of JNDIConfig, file or ldap.

Parameters:
type - New config type.

getType

public java.lang.String getType()
Returns the type of this config object.

Returns:
String specifying the type of this config object.

setFactoryInitial

public void setFactoryInitial(java.lang.String ctxFactory)
Sets the name of the initial context factory used by this config object.

Parameters:
ctxFactory - Name of the initial context factory.

getFactoryInitial

public java.lang.String getFactoryInitial()
Returns the name fo the initial context factory used by this config object.

Returns:
String containing the name of the intial context factory.

setProviderUrl

public void setProviderUrl(java.lang.String url)
Sets the provider specific URL used by this config object to initialise the initial context.

Parameters:
url - Provider specific URL.

getProviderUrl

public java.lang.String getProviderUrl()
Returns the provider specific URL used by this config object to initialise the initial context.

Returns:
String containing the provider specific URL.

setConnectionPooling

public void setConnectionPooling(java.lang.String pooling)
Sets the connection pooling flag used by this config object to initialise the initial context.

Parameters:
pooling - String containing pooling flag.

getConnectionPooling

public java.lang.String getConnectionPooling()
Returns the connection pooling flag used by this config object to initialise the initial context.

Returns:
String containing the pooling flag.

setPrincipal

public void setPrincipal(java.lang.String principal)
Sets the security principal used by this config object to initialise the initial context.

Parameters:
principal - Security principal.

getPrincipal

public java.lang.String getPrincipal()
Returns the security principal used by this config object to initialise the intial context.

Returns:
String containing the value of the security principal.

setCredentials

public void setCredentials(java.lang.String credentials)
Sets the security credentials used by this config object to intialise the initial context.

Parameters:
credentials - Security credentials.

getCredentials

public java.lang.String getCredentials()
Returns the security credentials used by this config object to initialise the intitial context.

Returns:
String containing the security credentials.

setAuthentication

public void setAuthentication(java.lang.String authentication)
Sets the security authentication used by this config object to initialise the initial context.

Parameters:
authentication - Security authentication

getAuthentication

public java.lang.String getAuthentication()
Returns the security authentication used by this config object to initialise the initial context.

Returns:
String containing the security authentication.

setSecurityProtocol

public void setSecurityProtocol(java.lang.String protocol)
Sets the security protocol to be used by this configuration.

Parameters:
protocol - String indicating the security protocol to use e.g "ssl"

getSecurityProtocol

public java.lang.String getSecurityProtocol()
Returns the security protocol used by this ocnfiguration object.

Returns:
String containing the security protocol.

setObjectFactories

public void setObjectFactories(java.lang.String objectFactories)
Sets the value of the object factories property used by this config object.

Parameters:
objectFactories - Value of the object factories property.

getObjectFactories

public java.lang.String getObjectFactories()
Returns the value of the object factories property.

Returns:
String containing the value of the object factories property.

setStateFactories

public void setStateFactories(java.lang.String stateFactories)
Sets the value of the state factories property used by this config object.

Parameters:
stateFactories - Value of the state factories property.

getStateFactories

public java.lang.String getStateFactories()
Returns the value of the state factories property.

Returns:
String containing the value of the state factories property.

createContext

public javax.naming.Context createContext()
                                   throws javax.naming.NamingException
Create an initial context with the configuration encapsulated by this config object.

Returns:
Context instance.
Throws:
javax.naming.NamingException - if the JNDI context could not be created.

createDirContext

public javax.naming.directory.DirContext createDirContext()
                                                   throws javax.naming.NamingException
Create an initial dir context with the configuration encapsulated by this config object.

Returns:
DirContext instance.
Throws:
javax.naming.NamingException - if the JNDI dir context could not be created.