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


               ModificationItem[] mods = new ModificationItem[modifications.size()];
               modifications.toArray(mods);
               if (broadcast)
                  preSave(group, true);
               ctx.modifyAttributes(groupDN, mods);
               if (broadcast)
                  postSave(group, true);

               cacheHandler.put(group.getId(), group, CacheType.GROUP);
               return;
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 newValue = "ou=test";

        Attributes attrs = new BasicAttributes( "seeAlso", newValue, true );

        sysRoot.modifyAttributes( RDN_HEATHER_NOVA, DirContext.ADD_ATTRIBUTE, attrs );

        // Verify that the attribute value has been added
        attrs = sysRoot.getAttributes( RDN_HEATHER_NOVA );
        Attribute attr = attrs.get( "seeAlso" );
        assertNotNull( attr );
View Full Code Here

        createData( sysRoot );

        // A valid AT not in MUST or MAY
        Attributes attrs = new BasicAttributes( "crossCertificatePair", "12345", true );

        sysRoot.modifyAttributes( RDN_HEATHER_NOVA, DirContext.ADD_ATTRIBUTE, attrs );
    }


    /**
     * Add a new AT with a valid Value in the entry, the AT is not part of the MAY or MUST,
View Full Code Here

        // A valid AT not in MUST or MAY, but the extensibleObject OC is present in the OCs
        Attributes attrs = new BasicAttributes( "crossCertificatePair", "12345", true );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );

        // Verify that the attribute value has been added
        attrs = sysRoot.getAttributes( "ou=testing01" );
        Attribute attr = attrs.get( "crossCertificatePair" );
        assertNotNull( attr );
View Full Code Here

        // A valid AT not in MUST or MAY, but the extensibleObject OC is present in the OCs
        // The value is empty
        Attributes attrs = new BasicAttributes( "crossCertificatePair", StringTools.EMPTY_BYTES, true );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );

        // Verify that the attribute value has been added
        attrs = sysRoot.getAttributes( "ou=testing01" );
        Attribute attr = attrs.get( "crossCertificatePair" );
        assertNotNull( attr );
View Full Code Here

        attr.add( "US" );
        Attributes attrs = new BasicAttributes( "c", true );
        attrs.put( attr );

        // Add the AVA
        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );
    }

   
    /**
     * Add a bad AT in the entry, the OC does not contain the extensibleObject OC
View Full Code Here

        createData( sysRoot );

        // An invalid AT
        Attributes attrs = new BasicAttributes( "badAttr", "12345", true );

        sysRoot.modifyAttributes( RDN_HEATHER_NOVA, DirContext.ADD_ATTRIBUTE, attrs );
    }


    /**
     * Add a bad AT in the entry, the OC contains the extensibleObject OC
View Full Code Here

        createData( sysRoot );

        // An invalid AT
        Attributes attrs = new BasicAttributes( "badAttr", "12345", true );

        sysRoot.modifyAttributes( "ou=testing01", DirContext.ADD_ATTRIBUTE, attrs );
    }
   

    /**
     * Add a AT part of the MAY/MUST, with an invalid value
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.