Package javax.naming.ldap

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


        // The initial value
        Attributes attrs = new BasicAttributes( "c", "FR", true );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );
       
        // Add another value
        Attributes attrs2 = new BasicAttributes( "c", "FR", true );

        // Add the AVA
View Full Code Here


       
        // Add another value
        Attributes attrs2 = new BasicAttributes( "c", "FR", true );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs2 );
    }
   
   
    /**
     * Add an invalue in a existing AT
View Full Code Here

        // The added value
        Attributes attrs = new BasicAttributes( "telephoneNumber", "BAD", true );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );
    }
   
   
    //---------------------------------------------------------------------------------------------
    // 1 Entry exists
View Full Code Here

        createData( sysRoot );

        // An operational attribute
        Attributes attrs = new BasicAttributes( "cn", "test", true );

        sysRoot.modifyAttributes( "ou=absent", DirContext.ADD_ATTRIBUTE, attrs );
    }
}
View Full Code Here

        if ( isNisDisabled )
        {
            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 );

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

        // Verify that the attribute value has been removed
        attrs = sysRoot.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 );
       
        sysRoot.modifyAttributes( RDN_KIM_WILDE, DirContext.REMOVE_ATTRIBUTE, attrs );

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

        LdapContext sysRoot = getSystemContext( service );
        createData( sysRoot );

        Attributes sn = new BasicAttributes( "sn", "Wilde", true );
       
        sysRoot.modifyAttributes( RDN_KIM_WILDE, DirContext.REMOVE_ATTRIBUTE, sn );
    }

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

        createData( sysRoot );

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

        sysRoot.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( sysRoot );

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

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

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.