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

Examples of org.apache.directory.shared.ldap.codec.LdapResultCodec


        // Creating the response
        if ( batchResponseDsml != null )
        {
            AuthResponseDsml authResponseDsml = new AuthResponseDsml();
            LdapResultCodec ldapResult = new LdapResultCodec();
            ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
            ldapResult.setErrorMessage( "This kind of request is not yet supported." );
            authResponseDsml.setLdapResult( ldapResult );
            batchResponseDsml.addResponse( authResponseDsml );
        }
    }
View Full Code Here


        // Creating the response
        if ( batchResponseDsml != null )
        {
            CompareResponseDsml compareResponseDsml = new CompareResponseDsml();
            LdapResultCodec ldapResult = new LdapResultCodec();
            ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
            ldapResult.setErrorMessage( "This kind of request is not yet supported." );
            compareResponseDsml.setLdapResult( ldapResult );
            batchResponseDsml.addResponse( compareResponseDsml );
        }
    }
View Full Code Here

        // Creating the response
        if ( batchResponseDsml != null )
        {
            ExtendedResponseDsml extendedResponseDsml = new ExtendedResponseDsml();
            LdapResultCodec ldapResult = new LdapResultCodec();
            ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
            ldapResult.setErrorMessage( "This kind of request is not yet supported." );
            extendedResponseDsml.setLdapResult( ldapResult );
            batchResponseDsml.addResponse( extendedResponseDsml );
        }
    }
View Full Code Here

     * @return
     *      the corresponding LDAP Result
     */
    private LdapResultCodec getLdapResult( StudioProgressMonitor monitor, MessageTypeEnum messageType )
    {
        LdapResultCodec ldapResult = new LdapResultCodec();

        if ( !monitor.errorsReported() )
        {
            ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
        }
        else
        {
            // Getting the exception
            Throwable t = monitor.getException();

            // Setting the result code
            ldapResult.setResultCode( ResultCodeEnum.getBestEstimate( t, messageType ) );

            // Setting the error message if there's one
            if ( t.getMessage() != null )
            {
                ldapResult.setErrorMessage( t.getMessage() );
            }
        }

        return ldapResult;
    }
View Full Code Here

            }
        }

        // Creating and adding a search result done at the end of the results
        SearchResultDoneCodec srd = new SearchResultDoneCodec();
        LdapResultCodec ldapResult = new LdapResultCodec();
        if ( !monitor.errorsReported() )
        {
            ldapResult.setResultCode( ResultCodeEnum.SUCCESS );
        }
        else
        {
            // Getting the exception
            Throwable t = monitor.getException();

            // Setting the result code
            ldapResult.setResultCode( ResultCodeEnum.getBestEstimate( t, MessageTypeEnum.SEARCH_REQUEST ) );

            // Setting the error message if there's one
            if ( t.getMessage() != null )
            {
                ldapResult.setErrorMessage( t.getMessage() );
            }
        }
        srd.setLdapResult( ldapResult );
        sr.addResponse( new SearchResultDoneDsml( srd ) );
    }
View Full Code Here

        bb.clear();

        // Get the response
        LdapMessageCodec response = readResponse( bb );

        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();

        if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( isDebugEnabled() )
            {
                System.out.println( "Add of Entry " + entry.getDn() + " was successful" );
            }

            return IMPORT_SUCCESS;
        }
        else
        {
            System.err.println( I18n.err( I18n.ERR_203, entry.getDn(), result.getErrorMessage() ) );

            return IMPORT_ERROR;
        }
    }
View Full Code Here

        bb.clear();

        // Get the response
        LdapMessageCodec response = readResponse( bb );

        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();

        if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( isDebugEnabled() )
            {
                System.out.println( "Delete of Entry " + entry.getDn() + " was successful" );
            }

            return IMPORT_SUCCESS;
        }
        else
        {
            System.err.println( I18n.err( I18n.ERR_204, entry.getDn(), result.getErrorMessage() ) );
            return IMPORT_ERROR;
        }
    }
View Full Code Here

        bb.clear();

        // Get the response
        LdapMessageCodec response = readResponse( bb );

        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();

        if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( isDebugEnabled() )
            {
                System.out.println( "ModifyDn of Entry " + entry.getDn() + " was successful" );
            }

            return IMPORT_SUCCESS;
        }
        else
        {
            System.err.println( I18n.err( I18n.ERR_205, entry.getDn(), result.getErrorMessage() ) );
            return IMPORT_ERROR;
        }
    }
View Full Code Here

        bb.clear();

        // Get the response
        LdapMessageCodec response = readResponse( bb );

        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();

        if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( isDebugEnabled() )
            {
                System.out.println( "Modify of Entry " + entry.getDn() + " was successful" );
            }

            return IMPORT_SUCCESS;
        }
        else
        {
            System.err.println( I18n.err( I18n.ERR_206, entry.getDn(), result.getErrorMessage() ) );
            return IMPORT_ERROR;
        }
    }
View Full Code Here

        bb.clear();

        // Get the bind response
        LdapMessageCodec response = readResponse( bb );

        LdapResultCodec result = ((LdapResponseCodec)response).getLdapResult();

        if ( result.getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( isDebugEnabled() )
            {
                System.out.println( "Binding of user " + user + " was successful" );
            }
        }
        else
        {
            System.err.println( I18n.err( I18n.ERR_207, user, result.getErrorMessage() ) );
            System.exit( 1 );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.codec.LdapResultCodec

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.