Package com.bytedesk.core.server
Enum Class ServerStatusEnum
- All Implemented Interfaces:
Serializable
,Comparable<ServerStatusEnum>
,Constable
Server status enumeration
Defines different statuses of servers
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerStatusEnum
Convert from string value to enumGet Chinese name for the server statusboolean
Check if server is healthy (online and not in error/warning states)boolean
Check if server is operational (can serve requests)static ServerStatusEnum
Returns the enum constant of this class with the specified name.static ServerStatusEnum[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ONLINE
-
OFFLINE
-
MAINTENANCE
-
STARTING
-
STOPPING
-
RESTARTING
-
ERROR
-
WARNING
-
DEGRADED
-
OVERLOADED
-
UNKNOWN
-
-
Constructor Details
-
ServerStatusEnum
private ServerStatusEnum()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getChineseName
Get Chinese name for the server status- Returns:
- Chinese name
-
isHealthy
public boolean isHealthy()Check if server is healthy (online and not in error/warning states)- Returns:
- true if healthy
-
isOperational
public boolean isOperational()Check if server is operational (can serve requests)- Returns:
- true if operational
-
fromValue
Convert from string value to enum- Parameters:
value
- string value- Returns:
- ServerStatusEnum
-