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

Examples of org.apache.directory.api.ldap.model.message.ResultCodeEnum


            ctx = new InitialLdapContext( env, JndiUtils.toJndiControls( directoryService.getLdapCodecService(),
                connCtls ) );
        }
        catch ( Exception e )
        {
            ResultCodeEnum code;
            Dn dn = null;

            if ( e instanceof LdapOperationException )
            {
                code = ( ( LdapOperationException ) e ).getResultCode();
View Full Code Here


        LdapResult result = req.getResultResponse().getLdapResult();

        /*
         * Set the result code or guess the best option.
         */
        ResultCodeEnum code;
        if ( e instanceof LdapOperationException )
        {
            code = ( ( LdapOperationException ) e ).getResultCode();
        }
        else
        {
            code = ResultCodeEnum.getBestEstimate( e, req.getType() );
        }

        result.setResultCode( code );

        /*
         * Setup the error message to put into the request and put entire
         * exception into the message if we are in debug mode.  Note we
         * embed the result code name into the message.
         */
        String msg = code.toString() + ": failed for " + req + ": " + e.getLocalizedMessage();

        if ( LOG.isDebugEnabled() )
        {
            LOG.debug( msg, e );

View Full Code Here

        try
        {
            ResultResponse response = operation.process();
            PasswordPolicy passwordPolicy = getPasswordPolicy( response );

            ResultCodeEnum resultCode = response.getLdapResult().getResultCode();
            if ( resultCode == ResultCodeEnum.SUCCESS )
            {
                if ( passwordPolicy != null )
                {
                    return PasswordWarningImpl.newWarning( passwordPolicy );
View Full Code Here

        try
        {
            BindResponse bindResponse = null;
            byte[] response = null;
            ResultCodeEnum result = null;

            // Creating a map for SASL properties
            Map<String, Object> properties = new HashMap<String, Object>();

            // Quality of Protection SASL property
View Full Code Here

     * @exception Exception If we had an error while processing the request
     */
    protected void processRequest( DsmlDecorator<? extends Request> request, BufferedWriter respWriter )
        throws Exception
    {
        ResultCodeEnum resultCode = null;

        switch ( request.getDecorated().getType() )
        {
            case ABANDON_REQUEST:
                connection.abandon( ( AbandonRequest ) request );
View Full Code Here

            Attribute objectClass = entry.get( OBJECT_CLASS_AT );

            if ( objectClass == null )
            {
                String msg = I18n.err( I18n.ERR_217, entryDn.getName(), entry );
                ResultCodeEnum rc = ResultCodeEnum.OBJECT_CLASS_VIOLATION;
                LdapSchemaViolationException e = new LdapSchemaViolationException( rc, msg );
                //e.setResolvedName( entryDn );
                throw e;
            }
View Full Code Here

        Exception cause = null;

        /*
         * Set the result code or guess the best option.
         */
        ResultCodeEnum code;

        if ( e instanceof CursorClosedException )
        {
            cause = ( Exception ) ( ( CursorClosedException ) e ).getCause();

            if ( cause == null )
            {
                cause = e;
            }
        }
        else
        {
            cause = e;
        }

        if ( cause instanceof LdapOperationException )
        {
            code = ( ( LdapOperationException ) cause ).getResultCode();
        }
        else
        {
            code = ResultCodeEnum.getBestEstimate( cause, req.getType() );
        }

        result.setResultCode( code );

        /*
         * Setup the error message to put into the request and put entire
         * exception into the message if we are in debug mode.  Note we
         * embed the result code name into the message.
         */
        String msg = code.toString() + ": failed for " + req + ": " + cause.getLocalizedMessage();

        if ( IS_DEBUG )
        {
            LOG.debug( msg, cause );
            msg += ":\n" + ExceptionUtils.getStackTrace( cause );
View Full Code Here

           
            return ReplicationStatusEnum.DISCONNECTED;
        }
        else
        {
            ResultCodeEnum resultCode = handleSearchResultDone( ( SearchResultDone ) resp );
   
            CONSUMER_LOG.debug( "Response from {} : {}", config.getProducer(), resultCode );
            LOG.debug( "sync operation returned result code {}", resultCode );
   
            if ( resultCode == ResultCodeEnum.NO_SUCH_OBJECT )
View Full Code Here

        try
        {
            BindResponse bindResponse = null;
            byte[] response = null;
            ResultCodeEnum result = null;

            // Creating a map for SASL properties
            Map<String, Object> properties = new HashMap<String, Object>();

            // Quality of Protection SASL property
View Full Code Here

        LdapResult result = req.getResultResponse().getLdapResult();

        /*
         * Set the result code or guess the best option.
         */
        ResultCodeEnum code;

        if ( e instanceof LdapOperationException )
        {
            code = ( ( LdapOperationException ) e ).getResultCode();
        }
        else
        {
            code = ResultCodeEnum.getBestEstimate( e, req.getType() );
        }

        result.setResultCode( code );

        /*
         * Setup the error message to put into the request and put entire
         * exception into the message if we are in debug mode.  Note we
         * embed the result code name into the message.
         */
        String msg = code.toString() + ": failed for " + req + ": " + e.getLocalizedMessage();

        LOG.debug( msg, e );

        if ( LOG.isDebugEnabled() || ( code == ResultCodeEnum.OTHER ) )
        {
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.message.ResultCodeEnum

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.