Package com.atlassian.bitbucket.mesh
Enum Class MeshNode.State
- All Implemented Interfaces:
Serializable
,Comparable<MeshNode.State>
,Constable
- Enclosing interface:
- MeshNode
Enumerates the possible states for a given
Mesh node
.- Since:
- 8.4
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIndicates that the node is available and that requests can be routed to it.Indicates that the node is being removed from the cluster.Indicates that the node is disabled.Indicates that the node is currently draining its RPC requests.Indicates that the node is currently offline. -
Method Summary
Modifier and TypeMethodDescriptionstatic MeshNode.State
fromId
(int id) Retrieves the state associated with the specifiedID
.int
getId()
Retrieves a unique identifier for this state.Retrieves the status message describing this state.static MeshNode.State
Returns the enum constant of this class with the specified name.static MeshNode.State[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AVAILABLE
Indicates that the node is available and that requests can be routed to it. -
DELETING
Indicates that the node is being removed from the cluster. All repository replicas located on the node are being migrated to other remaining nodes if there are sufficient remaining Mesh nodes. -
DISABLED
Indicates that the node is disabled. All RPC requests have drained and no new requests are routed to the node. The node can be safely taken down for maintenance when it's in this state. -
DRAINING
-
OFFLINE
Indicates that the node is currently offline.
-
-
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
-
getId
public int getId()Retrieves a unique identifier for this state. Unlike the enum's ordinal or name, this value will never change for a given entry.- Returns:
- the state's unique identifier
-
getStatusMessage
Retrieves the status message describing this state.- Returns:
- the state's status message
-
fromId
Retrieves the state associated with the specifiedID
.- Parameters:
id
- the ID to retrieve aState
for- Returns:
- the state with the specified ID
- Throws:
IllegalArgumentException
- if no state exists with the specified ID
-