1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
/**
* Gets a JNDI Context using the connection parameters specified for
* this Store in the Domain.
* @throws ServiceConnectionFailedException
*/
private DirContext getContext() throws ServiceConnectionFailedException {
getLogger().log( name + ": Connecting to LDAP server.", LOG_CHANNEL, Logger.DEBUG );
try {
DirContext ctx = new InitialDirContext( ctxParameters );
if ( ctx != null ) {
return ctx;
} else {
throw new ServiceConnectionFailedException(
this, "Invalid JNDI connection parameters." );
}
} catch ( NamingException e ) {
getLogger().log( name + ": Error Connecting to LDAP Server",
e,
LOG_CHANNEL,
Logger.CRITICAL );
throw new ServiceConnectionFailedException( this, e );
}
} |