Ejemplo n.º 1
0
 /**
  * Helper method to return Ldap connection to a embedded OpenDJ server.
  *
  * @return Ldap connection
  */
 private static LDAPConnection getLDAPConnection(
     String dsHostName, String dsPort, String dsManager, String dsAdminPwd) {
   LDAPConnection ld = null;
   try {
     int dsPortInt = Integer.parseInt(dsPort);
     ld = new LDAPConnection();
     ld.setConnectTimeout(300);
     ld.connect(3, dsHostName, dsPortInt, dsManager, dsAdminPwd);
   } catch (LDAPException ex) {
     Debug.getInstance(SetupConstants.DEBUG_NAME)
         .error("EmbeddedOpenDS.setup(). Error getting LDAPConnection:", ex);
   }
   return ld;
 }