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

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


        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = modifyResponse.getLdapResult();

        assertEquals( "Unrecognized extended operation EXTENSION_OID: 1.2.6.1.4.1.18060.1.1.1.100.2", ldapResult
            .getDiagnosticMessage() );
    }
View Full Code Here


        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = modifyResponse.getLdapResult();

        assertNull( ldapResult.getDiagnosticMessage() );
    }
View Full Code Here

        catch ( Exception e )
        {
            fail( e.getMessage() );
        }

        ModifyResponse modifyResponse = ( ModifyResponse ) parser.getBatchResponse().getCurrentResponse();

        LdapResult ldapResult = modifyResponse.getLdapResult();

        Collection<String> referrals = ldapResult.getReferral().getLdapUrls();

        assertEquals( 1, referrals.size() );
View Full Code Here

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

        ModifyResponse modifyResponse = modify( modifyRequest );

        processResponse( modifyResponse );
    }
View Full Code Here

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

        ModifyResponse modifyResponse = modify( modifyRequest );

        processResponse( modifyResponse );
    }
View Full Code Here

        }

        int newId = messageId.incrementAndGet();

        modRequest.setMessageId( newId );
        ModifyResponse resp = new ModifyResponseImpl( newId );
        resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );

        try
        {
            session.modify( modRequest );
        }
        catch ( LdapException e )
        {
            LOG.warn( e.getMessage(), e );

            resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
        }

        addResponseControls( modRequest, resp );

        return resp;
View Full Code Here

    assertTrue( session.exists( dn ) );

    ModifyFuture modifyFuture = connection.modifyAsync( modifyRequest );

    ModifyResponse response = modifyFuture.get( 1000, TimeUnit.MILLISECONDS );

    assertNotNull( response );

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

    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() );

    LdapNetworkConnection nonAdminConnection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );

    Dn bindDn = new Dn( "uid=billyd,ou=users,ou=system" );
    nonAdminConnection.bind( bindDn.getName(), "secret" );

    // non-admin user cannot modify entryCSN
    modResp = nonAdminConnection.modify( modifyRequest );
    assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, modResp.getLdapResult().getResultCode() );

    nonAdminConnection.close();
}
View Full Code Here

    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(), "+" );

    assertEquals( modifierName, loadedEntry.get( SchemaConstants.MODIFIERS_NAME_AT ).getString() );
    assertEquals( modifiedTime, loadedEntry.get( SchemaConstants.MODIFY_TIMESTAMP_AT ).getString() );
View Full Code Here

        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( DN ) );
        modReq.add( "description", "" );

        ModifyResponse resp = con.modify( modReq );
        assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, resp.getLdapResult().getResultCode() );

        // Check whether entry is unmodified, i.e. no description
        Entry entry = con.lookup( DN );
        assertEquals( "description exists?", null, entry.get( "description" ) );
        con.close();
View Full Code Here

TOP

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

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.