Package org.apache.directory.shared.ldap.codec.bind

Examples of org.apache.directory.shared.ldap.codec.bind.BindRequest


     */
    public Element toDsml( Element root )
    {
        Element element = super.toDsml( root );
       
        BindRequest request = ( BindRequest ) instance;
       
        // AbandonID
        String name = request.getName().toString();
        if ( ( name != null && ( !"".equals( name ) ) )
        {
            element.addAttribute( "principal", name );
        }
       
View Full Code Here


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

        BindRequest bindRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", bindRequest.getName().toString() );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( 456, abandonRequest.getMessageId() );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
        Control control = abandonRequest.getCurrentControl();

        assertEquals( 1, abandonRequest.getControls().size() );
        assertTrue( control.getCriticality() );
        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
        assertEquals( "Some text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
        Control control = abandonRequest.getCurrentControl();

        assertEquals( 1, abandonRequest.getControls().size() );
        assertTrue( control.getCriticality() );
        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
        assertEquals( "DSMLv2.0 rocks!!", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
        Control control = abandonRequest.getCurrentControl();

        assertEquals( 1, abandonRequest.getControls().size() );
        assertTrue( control.getCriticality() );
        assertEquals( "1.2.840.113556.1.4.643", control.getControlType() );
        assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
        Control control = abandonRequest.getCurrentControl();

        assertEquals( 2, abandonRequest.getControls().size() );
        assertFalse( control.getCriticality() );
        assertEquals( "1.2.840.113556.1.4.789", control.getControlType() );
        assertEquals( "Some other text", StringTools.utf8ToString( ( byte[] ) control.getControlValue() ) );
    }
View Full Code Here

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

        BindRequest abandonRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();
        Control control = abandonRequest.getCurrentControl();

        assertEquals( 3, abandonRequest.getControls().size() );
        assertTrue( control.getCriticality() );
        assertEquals( "1.2.840.113556.1.4.456", control.getControlType() );
        assertEquals( StringTools.EMPTY_BYTES, control.getControlValue() );
    }
View Full Code Here

     * @throws IOException
     * @throws NamingException
     */
    private void bind( int messageId ) throws EncoderException, DecoderException, IOException, NamingException
    {
        BindRequest bindRequest = new BindRequest();
        LdapMessage message = new LdapMessage();
        LdapAuthentication authentication = new SimpleAuthentication();
        ( ( SimpleAuthentication ) authentication ).setSimple( StringTools.getBytesUtf8( password ) );

        bindRequest.setAuthentication( authentication );
        bindRequest.setName( new LdapDN( user ) );
        bindRequest.setVersion( 3 );

        message.setProtocolOP( bindRequest );
        message.setMessageId( messageId );

        // Encode and send the bind request
View Full Code Here

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

        BindRequest bindRequest = ( BindRequest ) parser.getBatchRequest().getCurrentRequest();

        assertEquals( "cn=Bob Rush,ou=Dev,dc=Example,dc=COM", bindRequest.getName().toString() );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.codec.bind.BindRequest

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.