Package javax.naming.ldap

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


        Attribute attr = new BasicAttribute( "description", "referral to akarasulu" );
        ModificationItem mod = new ModificationItem( DirContext.ADD_ATTRIBUTE, attr );

        try
        {
            ctx.modifyAttributes( "uid=akarasuluref,ou=users,ou=system", new ModificationItem[]
                { mod } );
        }
        catch ( ReferralException e )
        {
            // seems JNDI only returns the first referral URL and not all so we test for it
View Full Code Here


        {
            Attribute disabled = new BasicAttribute( "m-disabled" );
            ModificationItem[] mods = new ModificationItem[]
                {
                    new ModificationItem( DirContext.REMOVE_ATTRIBUTE, disabled ) };
            schemaRoot.modifyAttributes( "cn=nis", mods );
        }

        // -------------------------------------------------------------------
        // Add a bunch of nis groups
        // -------------------------------------------------------------------
View Full Code Here

        // A new description attribute value
        String deletedValue = "she has blond hair";

        Attributes attrs = new BasicAttributes( "description", deletedValue, true );

        exampleCtx.modifyAttributes( RDN_KIM_WILDE, DirContext.REMOVE_ATTRIBUTE, attrs );

        // Verify that the attribute value has been removed
        attrs = exampleCtx.getAttributes( RDN_KIM_WILDE );
        Attribute attr = attrs.get( "description" );
        assertNotNull( attr );
View Full Code Here

        Attribute descr = new BasicAttribute( "description" );
        descr.add( "an American singer-songwriter" );
        descr.add( "she has blond hair" );
        attrs.put( descr );

        exampleCtx.modifyAttributes( RDN_KIM_WILDE, DirContext.REMOVE_ATTRIBUTE, attrs );

        // Verify that the attribute value has been removed
        attrs = exampleCtx.getAttributes( RDN_KIM_WILDE );
        Attribute attr = attrs.get( "description" );
        assertNull( attr );
View Full Code Here

        LdapContext exampleCtx = IntegrationUtils.getContext( "uid=admin,ou=system", getService(), "dc=example,dc=com" );
        createData( exampleCtx );

        Attributes sn = new BasicAttributes( "sn", "Wilde", true );

        exampleCtx.modifyAttributes( RDN_KIM_WILDE, DirContext.REMOVE_ATTRIBUTE, sn );
    }


    //---------------------------------------------------------------------------------------------
    // 1 Entry exists
View Full Code Here

        createData( exampleCtx );

        // A non existing AT
        Attributes attrs = new BasicAttributes( "seeAlso", "cn=test", true );

        exampleCtx.modifyAttributes( RDN_HEATHER_NOVA, DirContext.REMOVE_ATTRIBUTE, attrs );
    }


    /**
     * Remove a non existing AT from an entry, the AT is not part of MAY/MUST
View Full Code Here

        createData( exampleCtx );

        // A non existing AT
        Attributes attrs = new BasicAttributes( "c", "FR", true );

        exampleCtx.modifyAttributes( RDN_HEATHER_NOVA, DirContext.REMOVE_ATTRIBUTE, attrs );
    }


    /**
     * Delete a value from an existing SingleValued AT, not in MUST, not in Rdn
View Full Code Here

        LdapContext exampleCtx = IntegrationUtils.getContext( "uid=admin,ou=system", getService(), "dc=example,dc=com" );
        createData( exampleCtx );

        Attributes attrs = new BasicAttributes( "c", "FR", true );

        exampleCtx.modifyAttributes( "ou=testing02", DirContext.REMOVE_ATTRIBUTE, attrs );

        // Verify that the attribute value has been removed
        attrs = exampleCtx.getAttributes( "ou=testing02" );
        Attribute country = attrs.get( "c" );
        assertNull( country );
View Full Code Here

        LdapContext exampleCtx = IntegrationUtils.getContext( "uid=admin,ou=system", getService(), "dc=example,dc=com" );
        createData( exampleCtx );

        Attributes attrs = new BasicAttributes( "uidNumber", "1", true );

        exampleCtx.modifyAttributes( "cn=test", DirContext.REMOVE_ATTRIBUTE, attrs );
    }


    /**
     * Delete a value part of the Rdn
View Full Code Here

        LdapContext exampleCtx = IntegrationUtils.getContext( "uid=admin,ou=system", getService(), "dc=example,dc=com" );
        createData( exampleCtx );

        Attributes attrs = new BasicAttributes( "cn", "test", true );

        exampleCtx.modifyAttributes( "cn=test", DirContext.REMOVE_ATTRIBUTE, attrs );
    }


    /**
     * Delete an existing AT not part of the Rdn, not in MUST
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.