Package org.apache.directory.shared.ldap.model.message

Examples of org.apache.directory.shared.ldap.model.message.ModifyRequestImpl


    String gn = lookupEntry.get( "givenName" ).getString();
    assertEquals( "test", gn );

    // Now, replace the givenName
    ModifyRequest modifyRequest = new ModifyRequestImpl();
    modifyRequest.setName( dn );
    modifyRequest.replace( "givenName" );
    connection.modify( modifyRequest );

    lookupEntry = session.lookup( dn );
    Attribute giveName = lookupEntry.get( "givenName" );
    assertNull( giveName );
View Full Code Here


            LOG.debug( "received a null entry for modification" );
            throw new IllegalArgumentException( "Entry to be modified cannot be null" );
        }

        int newId = messageId.incrementAndGet();
        ModifyRequest modifyRequest = new ModifyRequestImpl();
        modifyRequest.setMessageId( newId );

        modifyRequest.setName( entry.getDn() );

        Iterator<Attribute> itr = entry.iterator();

        while ( itr.hasNext() )
        {
            modifyRequest.addModification( new DefaultModification( modOp, itr.next() ) );
        }

        ModifyResponse modifyResponse = modify( modifyRequest );

        processResponse( modifyResponse );
View Full Code Here

public void modifyAsync() throws Exception
{
    Dn dn = new Dn( "uid=admin,ou=system" );

    String expected = String.valueOf( System.currentTimeMillis() );
    ModifyRequest modifyRequest = new ModifyRequestImpl();
    modifyRequest.setName( dn );
    modifyRequest.replace( SchemaConstants.SN_AT, expected );

    assertTrue( session.exists( dn ) );

    ModifyFuture modifyFuture = connection.modifyAsync( modifyRequest );
View Full Code Here

        assertTrue( entry.get( "cn" ).contains( "Alex Karasulu" ) );
        assertTrue( entry.get( "facsimiletelephonenumber" ).contains( "+1 408 555 9751" ) );
        assertTrue( entry.get( "roomnumber" ).contains( "4612" ) );

        // now modify the password for akarasulu
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "newpwd" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SHA
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{SHA}5en6G6MezRroT3XKqkdPOmY/BfQ=" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SHA
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{SSHA}mjVVxasFkk59wMW4L1Ldt+YCblfhULHs03WW7g==" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'test123', encrypted using SHA with a 4 bytes salt
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{SSHA}0TT388zsWzHKtMEpIU/8/W68egchNEWp" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using MD5
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{MD5}Xr4ilOzQ4PCOq3aQ0qbuaQ==" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SMD5
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{SMD5}tQ9wo/VBuKsqBtylMMCcORbnYOJFMyDJ" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

        Entry entry = connection.lookup( userDn );
        assertNotNull( entry );
        assertTrue( entry.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using CRYPT
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( userDn ) );
        modReq.replace( "userPassword", "{crypt}qFkH8Z1woBlXw" );
        connection.modify( modReq );

        // close and try with old password (should fail)
        connection.close();
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.message.ModifyRequestImpl

Copyright © 2018 www.massapicom. 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.