Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.destroySubcontext()


               Attributes attrs = ctx.getAttributes(profileDN);
               UserProfile profile = ldapAttrMapping.attributesToProfile(attrs).getUserProfile();
               if (broadcast)
                  preDelete(profile);

               ctx.destroySubcontext(profileDN);
              
               if (broadcast)
                  postDelete(profile);

               return profile;
View Full Code Here


    public void testThrowOnReferralWithJndi() throws Exception
    {
        LdapContext ctx = getWiredContextThrowOnRefferal( getLdapServer() );

        // delete success
        ctx.destroySubcontext( "ou=computers,uid=akarasulu,ou=users,ou=system" );

        try
        {
            ctx.lookup( "ou=computers,uid=akarasulu,ou=users,ou=system" );
            fail( "Should never get here." );
View Full Code Here

        }

        // referrals failure on delete
        try
        {
            ctx.destroySubcontext( "uid=akarasuluref,ou=users,ou=system" );
            fail( "Should never get here" );
        }
        catch ( ReferralException e )
        {
            // seems JNDI only returns the first referral URL and not all so we test for it
View Full Code Here

        // -------------------------------------------------------------------
        // do delete and confirm
        // -------------------------------------------------------------------

        ctx.destroySubcontext( "cn=fbar,ou=system" );
        try
        {
            ctx.getAttributes( "cn=fbar,ou=system" );
            fail( "deleted entry should not be found" );
        }
View Full Code Here

                    // use "throw" as we handle referrals manually
                    modCtx.addToEnvironment( Context.REFERRAL, REFERRAL_THROW );

                    // delete entry
                    modCtx.destroySubcontext( new LdapName( dn ) );
                }
                catch ( ReferralException re )
                {
                    try
                    {
View Full Code Here

        LdapContext sysRoot = getSystemContext( service );

        /*
         * delete ou=testing00,ou=system
         */
        sysRoot.destroySubcontext( "ou=testing00" );

        try
        {
            sysRoot.lookup( "ou=testing00" );
            fail( "ou=testing00, ou=system should not exist" );
View Full Code Here

        }

        /*
         * delete ou=subtest,ou=testing01,ou=system
         */
        sysRoot.destroySubcontext( "ou=subtest,ou=testing01" );

        try
        {
            sysRoot.lookup( "ou=subtest,ou=testing01" );
            fail( "ou=subtest,ou=testing01,ou=system should not exist" );
View Full Code Here

        }

        /*
         * delete ou=testing01,ou=system
         */
        sysRoot.destroySubcontext( "ou=testing01" );

        try
        {
            sysRoot.lookup( "ou=testing01" );
            fail( "ou=testing01, ou=system should not exist" );
View Full Code Here

        }

        /*
         * delete ou=testing01,ou=system
         */
        sysRoot.destroySubcontext( "ou=testing02" );

        try
        {
            sysRoot.lookup( "ou=testing02" );
            fail( "ou=testing02, ou=system should not exist" );
View Full Code Here

            "ou: Test" );

        DirContext ctx = ctxRoot.createSubcontext( dn, attributes );
        assertNotNull( ctx );

        ctxRoot.destroySubcontext( dn );

        SearchControls sc = new SearchControls();
        sc.setSearchScope( SearchControls.OBJECT_SCOPE );

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