Java Code Examples for org.apache.directory.api.ldap.model.message.ResultCodeEnum#UNAVAILABLE

The following examples show how to use org.apache.directory.api.ldap.model.message.ResultCodeEnum#UNAVAILABLE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultOperationManager.java    From MyVirtualDirectory with Apache License 2.0 5 votes vote down vote up
private void ensureStarted() throws LdapServiceUnavailableException
{
    if ( !directoryService.isStarted() )
    {
        throw new LdapServiceUnavailableException( ResultCodeEnum.UNAVAILABLE, I18n.err( I18n.ERR_316 ) );
    }
}
 
Example 2
Source File: DefaultOperationManager.java    From MyVirtualDirectory with Apache License 2.0 5 votes vote down vote up
private void ensureStarted() throws LdapServiceUnavailableException
{
    if ( !directoryService.isStarted() )
    {
        throw new LdapServiceUnavailableException( ResultCodeEnum.UNAVAILABLE, I18n.err( I18n.ERR_316 ) );
    }
}
 
Example 3
Source File: MyVDInterceptor.java    From MyVirtualDirectory with Apache License 2.0 4 votes vote down vote up
public static LdapException generateException(LDAPException e) {
	LdapException ex;
	
	switch (e.getResultCode()) {
	
		
		case 1 : ex = new org.apache.directory.api.ldap.model.exception.LdapOperationErrorException(e.getMessage(), e); break;
		case 2 : ex = new org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException(e.getMessage(), e); break;
		case 3 : ex = new org.apache.directory.api.ldap.model.exception.LdapTimeLimitExceededException(e.getMessage()); break;
		case 4 : ex = new org.apache.directory.api.ldap.model.exception.LdapSizeLimitExceededException(e.getMessage()); break;
		case 48:
		case 7 : ex = new org.apache.directory.api.ldap.model.exception.LdapAuthenticationNotSupportedException(ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED); break;
		case 8 : ex = new org.apache.directory.api.ldap.model.exception.LdapStrongAuthenticationRequiredException(e.getMessage()); break;
		case 11 : ex = new org.apache.directory.api.ldap.model.exception.LdapAdminLimitExceededException(e.getMessage()); break;
		case 53 :
		case 12 : ex = new org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException(e.getMessage()); break;
		case 13 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoPermissionException(e.getMessage()); break;
		case 16 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 17 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 18 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidSearchFilterException(e.getMessage()); break;
		case 21:
		case 19 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException(ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, e.getMessage());
		case 20 : ex = new org.apache.directory.api.ldap.model.exception.LdapAttributeInUseException(e.getMessage()); break;
		case 32 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException(e.getMessage()); break;
		case 34 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidDnException(e.getMessage()); break;
		case 49 : ex = new org.apache.directory.api.ldap.model.exception.LdapAuthenticationException(e.getMessage()); break;
		case 50 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoPermissionException(e.getMessage()); break;
		case 52 :
		case 51 : ex = new org.apache.directory.api.ldap.model.exception.LdapServiceUnavailableException(ResultCodeEnum.UNAVAILABLE); break;
		case 54 : ex = new org.apache.directory.api.ldap.model.exception.LdapLoopDetectedException(e.getMessage());
		case 64 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidDnException(e.getMessage()); break;
		case 65 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 66 : ex = new org.apache.directory.api.ldap.model.exception.LdapContextNotEmptyException(e.getMessage()); break;
		case 69 :
		case 67 : ex = new org.apache.directory.api.ldap.model.exception.LdapSchemaException(e.getMessage()); break;
		case 68 : ex = new org.apache.directory.api.ldap.model.exception.LdapEntryAlreadyExistsException(e.getMessage()); break;
		case 71 : ex = new org.apache.directory.api.ldap.model.exception.LdapAffectMultipleDsaException(e.getMessage()); break;
		case 80 : ex = new org.apache.directory.api.ldap.model.exception.LdapOtherException(e.getMessage()); break;
	    		
		default : ex = new org.apache.directory.api.ldap.model.exception.LdapOperationErrorException(e.getMessage(), e); break;
	}
	
	ex.setStackTrace(e.getStackTrace());
	return ex;
}
 
Example 4
Source File: MyVDInterceptor.java    From MyVirtualDirectory with Apache License 2.0 4 votes vote down vote up
public static LdapException generateException(LDAPException e) {
	LdapException ex;
	
	switch (e.getResultCode()) {
	
		
		case 1 : ex = new org.apache.directory.api.ldap.model.exception.LdapOperationErrorException(e.getMessage(), e); break;
		case 2 : ex = new org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException(e.getMessage(), e); break;
		case 3 : ex = new org.apache.directory.api.ldap.model.exception.LdapTimeLimitExceededException(e.getMessage()); break;
		case 4 : ex = new org.apache.directory.api.ldap.model.exception.LdapSizeLimitExceededException(e.getMessage()); break;
		case 48:
		case 7 : ex = new org.apache.directory.api.ldap.model.exception.LdapAuthenticationNotSupportedException(ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED); break;
		case 8 : ex = new org.apache.directory.api.ldap.model.exception.LdapStrongAuthenticationRequiredException(e.getMessage()); break;
		case 11 : ex = new org.apache.directory.api.ldap.model.exception.LdapAdminLimitExceededException(e.getMessage()); break;
		case 53 :
		case 12 : ex = new org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException(e.getMessage()); break;
		case 13 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoPermissionException(e.getMessage()); break;
		case 16 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 17 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 18 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidSearchFilterException(e.getMessage()); break;
		case 21:
		case 19 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException(ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, e.getMessage());
		case 20 : ex = new org.apache.directory.api.ldap.model.exception.LdapAttributeInUseException(e.getMessage()); break;
		case 32 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException(e.getMessage()); break;
		case 34 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidDnException(e.getMessage()); break;
		case 49 : ex = new org.apache.directory.api.ldap.model.exception.LdapAuthenticationException(e.getMessage()); break;
		case 50 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoPermissionException(e.getMessage()); break;
		case 52 :
		case 51 : ex = new org.apache.directory.api.ldap.model.exception.LdapServiceUnavailableException(ResultCodeEnum.UNAVAILABLE); break;
		case 54 : ex = new org.apache.directory.api.ldap.model.exception.LdapLoopDetectedException(e.getMessage());
		case 64 : ex = new org.apache.directory.api.ldap.model.exception.LdapInvalidDnException(e.getMessage()); break;
		case 65 : ex = new org.apache.directory.api.ldap.model.exception.LdapNoSuchAttributeException(e.getMessage()); break;
		case 66 : ex = new org.apache.directory.api.ldap.model.exception.LdapContextNotEmptyException(e.getMessage()); break;
		case 69 :
		case 67 : ex = new org.apache.directory.api.ldap.model.exception.LdapSchemaException(e.getMessage()); break;
		case 68 : ex = new org.apache.directory.api.ldap.model.exception.LdapEntryAlreadyExistsException(e.getMessage()); break;
		case 71 : ex = new org.apache.directory.api.ldap.model.exception.LdapAffectMultipleDsaException(e.getMessage()); break;
		case 80 : ex = new org.apache.directory.api.ldap.model.exception.LdapOtherException(e.getMessage()); break;
	    		
		default : ex = new org.apache.directory.api.ldap.model.exception.LdapOperationErrorException(e.getMessage(), e); break;
	}
	
	ex.setStackTrace(e.getStackTrace());
	return ex;
}