//------------------------------------------------------------------------------
// <copyright file="SOAFaultCode.java" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
// <summary>
//      Define the fault code for the SOA session.
// </summary>
//------------------------------------------------------------------------------
package com.microsoft.hpc.exceptions;

public enum SOAFaultCode {

	ConnectToSchedulerFailure ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1000),
        OpenJobFailure ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1001),
        OperationTimeout ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1002),
        Broker_BrokerNodeUnavailable ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1003),
        ConnectSessionLauncherFailure ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1004),
        Broker_CustomBrokerReadyTimeout ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1005),
        Broker_CustomBrokerExitBeforeReady ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1006),
        Broker_CannotGetUserSID ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1007),
        Broker_FailedToGetSecurityDescriptor ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1008),
        Broker_RegisterJobFailed ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1009),
        Broker_FailedToGetJobState ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100a),
        Broker_EOMRejected ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100b),
        Broker_FailedToGetJobPropertyId ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100c),
        Broker_BrokerIsOffline ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100d),
        Broker_FailedToStartBrokerServiceProcess ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100e),
        Broker_AlreadyInitialized ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x100f),
        Broker_GetResponsesHandlerDisposed ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1010),
        ConnectBrokerLauncherFailure ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1011),
        GetJobPropertyFailure ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1012),
        Broker_TooManyBrokerRunning ( SOAFaultCodeCategory.SessionConnectionError.getCode() | 0x1013),
        NoAvailableBrokerNodes ( SOAFaultCodeCategory.SessionError.getCode() | 0x1000),
        CreateJobFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1001),
        CreateJobPropertiesFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1002),
        GetClusterPropertyFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1003),
        CreateJobTasksFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1004),
        SubmitJobFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1005),
        BrokerQueueFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x1006),
        Broker_BrokerUnavailable ( SOAFaultCodeCategory.SessionError.getCode() | 0x1007),
        Broker_LoadNetworkPrefixFailed ( SOAFaultCodeCategory.SessionError.getCode() | 0x1008),
        Broker_ConnectionToSchedulerIsNotReady ( SOAFaultCodeCategory.SessionError.getCode() | 0x1009),
        Broker_BrokerQueueFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x100a),
        Broker_SessionFailure ( SOAFaultCodeCategory.SessionError.getCode() | 0x100b),
        ClientPurged ( SOAFaultCodeCategory.ApplicationError.getCode() | 0x1000),
        Broker_RetryLimitExceeded ( SOAFaultCodeCategory.ApplicationError.getCode() | 0x1001),
        Broker_SendBackResponseFailed ( SOAFaultCodeCategory.ApplicationError.getCode() | 0x1002),
        ClientTimeout ( SOAFaultCodeCategory.ApplicationError.getCode() | 0x1003),
        Service_InitializeFailed ( SOAFaultCodeCategory.Internal.getCode() | 0x1003),
        InvalidArgument ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1000),
        InvalidSessionId ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1001),
        AuthenticationFailure ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1002),
        AccessDenied_Broker ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1003),
        AccessDenied_BrokerLauncher ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1004),
        AccessDenied_BrokerQueue ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1005),
        StorageServiceNotAvailble ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1006),
        StorageSpaceNotSufficient ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1007),
        StorageFailure ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1008),
        StorageClosed ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1009),
        InvalidAttachDurableSession ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100a),
        InvalidAttachInteractiveSession ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100b),
        Broker_OpenFrontEndFailed ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100c),
        Broker_NotSupportedTransportScheme ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100d),
        Broker_InvalidConfiguration ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100e),
        Broker_SessionIdAlreadyExists ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x100f),
        Broker_InvalidSessionId ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1010),
        Broker_BindingSecurityModeMismatched ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1011),
        Broker_BindingNotSupported ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1012),
        Broker_NoDefaultUriForScheme ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1013),
        Broker_CannotFindCustomBindingConfiguration ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1014),
        Broker_AuthenticationFailure ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1015),
        Broker_InvalidClientIdOrTooLong ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1016),
        Broker_ClientIdNotMatch ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1017),
        Broker_UserNameNotMatch ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1018),
        Session_ValidateJobFailed_NotServiceJob ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x1019),
        Session_ValidateJobFailed_NotDurableSession ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x101a),
        Session_ValidateJobFailed_AlreadyFninshed ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x101b),
        Session_ValidateJobFailed_JobCanceled ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x101c),
        ConfigFile_Invalid ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x101d),
        Service_NotFound ( SOAFaultCodeCategory.SessionFatalError.getCode() | 0x101e),
        UnknownError ( SOAFaultCodeCategory.Unknown.getCode() | 0x1000);

	private int code;

	private SOAFaultCode(int code) {
		this.code = code;
	}

	public int getCode() {
		return code;
	}

	public static SOAFaultCode getEnum(int code) {
		return SOAFaultCode.class.getEnumConstants()[code];
	}

}
