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

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


            // SASL BindRequest
            if ( !( message instanceof BindRequest ) || ( ( BindRequest ) message ).isSimple()
                || ldapSession.isSimpleAuthPending() )
            {
                LOG.error( I18n.err( I18n.ERR_732 ) );
                BindResponse bindResponse = new BindResponseImpl( message.getMessageId() );
                LdapResult bindResult = bindResponse.getLdapResult();
                bindResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
                bindResult.setDiagnosticMessage( I18n.err( I18n.ERR_732 ) );
                ldapSession.getIoSession().write( bindResponse );
                return;
            }
View Full Code Here


     */
    public void action( LdapMessageContainer<BindResponseDecorator> container )
    {
        // Now, we can allocate the BindResponse Object
        BindResponseDecorator bindResponse = new BindResponseDecorator(
            container.getLdapCodecService(), new BindResponseImpl( container.getMessageId() ) );
        container.setMessage( bindResponse );
    }
View Full Code Here

    /**
     * Creates a new getDecoratedMessage() of AuthResponseDsml.
     */
    public BindResponseDsml( LdapApiService codec )
    {
        super( codec, new BindResponseImpl() );
    }
View Full Code Here

            {
                String msg = "Incorrect DN given : " + nameStr + " (" + Strings.dumpBytes( nameBytes )
                    + ") is invalid";
                LOG.error( "{} : {}", msg, ine.getMessage() );

                BindResponseImpl response = new BindResponseImpl( bindRequestMessage.getMessageId() );

                throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
                    Dn.EMPTY_DN, ine );
            }
        }
View Full Code Here

        if ( tlv.getLength() == 0 )
        {
            String msg = I18n.err( I18n.ERR_04079 );
            LOG.error( msg );

            BindResponseImpl response = new BindResponseImpl( bindRequestMessage.getMessageId() );

            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_CREDENTIALS,
                bindRequestMessage.getDn(), null );
        }
View Full Code Here

        bindContext.setDn( bindRequest.getDn() );
        bindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.BIND ) );

        OperationManager operationManager = directoryService.getOperationManager();

        BindResponse bindResp = new BindResponseImpl( newId );
        bindResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );

        try
        {
            if ( !bindRequest.isSimple() )
            {
                bindContext.setSaslMechanism( bindRequest.getSaslMechanism() );
            }

            operationManager.bind( bindContext );
            session = bindContext.getSession();

            bindResp.addAllControls( bindContext.getResponseControls() );
        }
        catch ( LdapOperationException e )
        {
            LOG.warn( e.getMessage(), e );
            LdapResult res = bindResp.getLdapResult();
            res.setDiagnosticMessage( e.getMessage() );
            res.setResultCode( e.getResultCode() );
        }

        return bindResp;
View Full Code Here

        bindContext.setCredentials( bindRequest.getCredentials() );
        bindContext.setDn( bindRequest.getName() );

        OperationManager operationManager = directoryService.getOperationManager();

        BindResponse bindResp = new BindResponseImpl( newId );
        bindResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );

        try
        {
            if ( !bindRequest.isSimple() )
            {
                bindContext.setSaslMechanism( bindRequest.getSaslMechanism() );
            }

            operationManager.bind( bindContext );
            session = bindContext.getSession();

            bindResp.addAllControls( bindContext.getResponseControls() );
        }
        catch ( LdapOperationException e )
        {
            LOG.warn( e.getMessage(), e );
            LdapResult res = bindResp.getLdapResult();
            res.setDiagnosticMessage( e.getMessage() );
            res.setResultCode( e.getResultCode() );
        }

        return bindResp;
View Full Code Here

TOP

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

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.