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

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


       
        providerSession.add( provUser );
       
        assertTrue( providerSession.exists( provUser.getDn() ) );
       
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( provUser.getDn() );
        modReq.add( "userPassword", "secret" );
       
        providerSession.modify( modReq );
       
        assertTrue( checkEntryExistence( consumerSession, provUser.getDn() ) );
        waitAndCompareEntries( provUser.getDn() );
View Full Code Here


            throw new IllegalArgumentException( msg );
        }

        int newId = messageId.incrementAndGet();

        ModifyRequest modifyRequest = new ModifyRequestImpl();
        modifyRequest.setMessageId( newId );

        modifyRequest.setName( dn );

        for ( Modification modification : modifications )
        {
            modifyRequest.addModification( modification );
        }

        ModifyResponse modifyResponse = modify( modifyRequest );

        processResponse( modifyResponse );
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 );
View Full Code Here

        Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
        assertEquals("set size: " + failedACLs, 2, failedACLs.size());

        Dn dn = new Dn("cn=read,cn=TEST.FOO," + getQueueBaseDn());

        ModifyRequest request = new ModifyRequestImpl();
        request.setName(dn);
        setupModifyRequest(request);

        connection.modify(request);

        Thread.sleep(2000);

        failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
        assertEquals("set size: " + failedACLs, 1, failedACLs.size());

        // Change destination entry
        request = new ModifyRequestImpl();
        request.setName(new Dn("cn=TEST.FOO," + getQueueBaseDn()));
        request.add("description", "This is a description!  In fact, it is a very good description.");

        connection.modify(request);

        Thread.sleep(2000);
View Full Code Here

        Set<?> failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
        assertEquals("set size: " + failedACLs, 2, failedACLs.size());

        Dn dn = new Dn("cn=read,cn=TEST.FOO," + getQueueBaseDn());

        ModifyRequest request = new ModifyRequestImpl();
        request.setName(dn);
        setupModifyRequest(request);

        connection.modify(request);

        Thread.sleep(2000);

        failedACLs = map.getReadACLs(new ActiveMQQueue("TEST.FOO"));
        assertEquals("set size: " + failedACLs, 1, failedACLs.size());
       
        // Change destination entry
        request = new ModifyRequestImpl();
        request.setName(new Dn("cn=TEST.FOO," + getQueueBaseDn()));
        request.add("description", "This is a description!  In fact, it is a very good description.");
       
        connection.modify(request);

        Thread.sleep(2000);
       
View Full Code Here

    /**
     * Creates a new getDecoratedMessage() of ModifyRequestDsml.
     */
    public ModifyRequestDsml( LdapApiService codec )
    {
        super( codec, new ModifyRequestImpl() );
    }
View Full Code Here

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

    ModifyRequest modifyRequest = new ModifyRequestImpl();
    modifyRequest.setName( dn );
    modifyRequest.replace( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );

    ModifyResponse modResp = connection.modify( modifyRequest );
    assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, modResp.getLdapResult().getResultCode() );

    modifyRequest = new ModifyRequestImpl();
    modifyRequest.setName( dn );
    modifyRequest.replace( SchemaConstants.ENTRY_CSN_AT, new CsnFactory( 0 ).newInstance().toString() );

    // admin can modify the entryCsn
    modResp = connection.modify( modifyRequest );
    assertEquals( ResultCodeEnum.SUCCESS, modResp.getLdapResult().getResultCode() );
View Full Code Here

    Dn dn = new Dn( "uid=admin,ou=system" );

    String modifierName = "uid=x,ou=system";
    String modifiedTime = DateUtils.getGeneralizedTime();

    ModifyRequest modifyRequest = new ModifyRequestImpl();
    modifyRequest.setName( dn );
    modifyRequest.replace( SchemaConstants.MODIFIERS_NAME_AT, modifierName );
    modifyRequest.replace( SchemaConstants.MODIFY_TIMESTAMP_AT, modifiedTime );

    ModifyResponse modResp = connection.modify( modifyRequest );
    assertEquals( ResultCodeEnum.SUCCESS, modResp.getLdapResult().getResultCode() );

    Entry loadedEntry = connection.lookup( dn.getName(), "+" );
View Full Code Here

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

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

    connection.modify( modRequest );

    Entry entry = session.lookup( dn );
View Full Code Here

            throw new IllegalArgumentException( msg );
        }

        int newId = messageId.incrementAndGet();

        ModifyRequest modifyRequest = new ModifyRequestImpl();
        modifyRequest.setMessageId( newId );

        modifyRequest.setName( dn );

        for ( Modification modification : modifications )
        {
            modifyRequest.addModification( modification );
        }

        ModifyResponse modifyResponse = modify( modifyRequest );

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