Examples of modifyAttributes()


Examples of javax.naming.directory.InitialDirContext.modifyAttributes()

        // Add the first value for description
        String description1 = "an American singer-songwriter";
        Attribute firstDescr = new BasicAttribute( "description", description1 );
        ModificationItem modification = new ModificationItem(DirContext.ADD_ATTRIBUTE, firstDescr);
        ctx.modifyAttributes(rdn, new ModificationItem[] { modification });

        // Add a second value to description
        String description2 = "Grammy award winning";
        Attribute otherDescr = new BasicAttribute( "description", description2 );

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

            TlsKeyGenerator.PRIVATE_KEY_AT, entry.get( TlsKeyGenerator.PRIVATE_KEY_AT ).getBytes() ) );
        mods[1] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
            TlsKeyGenerator.PUBLIC_KEY_AT, entry.get( TlsKeyGenerator.PUBLIC_KEY_AT ).getBytes() ) );
        mods[2] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
            TlsKeyGenerator.USER_CERTIFICATE_AT, entry.get( TlsKeyGenerator.USER_CERTIFICATE_AT ).getBytes() ) );
        ctx.modifyAttributes( "uid=admin,ou=system", mods );
        ctx.close();

        ldapServer.reloadSslContext();
       
        // create a new secure connection

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

Examples of net.jini.lookup.JoinManager.modifyAttributes()

     */
    public void modifyAttributes(final Entry[] attrSetTemplates, final Entry[] attrSets) {
        JoinManager jMgr = getJoinManager();
        if(jMgr == null)
            return;
        jMgr.modifyAttributes(attrSetTemplates, attrSets);
    }

    /**
     * Get the <code>DiscoveryManager</code> for this <code>Joiner</code>
     * If the JoinManager is null, this method will rturn null

Examples of org.apache.directory.server.core.jndi.ServerLdapContext.modifyAttributes()

        assertTrue( attrs.get( "facsimiletelephonenumber" ).contains( "+1 408 555 9751" ) );
        assertTrue( attrs.get( "roomnumber" ).contains( "4612" ) );

        // now modify the password for akarasulu
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "newpwd" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();
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.