server state cleanup
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
|
||||
@@ -108,6 +108,26 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
}
|
||||
}
|
||||
|
||||
//get the api error code associated with the server state
|
||||
public ApiErrorCode ApiErrorCode
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (_currentState)
|
||||
{
|
||||
case ServerState.Open:
|
||||
throw new System.NotSupportedException("ApiServerState:ApiErrorCode - No error code is associated with server state OPEN");
|
||||
case ServerState.OpsOnly:
|
||||
return ApiErrorCode.API_OPS_ONLY;
|
||||
case ServerState.Closed:
|
||||
return ApiErrorCode.API_CLOSED;
|
||||
|
||||
}
|
||||
throw new System.NotSupportedException("ApiServerState:ApiErrorCode - No error code is associated with server state UNKNOWN");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void SetOpsOnly(string reason)
|
||||
{
|
||||
@@ -143,7 +163,7 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentState == ServerState.OpsOnly;
|
||||
return _currentState == ServerState.OpsOnly && !SYSTEM_LOCK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +188,7 @@ namespace AyaNova.Api.ControllerHelpers
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsOpen || IsOpsOnly;
|
||||
return (IsOpen || IsOpsOnly) && !SYSTEM_LOCK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user