Examples of LDAPSearchResults


Examples of com.novell.ldap.LDAPSearchResults

    if (DebugFile.trace) {
      DebugFile.writeln("Begin LDAPNovell.exists(" + sSearchString + ")");
      DebugFile.incIdent();
    }

    LDAPSearchResults searchResults = null;

    try {
        searchResults = oConn.search(getPartitionName(), LDAPConnection.SCOPE_SUB, sSearchString, new String[] {"dn"}, true);
    }
    catch (com.novell.ldap.LDAPException e) {
        throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
    }

    boolean bExists = searchResults.hasMore();

    if (DebugFile.trace) {
      DebugFile.decIdent();
      DebugFile.writeln("End LDAPNovell.exists() : " + String.valueOf(bExists));
    }
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

    LDAPAttributeSet oAttrs;
    PreparedStatement oStmt;
    ResultSet oRSet;
    ResultSetMetaData oMDat;
    String sDN, sDomainNm, sWorkAreaNm;
    LDAPSearchResults searchResults = null;

    if (DebugFile.trace) {
      DebugFile.writeln("Begin LDAPNovell.loadDomain([Connection]" + String.valueOf(iDomainId) + ",...)");
      DebugFile.incIdent();
    }

    if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement(SELECT nm_domain FROM k_domains WHERE id_domain=" + String.valueOf(iDomainId) + ")");

    oStmt = oJdbc.prepareStatement("SELECT nm_domain FROM k_domains WHERE id_domain=?", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    oStmt.setInt(1, iDomainId);
    oRSet = oStmt.executeQuery();
    oRSet.next();
    sDomainNm = oRSet.getString(1);
    oRSet.close();
    oStmt.close();

    // *************
    // Create Domain

    sDN = "dc=" + sDomainNm + "," + getPartitionName();

    try {
      searchResults = oConn.search(getPartitionName(), LDAPConnection.SCOPE_ONE,"(dc=" + sDomainNm + ")", new String[] {"dn"}, true);
    }
    catch (com.novell.ldap.LDAPException e) {
      throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
    }

    if (!searchResults.hasMore())
      addHive(sDN, sDomainNm);

    // ****************
    // Create Workareas

    if (DebugFile.trace) DebugFile.writeln("Connection.prepareStatement(SELECT nm_workarea FROM k_workareas WHERE id_domain=" + String.valueOf(iDomainId) + ")");

    oStmt = oJdbc.prepareStatement("SELECT nm_workarea FROM k_workareas WHERE id_domain=?",ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    oStmt.setInt(1, iDomainId);
    oRSet = oStmt.executeQuery();

    while (oRSet.next()) {
      sWorkAreaNm = oRSet.getString(1);

      sDN = "dc=" + sWorkAreaNm + ",dc=" + sDomainNm + "," + getPartitionName();

      try {
        searchResults = oConn.search("dc=" + sDomainNm + "," + getPartitionName(), LDAPConnection.SCOPE_ONE,"(dc=" + sWorkAreaNm + ")", new String[] {"dn"}, true);
      }
      catch (com.novell.ldap.LDAPException e) {
        throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
      }

      if (!searchResults.hasMore()) {
        // Primero crear la rama de la WorkArea
        addHive (sDN, sWorkAreaNm);

        // Despues se crean los subcontenedores necesarios
        addHive ("dc=users," + sDN, "users");
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

  public void loadWorkArea (Connection oJdbc, String sDomainNm, String sWorkAreaNm)
    throws com.knowgate.ldap.LDAPException, java.sql.SQLException {

    LDAPAttributeSet oAttrs;
    String sDN;
    LDAPSearchResults searchResults = null;

    if (DebugFile.trace) {
      DebugFile.writeln("Begin LDAPNovell.loadWorkArea([Connection]" + sDomainNm + "," + sWorkAreaNm + ",...)");
      DebugFile.incIdent();
    }

    // **********************************
    // Create Domain if it does not exist

    sDN = "dc=" + sDomainNm + "," + getPartitionName();

    try {
      searchResults = oConn.search(getPartitionName(), LDAPConnection.SCOPE_ONE,"(dc=" + sDomainNm + ")", new String[] {"dn"}, true);
    }
    catch (com.novell.ldap.LDAPException e) {
      throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
    }

    if (!searchResults.hasMore())
      addHive(sDN, sDomainNm);

    // ***************
    // Create WorkArea

    sDN = "dc=" + sWorkAreaNm + ",dc=" + sDomainNm + "," + getPartitionName();

    try {
        searchResults = oConn.search("dc=" + sDomainNm + "," + getPartitionName(), LDAPConnection.SCOPE_ONE,"(dc=" + sWorkAreaNm + ")", new String[] {"dn"}, true);
    }
    catch (com.novell.ldap.LDAPException e) {
        throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
    }

    if (!searchResults.hasMore()) {
      // Primero crear la rama de la WorkArea
      addHive (sDN, sWorkAreaNm);

      // Despues se crean los subcontenedores necesarios
      addHive ("dc=users," + sDN, "users");
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

    String sDN = oEntry.getDN();
    LDAPEntry nextEntry;

    try {
      LDAPSearchResults searchResults = oConn.search(sDN, LDAPConnection.SCOPE_ONE,"(objectClass=*)",new String[] {"dn"}, true);

      while (searchResults.hasMore()) {
        try {
          nextEntry = searchResults.next();
        }
        catch (com.novell.ldap.LDAPException e) { continue; }

        deleteEntry (nextEntry);
      } // wend
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

    String sDN = "dc=" + sDomainNm + "," + getPartitionName();
    LDAPEntry oWrkAHive = null;

    try {
      LDAPSearchResults searchResults = oConn.search(sDN, LDAPConnection.SCOPE_ONE,"(dc=" + sWorkAreaNm + ")", new String[] {"dn"}, true);

      if (searchResults.hasMore()) {
        oWrkAHive = searchResults.next();
      }
    }
    catch (com.novell.ldap.LDAPException e) {
      throw new com.knowgate.ldap.LDAPException(e.getMessage(), e);
    }
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

    if (DebugFile.trace) {
      DebugFile.writeln("Begin LDAPNovell.dropAll()");
      DebugFile.incIdent();
    }

    LDAPSearchResults searchResults = null;
    LDAPEntry nextEntry = null;

    try {
        // Dropar todo el modelo de datos

        searchResults = oConn.search(getPartitionName(), LDAPConnection.SCOPE_ONE,"(objectClass=*)",new String[] {"dn"}, true);

        while (searchResults.hasMore()) {
          try {
            nextEntry = searchResults.next();
          }
          catch (LDAPException e) { continue; }

          if (!getPartitionName().equals(nextEntry.getDN()))
            deleteEntry(nextEntry); // No borrar el elemento raíz!!!
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

        // Pull all connections
        try {

            // Find all guac configs for this user
            LDAPSearchResults results = ldapConnection.search(
                    config_base_dn,
                    LDAPConnection.SCOPE_SUB,
                    "(&(objectClass=guacConfigGroup)(member=" + escapeLDAPSearchFilter(user_dn) + "))",
                    null,
                    false
            );

            // Add all configs
            Map<String, GuacamoleConfiguration> configs = new TreeMap<String, GuacamoleConfiguration>();
            while (results.hasMore()) {

                LDAPEntry entry = results.next();

                // New empty configuration
                GuacamoleConfiguration config = new GuacamoleConfiguration();

                // Get CN
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local",
          LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);

      while (ldapSearchResults.hasMore()){
        LDAPEntry ldapEntry = ldapSearchResults.next();
       
        LDAPAttribute ldapAttribute = ldapEntry.getAttribute("memberOf");
        if (ldapAttribute!=null){
          String memberOf = ldapAttribute.getStringValue();
          String[] items = memberOf.split(",");
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local", LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);

      while (ldapSearchResults.hasMore()){
        LDAPEntry ldapEntry = ldapSearchResults.next();
        if (user.equals(getValue(ldapEntry, "sAMAccountName"))){
          User searched = getUser(ldapEntry);
          searched.setPassword(password);
          return searched;
        }
View Full Code Here

Examples of com.novell.ldap.LDAPSearchResults

      connection.connect(config.getString(IP), new Integer(config.getString(PORT)));
     
      // Se autentica el usuario
      connection.bind(LDAPConnection.LDAP_V3, config.getString(DOMAIN)+ DOUBLE_BAR + user, password);
     
      LDAPSearchResults ldapSearchResults = connection.search("CN=Users,DC=" + config.getString(DOMAIN)+ ",DC=local", LDAPConnection.SCOPE_SUB, "(&(objectCategory=person)(objectClass=user))", null, Boolean.FALSE);

      while (ldapSearchResults.hasMore()){
        LDAPEntry ldapEntry = ldapSearchResults.next();
        User userActual = getUser(ldapEntry);
        // Solamente lista los usuarios que tienen un perfil asignado valido en iEvenTask
        if ((userActual.getProfile()!=null) && (userActual.getName()!=null) && (!"".equals(userActual.getName().trim()))){
          users.add(getUser(ldapEntry));
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.