Package com.novell.ldap

Examples of com.novell.ldap.LDAPAttribute


            connection.bind(LDAPConnection.LDAP_V3, "cn=admin,dc=sei,dc=pku",
                    "seiseforge");
            connection.modify("uid=" + user.getUserName()
                    + ",ou=People,o=SEForge,dc=sei,dc=pku",
                    new LDAPModification(LdapContext.REPLACE_ATTRIBUTE,
                            new LDAPAttribute("userPassword", user
                                    .getPassword())));
            System.out.println("成功修改一条记录!");
            connection.disconnect();
        } catch (LDAPException e) {
            e.printStackTrace();
View Full Code Here


      // conn.authenticate("cn=Manager,dc=example,dc=com", "secret");
      conn.bind(ldapVersion, ROOT_DN, ROOT_PASSWORD.getBytes("utf-8"));

      System.out.println("========> create ldap entry " + EXO_DEVELOPER_DN);
      LDAPAttributeSet attributeSet = new LDAPAttributeSet();
      attributeSet.add(new LDAPAttribute("objectClass", "person"));
      attributeSet.add(new LDAPAttribute("cn", "exo"));
      attributeSet.add(new LDAPAttribute("sn", "platform"));
      attributeSet.add(new LDAPAttribute("telephonenumber", "0989654990"));
      LDAPEntry newEntry = new LDAPEntry(EXO_DEVELOPER_DN, attributeSet);
      conn.add(newEntry);
      System.out.println("<======Added object: " + EXO_DEVELOPER_DN + " successfully.");

      System.out.println("\nAdded object: " + EXO_DEVELOPER_DN + " successfully.");
View Full Code Here

   private void printLDAPAttributeSet(LDAPAttributeSet attrs)
   {
      Iterator<?> allAttributes = attrs.iterator();
      while (allAttributes.hasNext())
      {
         LDAPAttribute attribute = (LDAPAttribute)allAttributes.next();
         String attributeName = attribute.getName();
         System.out.print("\n    " + attributeName + ": ");
         Enumeration<?> allValues = attribute.getStringValues();
         if (allValues != null)
         {
            System.out.print("[");
            while (allValues.hasMoreElements())
            {
View Full Code Here

      // conn.authenticate("cn=Manager,dc=example,dc=com", "secret");
      conn.bind(ldapVersion, ROOT_DN, ROOT_PASSWORD.getBytes("utf-8"));

      System.out.println("========> create ldap entry " + EXO_DEVELOPER_DN);
      LDAPAttributeSet attributeSet = new LDAPAttributeSet();
      attributeSet.add(new LDAPAttribute("objectClass", "person"));
      attributeSet.add(new LDAPAttribute("cn", "exo"));
      attributeSet.add(new LDAPAttribute("sn", "platform"));
      attributeSet.add(new LDAPAttribute("telephonenumber", "0989654990"));
      LDAPEntry newEntry = new LDAPEntry(EXO_DEVELOPER_DN, attributeSet);
      conn.add(newEntry);
      System.out.println("<======Added object: " + EXO_DEVELOPER_DN + " successfully.");

      System.out.println("\nAdded object: " + EXO_DEVELOPER_DN + " successfully.");
View Full Code Here

   private void printLDAPAttributeSet(LDAPAttributeSet attrs)
   {
      Iterator allAttributes = attrs.iterator();
      while (allAttributes.hasNext())
      {
         LDAPAttribute attribute = (LDAPAttribute)allAttributes.next();
         String attributeName = attribute.getName();
         System.out.print("\n    " + attributeName + ": ");
         Enumeration allValues = attribute.getStringValues();
         if (allValues != null)
         {
            System.out.print("[");
            while (allValues.hasMoreElements())
            {
View Full Code Here

        try {
          fullEntry = rs.next();
          set = fullEntry.getAttributeSet();
          Iterator<?> attrs = set.iterator();
          while (attrs.hasNext()) {
            LDAPAttribute attribute = (LDAPAttribute) attrs.next();
            String name = attribute.getName();
            String value = attribute.getStringValue();
            if (name != null && "cn".equals(name.trim())) {
              cn = value.trim();
            }
          }
        } catch (LDAPException e) {
View Full Code Here

        try {
          fullEntry = rs.next();
          set = fullEntry.getAttributeSet();
          Iterator<?> attrs = set.iterator();
          while (attrs.hasNext()) {
            LDAPAttribute attribute = (LDAPAttribute) attrs.next();
            String name = attribute.getName();
            String value = attribute.getStringValue();
            if (name != null && "mail".equals(name.trim())) {
              mail = value.trim();
            }
          }
        } catch (LDAPException e) {
View Full Code Here

        try {
          fullEntry = rs.next();
          set = fullEntry.getAttributeSet();
          Iterator<?> attrs = set.iterator();
          while (attrs.hasNext()) {
            LDAPAttribute attribute = (LDAPAttribute) attrs.next();
            String name = attribute.getName();
            String value = attribute.getStringValue();
            if (name != null && "mail".equals(name.trim())) {
              mail = value.trim();
            }
          }
        } catch (LDAPException e) {
View Full Code Here

        try {
          fullEntry = rs.next();
          set = fullEntry.getAttributeSet();
          Iterator<?> attrs = set.iterator();
          while (attrs.hasNext()) {
            LDAPAttribute attribute = (LDAPAttribute) attrs.next();
            String name = attribute.getName();
            String value = attribute.getStringValue();
            if (name != null && "sn".equals(name.trim())) {
              sn = value.trim();
            }
          }
        } catch (LDAPException e) {
View Full Code Here

        try {
          fullEntry = rs.next();
          set = fullEntry.getAttributeSet();
          Iterator<?> attrs = set.iterator();
          while (attrs.hasNext()) {
            LDAPAttribute attribute = (LDAPAttribute) attrs.next();
            String name = attribute.getName();
            String value = attribute.getStringValue();
            if ("mail".equals(name)) {
              mail = value;
            }
          }
        } catch (LDAPException e) {
View Full Code Here

TOP

Related Classes of com.novell.ldap.LDAPAttribute

Copyright © 2018 www.massapicom. 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.