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

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


        // Write the modifications
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );
View Full Code Here


        // Write the modifications
        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
View Full Code Here

        ModifyRequest request = new ModifyRequestImpl();
        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
        //ldapService.reloadSslContext();
View Full Code Here

        request.setName( dn );
        request.replace( PRIVATE_KEY_AT, privateKey.getEncoded() );
        request.replace( PRIVATE_KEY_FORMAT_AT, privateKey.getFormat() );
        request.replace( PUBLIC_KEY_AT, publicKey.getEncoded() );
        request.replace( PUBLIC_KEY_FORMAT_AT, publicKey.getFormat() );
        request.replace( USER_CERTIFICATE_AT, cert.getEncoded() );
        ldapServer.getDirectoryService().getAdminSession().modify( dn, modifications );

        // TODO: activate when DIRSERVER-1373 is fixed
        //ldapService.reloadSslContext();
        //ldapsService.reloadSslContext();
View Full Code Here

                System.out.println( "modifying " + personDn + " on the server " + nc.getConfig().getLdapHost() + ":" + nc.getConfig().getLdapPort() );
            }
           
            ModifyRequest modReq = new ModifyRequestImpl();
            modReq.setName( personDn );
            modReq.replace( SchemaConstants.SN_AT, "sn_" + i );
           
            ModifyResponse resp = nc.modify( modReq );
            ResultCodeEnum rc = resp.getLdapResult().getResultCode();
            if( rc != ResultCodeEnum.SUCCESS )
            {
View Full Code Here

        assertNull( respCtrl );

        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( userDn );
        modReq.addControl( PP_REQ_CTRL );
        modReq.replace( SchemaConstants.USER_PASSWORD_AT, "123456" );

        ModifyResponse modResp = connection.modify( modReq );
        assertEquals( ResultCodeEnum.CONSTRAINT_VIOLATION, modResp.getLdapResult().getResultCode() );

        respCtrl = getPwdRespCtrl( modResp );
View Full Code Here

        LdapConnection connection = getAdminConnection();
        Dn adminDn = new Dn( "uid=admin,ou=system" );
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( adminDn );
        String newPwd = "replaced";
        modReq.replace( SchemaConstants.USER_PASSWORD_AT, newPwd );
        connection.modify( modReq );
        connection.close();

        connection = getConnectionAs( adminDn, newPwd );
        Entry entry = connection.lookup( adminDn.getName() );
View Full Code Here

     */
    public static void changePresciptiveACI( String cn, String aciItem ) throws Exception
    {
        ModifyRequest modReq = new ModifyRequestImpl();
        modReq.setName( new Dn( "cn=" + cn + ",ou=system" ) );
        modReq.replace( "prescriptiveACI", aciItem );
        getAdminConnection().modify( modReq );
    }


    public static void addPrescriptiveACI( String cn, String aciItem ) throws Exception
View Full Code Here

        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

        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

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.