Examples of LDAPAttributeSet


Examples of com.novell.ldap.LDAPAttributeSet

    LDAPSearchResults searchResults = connection.search(searchRootGroup, LDAPConnection.SCOPE_SUB,
      "(objectclass=" + objectClassGroup + ")", attrIDsGroup, false);

    LDAPEntry entry = null;
    LDAPAttributeSet attributeSet = null;
    while (searchResults.hasMore()) {

        try {
      entry = searchResults.next();
      if (entry != null) {
          attributeSet = entry.getAttributeSet();
          groups.add(attributeSet.getAttribute(ouAttributeName).getStringValue());

      }
        } catch (LDAPException e) {
      logger.error("LDAPException",e);
      throw e;
View Full Code Here

Examples of com.novell.ldap.LDAPAttributeSet

      conn.connect(LDAP_HOST, LDAP_PORT);
      // 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.");

      LDAPSearchResults results = conn.search(DEVELOPER_UNIT_DN, // search only
         // the object in
         // the subtree of
         // this dn
         LDAPConnection.SCOPE_SUB, // return
         // all the
         // objects
         // that
         // match
         // the
         // filter
         // criteria
         // and in
         // the sub
         // tree
         "(objectclass=person)", // query
         // filter, (
         // objectclass
         // =*) for
         // all the
         // object
         null, // return all the attributes
         // of the object
         false); // return attrs and values

      // assertEquals("Expect to find 1 entry", 1, results.getCount()) ;
      while (results.hasMore())
      {
         LDAPEntry nextEntry = null;
         nextEntry = results.next();
         System.out.println("\n entry: " + nextEntry.getDN());
         System.out.println("  Attributes: ");
         LDAPAttributeSet attrs = nextEntry.getAttributeSet();
         printLDAPAttributeSet(attrs);
      }
      System.out.println("   ---> count: " + results.getCount());
      System.out.println("<======search " + DEVELOPER_UNIT_DN + " successfully.");
      // delete the new created ldap entry
View Full Code Here

Examples of com.novell.ldap.LDAPAttributeSet

      conn.connect(LDAP_HOST, LDAP_PORT);
      // 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.");

      LDAPSearchResults results = conn.search(DEVELOPER_UNIT_DN, // search only
         // the object in
         // the subtree of
         // this dn
         LDAPConnection.SCOPE_SUB, // return
         // all the
         // objects
         // that
         // match
         // the
         // filter
         // criteria
         // and in
         // the sub
         // tree
         "(objectclass=person)", // query
         // filter, (
         // objectclass
         // =*) for
         // all the
         // object
         null, // return all the attributes
         // of the object
         false); // return attrs and values

      // assertEquals("Expect to find 1 entry", 1, results.getCount()) ;
      while (results.hasMore())
      {
         LDAPEntry nextEntry = null;
         nextEntry = results.next();
         System.out.println("\n entry: " + nextEntry.getDN());
         System.out.println("  Attributes: ");
         LDAPAttributeSet attrs = nextEntry.getAttributeSet();
         printLDAPAttributeSet(attrs);
      }
      System.out.println("   ---> count: " + results.getCount());
      System.out.println("<======search " + DEVELOPER_UNIT_DN + " successfully.");
      // delete the new created ldap entry
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

                    for(int i=0;i<entries.size();i++){
                        System.out.println("----Eintrag "+j+"------------------------");
                        LDAPEntry entry = (LDAPEntry)entries.get(i);
                        System.out.println("DN ist : "+entry.getDN());
         
                        LDAPAttributeSet set = entry.getAttributeSet();

                        //System.out.println("attribute 1 = "+set);
                        System.out.println("");

                        Enumeration enumAttrs = set.getAttributes();
                        while ( enumAttrs.hasMoreElements() ) {
                            LDAPAttribute anAttr = (LDAPAttribute)enumAttrs.nextElement();
                            String attrName = anAttr.getName();
                  
                            System.out.print( attrName );
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

            } else if (hr.get("add") != null) {
                String add = hr.get("add");

                System.out.println(add);

                LDAPAttributeSet attrs = new LDAPAttributeSet();
                LDAPAttribute attr = new LDAPAttribute("objectclass");

                for (int i = 0; i < objectclass_values.length; i++) {
                    attr.addValue(objectclass_values[i]);
                }

                attrs.add(attr);

                // The add string will look like this: cn=x,y|sn=u,z|x3=p...

                addattrs(add, attrs, null);
        //        attrs.add(new LDAPAttribute("uid", "x1"));
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, new byte[0] ) );
        conn.setConstraints( constraints );
       
        // add success
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        try
        {
            conn.add( entry, constraints );
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

        LDAPConnection conn = getWiredConnection( ldapServer );
        LDAPConstraints constraints = new LDAPConstraints();
        conn.setConstraints( constraints );

        // referrals failure
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,ou=Computers,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        LDAPResponseListener listener = conn.add( entry, null, constraints );
        LDAPResponse response = listener.getResponse();
        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

        constraints.setReferrals( false );
        conn.setConstraints( constraints );
       
        // referrals failure

        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );
       
        LDAPResponseListener listener = null;
        LDAPResponse response = null;
        listener = conn.add( entry, null, constraints );
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        // add success
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );

        try
        {
            conn.add( entry, constraints );
View Full Code Here

Examples of netscape.ldap.LDAPAttributeSet

        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
        LDAPConstraints constraints = new LDAPConstraints();
        conn.setConstraints( constraints );

        // referrals failure
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,ou=Computers,uid=akarasuluref,ou=users,ou=system", attrSet );

        LDAPResponseListener listener = conn.add( entry, null, constraints );
        LDAPResponse response = listener.getResponse();
        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
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.