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

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


        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


        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

            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

        catch ( Exception e )
        {
            // Something went wrong. Write back an error message
            // For BindRequest, it should be an InvalidCredentials,
            // no matter what kind of exception we got.
            ResultCodeEnum code = null;
            LdapResult result = bindRequest.getResultResponse().getLdapResult();

            if ( e instanceof LdapUnwillingToPerformException )
            {
                code = ResultCodeEnum.UNWILLING_TO_PERFORM;
                result.setResultCode( code );
            }
            else if ( e instanceof LdapInvalidDnException )
            {
                code = ResultCodeEnum.INVALID_DN_SYNTAX;
                result.setResultCode( code );
            }
            else
            {
                code = ResultCodeEnum.INVALID_CREDENTIALS;
                result.setResultCode( code );
            }

            String msg = code.toString() + ": Bind failed: " + e.getLocalizedMessage();

            if ( LOG.isDebugEnabled() )
            {
                msg += ":\n" + ExceptionUtils.getStackTrace( e );
                msg += "\n\nBindRequest = \n" + bindRequest.toString();
View Full Code Here

        catch ( Exception e )
        {
            // Something went wrong. Write back an error message
            // For BindRequest, it should be an InvalidCredentials,
            // no matter what kind of exception we got.
            ResultCodeEnum code = null;
            LdapResult result = bindRequest.getResultResponse().getLdapResult();

            if ( e instanceof LdapUnwillingToPerformException )
            {
                code = ResultCodeEnum.UNWILLING_TO_PERFORM;
                result.setResultCode( code );
            }
            else if ( e instanceof LdapInvalidDnException )
            {
                code = ResultCodeEnum.INVALID_DN_SYNTAX;
                result.setResultCode( code );
            }
            else
            {
                code = ResultCodeEnum.INVALID_CREDENTIALS;
                result.setResultCode( code );
            }

            String msg = code.toString() + ": Bind failed: " + e.getLocalizedMessage();

            if ( LOG.isDebugEnabled() )
            {
                msg += ":\n" + ExceptionUtils.getStackTrace( e );
                msg += "\n\nBindRequest = \n" + bindRequest.toString();
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

            connection.bind( ( String ) null, "abc" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            ResultCodeEnum resultCode = lae.getResultCode();
            assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, resultCode );
            assertFalse( connection.isAuthenticated() );
            assertTrue( connection.isConnected() );
        }
    }
View Full Code Here

            connection.bind( "uid=admin,ou=system" );
            fail();
        }
        catch ( LdapUnwillingToPerformException lutpe )
        {
            ResultCodeEnum resultCode = lutpe.getResultCode();
            assertEquals( ResultCodeEnum.UNWILLING_TO_PERFORM, resultCode );
            assertFalse( connection.isAuthenticated() );
            assertTrue( connection.isConnected() );
        }
    }
View Full Code Here

            connection.bind( "uid=admin,ou=system", "badpassword" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            ResultCodeEnum resultCode = lae.getResultCode();
            assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, resultCode );
            assertFalse( connection.isAuthenticated() );
            assertTrue( connection.isConnected() );
        }
    }
View Full Code Here

            connection.bind( "uid=wrong,ou=system", "secret" );
            fail();
        }
        catch ( LdapAuthenticationException lae )
        {
            ResultCodeEnum resultCode = lae.getResultCode();
            assertEquals( ResultCodeEnum.INVALID_CREDENTIALS, resultCode );
            assertFalse( connection.isAuthenticated() );
            assertTrue( connection.isConnected() );
        }
    }
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.