Examples of LDAPEntry


Examples of com.novell.ldap.LDAPEntry

      attrs = new LDAPAttributeSet();
      attrs.add(new LDAPAttribute("objectClass", new String[] {"dcObject",
                                  "organizationalUnit"}));
      attrs.add(new LDAPAttribute("dc", sCN));
      attrs.add(new LDAPAttribute("ou", sCN));
      oConn.add(new LDAPEntry(sDN, attrs));
    }
    catch (com.novell.ldap.LDAPException xcpt) {
      throw new com.knowgate.ldap.LDAPException(xcpt.getMessage(), xcpt);
    }
  }
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

    }

    try {
      attrs.add(new LDAPAttribute("objectClass", new String[] {"inetOrgPerson",
                                  "organizationalPerson"}));
      oConn.add(new LDAPEntry(sDN, attrs));
    }
    catch (com.novell.ldap.LDAPException xcpt) {
      throw new com.knowgate.ldap.LDAPException(xcpt.getMessage() + " " + sDN, xcpt);
    }
  }
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

    if (null==oConn)
      throw new IllegalStateException ("LDAPNovell.deleteEntry() Not connected to LDAP");

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

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

      while (searchResults.hasMore()) {
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

   */
  public void deleteWorkArea (String sDomainNm, String sWorkAreaNm)
    throws com.knowgate.ldap.LDAPException, IllegalStateException {

    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()) {
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

      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!!!
        } // wend
    }
    catch (com.novell.ldap.LDAPException xcpt) {
      throw new com.knowgate.ldap.LDAPException (xcpt.getMessage(), xcpt);
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

            // 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
                LDAPAttribute cn = entry.getAttribute("cn");
                if (cn == null)
                    throw new GuacamoleException("guacConfigGroup without cn");

                // Get protocol
                LDAPAttribute protocol = entry.getAttribute("guacConfigProtocol");
                if (protocol == null)
                    throw new GuacamoleException("guacConfigGroup without guacConfigProtocol");

                // Set protocol
                config.setProtocol(protocol.getStringValue());

                // Get parameters, if any
                LDAPAttribute parameterAttribute = entry.getAttribute("guacConfigParameter");
                if (parameterAttribute != null) {

                    // For each parameter
                    Enumeration<String> parameters = parameterAttribute.getStringValues();
                    while (parameters.hasMoreElements()) {
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

     
      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(",");
          if (items!=null){
            Collection<String> cItems = Arrays.asList(items);;
View Full Code Here

Examples of com.novell.ldap.LDAPEntry

      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.LDAPEntry

      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

Examples of com.novell.ldap.LDAPEntry

    String requestedDN = null;
    LDAPConnection lc = getNewConnection(serverAddress, port, useSSL, connectionDN, connectionPassword);
    if (lc == null) {
      return null;
    }
    LDAPEntry entry = null;
    try {
      String searchFilter = "(&(objectClass=person)(sAMAccountName=" + username + "))";
          String[] attrs = { LDAPConnection.NO_ATTRS };
          // Search recursively, but don't return any attributes for found objects
      LDAPSearchResults searchResults = lc.search(baseDN, LDAPConnection.SCOPE_SUB, searchFilter, attrs, true);
      if (searchResults.hasMore()) {
        // Re-read the object to get the attributes now
        requestedDN = searchResults.next().getDN();
        // List all props just for fun.. (TODO: Remove this..)
        entry = lc.read(requestedDN);
        if (entry != null) {
          Iterator iter = entry.getAttributeSet().iterator();
          while (iter.hasNext()) {
            log.info(".. " + iter.next().toString().replaceAll("[^A-Za-z]", ""));
          }
        }
      } else {
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.