JNDI connection services.

Connection Factory Configuration using JNDI

Metadata accessed through the Java Naming and Directory Interface (JNDI) is expected to be stored in an Lightweight Directory Access Protocol (LDAP) server using the IT Administrator tool. IOM servers and logins defined this way are identified to a connection factory using a logical name. You must also provide a live connection to the LDAP server and a search context.

If the metadata defines a connection pool, then the two-tiered security model dictates that the metadata repository be used authenticate factory users. You may provide an authentication domain name for the ldap server, and the connection factory will include this name in it's list of valid authentication domains if it is configured for pooling. If you do not provide a name, and empty string will be used, if necessary.

The following code fragment demonstrates connection factory configuration using JNDI metadata.

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,"ldap://ldap.abc.com:389");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"cn=admin,o=ABC,c=US");
env.put(Context.SECURITY_CREDENTIALS,"admin1");
DirContext ctx = new InitialDirContext(env);
String searchContext = "o=ABC,c=US";
String logicalName = "myServer";
String ldapServerDomain = "LDAP";
ConnectionFactoryConfiguration cxfConfig = new JNDIConnectionFactoryConfiguration(ctx,searchContext,logicalName,ldapServerDomain);