Package javax.naming.ldap

Examples of javax.naming.ldap.InitialLdapContext.createSubcontext()


            new Control[]
                { unsupported } ) );

        try
        {
            ctx.createSubcontext( "cn=Kate Bush", user );
            fail();
        }
        catch ( OperationNotSupportedException e )
        {
        }
View Full Code Here


        unsupported.setCritical( false );
        ctx.setRequestControls( JndiUtils.toJndiControls( getLdapServer().getDirectoryService().getLdapCodecService(),
            new Control[]
                { unsupported } ) );

        DirContext kate = ctx.createSubcontext( "cn=Kate Bush", user );
        assertNotNull( kate );
        assertTrue( ArrayUtils.isEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes( "" ).get(
            "userPassword" ).get() ) );

        ctx.destroySubcontext( "cn=Kate Bush" );
View Full Code Here

        ctx.setRequestControls( JndiUtils.toJndiControls( getLdapServer().getDirectoryService().getLdapCodecService(),
            new Control[] {unsupported} ) );

        try
        {
            ctx.createSubcontext( "cn=Kate Bush", user );
            fail();
        }
        catch ( OperationNotSupportedException e )
        {
        }
View Full Code Here

        unsupported.setCritical( false );
        ctx.setRequestControls( JndiUtils.toJndiControls( getLdapServer().getDirectoryService().getLdapCodecService(),
            new Control[]{unsupported} ) );
       
        DirContext kate = ctx.createSubcontext( "cn=Kate Bush", user );
        assertNotNull( kate );
        assertTrue( ArrayUtils.isEquals( Asn1StringUtils.getBytesUtf8( "Aerial" ), kate.getAttributes( "" ).get(
                "userPassword" ).get() ) );

        ctx.destroySubcontext( "cn=Kate Bush" );
View Full Code Here

         Attributes attrs = new BasicAttributes(true); // case-ignore
         attrs.put(new BasicAttribute("objectClass", "person"));
         attrs.put(new BasicAttribute("cn", cn));
         attrs.put(new BasicAttribute("sn", sn));
         attrs.put(new BasicAttribute("telephonenumber", "0989654990"));
         ctx.createSubcontext(dn, attrs);
         System.out.println(ctx.getAttributes(dn));
      }

      // Search for objects that have those matching attributes
      System.out.println("#################SEARCH BY ATTRIBUTES#############################");
View Full Code Here

                Name dn = new LdapName( ( String ) attributes.remove( "dn" ).get() );

                dn.remove( 0 );

                ctx.createSubcontext( dn, attributes );
            }
        }
        catch ( Exception e )
        {
            String msg = "failed while trying to parse system ldif file";
View Full Code Here

                  INFO_CTRL_PANEL_CREATING_ENTRY.get(dn.toString()),
                  ColorAndFontConstants.progressFont));
        }
      });

      ctx.createSubcontext(Utilities.getJNDIName(newEntry.getDN().toString()),
          attrs);

      SwingUtilities.invokeLater(new Runnable()
      {
        public void run()
View Full Code Here

            Attributes attrs = generateLdif( counter );
            dnBuf.setLength( 0 );
            dnBuf.append( "uid=user." ).append( counter ).append( "," ).append( baseDn );

            long startTime = System.currentTimeMillis();
            ctx.createSubcontext( dnBuf.toString(), attrs );

            outBuf.setLength( 0 );
            outBuf.append( counter ).append( " " ).append( System.currentTimeMillis() - startTime );
            out.println( outBuf.toString() );
            out.flush();
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.