Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapConnection.move()


        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: make the parent a child of its own child
        try
        {
            con.move( "ou=parent,ou=system", "ou=child,ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here


        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: try to move the entry to the same Dn
        try
        {
            con.move( "ou=parent,ou=system", "ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testMoveControl() throws Exception
    {
        LdapConnection connection = getAdminConnection( ldapServer );

        connection.move( "ou=users,ou=system", "ou=groups,ou=system" );
        Entry entry = ( ( SearchResultEntry ) connection.lookup( "ou=users,ou=groups,ou=system" ) ).getEntry();
        assertNotNull( entry );

        SearchResponse res = connection.lookup( "ou=users,ou=system" );
        assertNull( res );
View Full Code Here

        DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
       
        LdapConnection userConnection = getConnectionAs( userName, password );

        boolean isMoved = false;
        ModifyDnResponse moveResp = userConnection.move( entryDN.getName(), newParentRdn + ",ou=system" );
        if( moveResp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
        {
            isMoved = true;
        }
        else
View Full Code Here

    {

      LdapConnection con = getClientApiConnection( ldapServer );
   
      //now do something bad: make the parent a child of its own child
      ModifyDnResponse resp = con.move( "ou=parent,ou=system", "ou=child,ou=parent,ou=system" );
      assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, resp.getLdapResult().getResultCode() );
    }
   
   
    @Test
View Full Code Here

    {

      LdapConnection con = getClientApiConnection( ldapServer );
   
      //now do something bad: try to move the entry to the same DN
      ModifyDnResponse resp = con.move( "ou=parent,ou=system", "ou=parent,ou=system" );
        assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, resp.getLdapResult().getResultCode() );
    }   
}
View Full Code Here

        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: make the parent a child of its own child
        try
        {
            con.move( "ou=parent,ou=system", "ou=child,ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here

        LdapConnection con = getAdminConnection( getLdapServer() );

        //now do something bad: try to move the entry to the same Dn
        try
        {
            con.move( "ou=parent,ou=system", "ou=parent,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            assertTrue( true );
View Full Code Here

    @Test
    public void testMoveControl() throws Exception
    {
        LdapConnection connection = getAdminConnection( getService() );

        connection.move( "ou=users,ou=system", "ou=groups,ou=system" );
        Entry entry = connection.lookup( "ou=users,ou=groups,ou=system" );
        assertNotNull( entry );

        entry = connection.lookup( "ou=users,ou=system" );
        assertNull( entry );
View Full Code Here

        connection.add( entry );

        assertNull( connection.lookup( newDn ) );
        assertNotNull( connection.lookup( oldDn ) );

        connection.move( oldDn, newSuperior );

        assertNotNull( connection.lookup( newDn ) );
        assertNull( connection.lookup( oldDn ) );
       
        connection.close();
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.