Examples of createSubcontext()


Examples of javax.naming.directory.DirContext.createSubcontext()

      if ((attrs != null) && (ctx instanceof DirContext)) {
        DirContext dirctx = (DirContext)ctx;
        param = parameters[0];
        if (param instanceof AnyName) {
          return new AnyNamingContext(
            dirctx.createSubcontext((Name)param.toObject(), attrs));
        } else {
          return new AnyNamingContext(
            dirctx.createSubcontext(param.toString(), attrs));
        }
      }
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        if (param instanceof AnyName) {
          return new AnyNamingContext(
            dirctx.createSubcontext((Name)param.toObject(), attrs));
        } else {
          return new AnyNamingContext(
            dirctx.createSubcontext(param.toString(), attrs));
        }
      }

      param = parameters[0];
      if (param instanceof AnyName) {
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        person.put( "sn", "bar" );
        person.put( "pwdLastSet", "3" );
        person.put( "SourceAD", "blah" );
        person.put( "useraccountcontrol", "7" );
        person.put( "sAMAccountName", "foobar" );
        ctx.createSubcontext( "cn=foobar,ou=system", person );

        // Confirm creation with a lookup
        Attributes read = ctx.getAttributes( "cn=foobar,ou=system" );
        assertNotNull( read );
        assertEquals( "3", read.get( "pwdLastSet" ).get() );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );

        // Create an entry
        Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
        String rdn = "cn=Kate Bush";
        ctx.createSubcontext( rdn, attrs );

        // replace attribute cn with empty value (=> deletion)
        Attribute attr = new BasicAttribute( "cn", "Kate Bush" );
        ModificationItem item = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, attr );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );

        // Create an entry
        Attributes attrs = getInetOrgPersonAttributes( "Bush", "Kate Bush" );
        String rdn = "cn=Kate Bush";
        ctx.createSubcontext( rdn, attrs );

        ModificationItem delModOp = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(
            "objectclass",
            "" ) );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        DirContext ctx = ( DirContext ) getWiredContext( getLdapServer() ).lookup( BASE );

        // Create an entry
        Attributes attrs = getInetOrgPersonAttributes( "Bush", "Kate Bush" );
        String rdn = "cn=Kate Bush";
        ctx.createSubcontext( rdn, attrs );

        ModificationItem delModOp = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new BasicAttribute(
            "objectclass" ) );

        try
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        // Create a person, cn value is rdn
        String oldCn = "Myra Ellen Amos";
        String oldRdn = "cn=" + oldCn;
        Attributes attributes = this.getPersonAttributes( "Amos", oldCn );
        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "False" );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        // Create a person, cn value is rdn
        String oldCn = "Myra Ellen Amos";
        String oldRdn = "cn=" + oldCn;
        Attributes attributes = this.getPersonAttributes( "Amos", oldCn );
        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        String alternateCn = "Myra E. Amos";
        Attribute cn = attributes.get( "cn" );
        cn.add( alternateCn );
        assertEquals( 2, cn.size() );

        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn
        String newCn = "Tori Amos";
        String newRdn = "cn=" + newCn;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "true" );
View Full Code Here

Examples of javax.naming.directory.DirContext.createSubcontext()

        // Create a person, cn value is rdn
        String cnVal = "Tori Amos";
        String snVal = "Amos";
        String oldRdn = "cn=" + cnVal;
        Attributes attributes = this.getPersonAttributes( snVal, cnVal );
        ctx.createSubcontext( oldRdn, attributes );

        // modify Rdn from cn=... to sn=...
        String newRdn = "sn=" + snVal;
        ctx.addToEnvironment( "java.naming.ldap.deleteRDN", "false" );
        ctx.rename( oldRdn, newRdn );
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.