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

Examples of org.apache.directory.shared.ldap.model.message.ModifyRequestImpl.replace()


        // try to modify the subentry as a non-admin
        connection = new LdapNetworkConnection( "localhost", getLdapServer().getPort() );
        connection.bind( userDn.getName(), password );
       
        modResp = connection.modify( modReq );
        modReq.replace( "pwdPolicySubEntry", userDn.getName() );
        assertEquals( ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS, modResp.getLdapResult().getResultCode() );
    }
   
   
    private PasswordPolicy getPwdRespCtrl( Response resp ) throws Exception
View Full Code Here


        assertEquals( "", srEditorBot.getContent( 1, 4 ) );

        // add description
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( new Dn( "uid=admin,ou=system" ) );
        request.replace( "description", "The 1st description." );
        ldapServer.getDirectoryService().getAdminSession().modify( request );

        // refresh the search, using the toolbar icon
        srEditorBot.refresh();
        SWTUtils.sleep( 1000 );
View Full Code Here

        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

        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

        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

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

        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

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

        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

        // now tag then replace the value to "new value" and confirm
        Tag t1 = getService().getChangeLog().tag();
        modReq = new ModifyRequestImpl();
        modReq.setName( resusitated.getDn() );
        modReq.replace( "description", "new value" );
        sysRoot.modify( modReq );

        resusitated = sysRoot.lookup( "ou=test5,ou=system" );
        assertNotNull( resusitated );
        description = resusitated.get( "description" );
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.