Package org.apache.directory.api.ldap.extras.extended

Examples of org.apache.directory.api.ldap.extras.extended.PwdModifyRequestImpl


        // Bind as the user
        LdapConnection anonymousConnection = getAnonymousNetworkConnection( getLdapServer() );
        anonymousConnection.setTimeOut( 0L );

        // Now change the password
        PwdModifyRequestImpl pwdModifyRequest = new PwdModifyRequestImpl();
        pwdModifyRequest.setUserIdentity( Strings.getBytesUtf8( "cn=User2,ou=system" ) );
        pwdModifyRequest.setOldPassword( Strings.getBytesUtf8( "secret2" ) );
        pwdModifyRequest.setNewPassword( Strings.getBytesUtf8( "secret2Bis" ) );

        // Send the request
        PwdModifyResponse pwdModifyResponse = ( PwdModifyResponse ) anonymousConnection.extended( pwdModifyRequest );

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );
View Full Code Here


        addUser( adminConnection, "User3", "secret3" );

        // Modify the user with the admin account

        // Now change the password
        PwdModifyRequestImpl pwdModifyRequest = new PwdModifyRequestImpl();
        pwdModifyRequest.setUserIdentity( Strings.getBytesUtf8( "cn=User3,ou=system" ) );
        pwdModifyRequest.setNewPassword( Strings.getBytesUtf8( "secret3Bis" ) );

        // Send the request
        PwdModifyResponse pwdModifyResponse = ( PwdModifyResponse ) adminConnection.extended( pwdModifyRequest );

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );
View Full Code Here

                    "Init PasswordModifyRequest" )
                {
                    public void action( PasswordModifyRequestContainer container )
                    {
                        PasswordModifyRequestDecorator passwordModifyRequestDecorator = new PasswordModifyRequestDecorator(
                            LdapApiServiceFactory.getSingleton(), new PwdModifyRequestImpl() );
                        container.setPasswordModifyRequest( passwordModifyRequestDecorator );

                        // We may have nothing left
                        container.setGrammarEndAllowed( true );
                    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public PwdModifyRequest newRequest()
    {
        return new PasswordModifyRequestDecorator( codec, new PwdModifyRequestImpl() );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public PwdModifyRequest newRequest( byte[] value )
    {
        PasswordModifyRequestDecorator req = new PasswordModifyRequestDecorator( codec, new PwdModifyRequestImpl() );
        req.setRequestValue( value );
        return req;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public PwdModifyRequest newRequest()
    {
        return new PasswordModifyRequestDecorator( codec, new PwdModifyRequestImpl() );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public PwdModifyRequest newRequest( byte[] value )
    {
        PasswordModifyRequestDecorator req = new PasswordModifyRequestDecorator( codec, new PwdModifyRequestImpl() );
        req.setRequestValue( value );
        return req;
    }
View Full Code Here

        // Bind as the user
        LdapConnection userConnection = getNetworkConnectionAs( getLdapServer(), "cn=user1,ou=system", "secret1" );
        userConnection.setTimeOut( 0L );

        // Now change the password
        PwdModifyRequestImpl pwdModifyRequest = new PwdModifyRequestImpl();
        pwdModifyRequest.setNewPassword( Strings.getBytesUtf8( "secret1Bis" ) );

        // Send the request
        PwdModifyResponse pwdModifyResponse = ( PwdModifyResponse ) userConnection.extended( pwdModifyRequest );

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );
View Full Code Here

        // Bind as the user
        LdapConnection anonymousConnection = getAnonymousNetworkConnection( getLdapServer() );
        anonymousConnection.setTimeOut( 0L );

        // Now change the password
        PwdModifyRequestImpl pwdModifyRequest = new PwdModifyRequestImpl();
        pwdModifyRequest.setUserIdentity( Strings.getBytesUtf8( "cn=User2,ou=system" ) );
        pwdModifyRequest.setOldPassword( Strings.getBytesUtf8( "secret2" ) );
        pwdModifyRequest.setNewPassword( Strings.getBytesUtf8( "secret2Bis" ) );

        // Send the request
        PwdModifyResponse pwdModifyResponse = ( PwdModifyResponse ) anonymousConnection.extended( pwdModifyRequest );

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );
View Full Code Here

        // Bind as the user
        LdapConnection anonymousConnection = getAnonymousNetworkConnection( getLdapServer() );
        anonymousConnection.setTimeOut( 0L );

        // Now change the password
        PwdModifyRequestImpl pwdModifyRequest = new PwdModifyRequestImpl();
        pwdModifyRequest.setUserIdentity( Strings.getBytesUtf8( "cn=User3,ou=system" ) );
        pwdModifyRequest.setOldPassword( Strings.getBytesUtf8( "secret3" ) );
        pwdModifyRequest.setNewPassword( Strings.getBytesUtf8( "secret3Bis" ) );

        // Send the request
        PwdModifyResponse pwdModifyResponse = ( PwdModifyResponse ) anonymousConnection.extended( pwdModifyRequest );

        assertEquals( ResultCodeEnum.SUCCESS, pwdModifyResponse.getLdapResult().getResultCode() );
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.extras.extended.PwdModifyRequestImpl

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.