Class ClusterRoleStatus
java.lang.Object
org.eclipse.ditto.internal.utils.health.cluster.ClusterRoleStatus
- All Implemented Interfaces:
org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
@Immutable
public final class ClusterRoleStatus
extends Object
implements org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
Holds the status of a specific pekko cluster role.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends Object>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.eclipse.ditto.json.JsonFieldDefinition<String>JSON value of the leaders address.static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray>JSON array of reachable members.static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray>JSON array of unreachable members. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the optional leader for the givenrole.Returns a list of all reachable members for the givenrole.getRole()Returns the cluster role.Returns a list of all unreachable members for the givenrole.inthashCode()static ClusterRoleStatusReturns a newClusterRoleStatusinstance with the specifiedleader,reachableandunreachablemembers.org.eclipse.ditto.json.JsonObjecttoJson()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
getImplementedSchemaVersion, getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
Field Details
-
JSON_KEY_REACHABLE
public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray> JSON_KEY_REACHABLEJSON array of reachable members. -
JSON_KEY_UNREACHABLE
public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray> JSON_KEY_UNREACHABLEJSON array of unreachable members. -
JSON_KEY_LEADER
JSON value of the leaders address.
-
-
Method Details
-
of
public static ClusterRoleStatus of(String role, Set<String> reachable, Set<String> unreachable, String leader) Returns a newClusterRoleStatusinstance with the specifiedleader,reachableandunreachablemembers.- Parameters:
role- the cluster role.reachable- a list of all reachable members.unreachable- a list of all unreachable members.leader- the leader.- Returns:
- the ClusterRoleStatus instance.
-
getRole
Returns the cluster role.- Returns:
- the cluster role.
-
getReachable
Returns a list of all reachable members for the givenrole.- Returns:
- a list of all reachable members for the given
role.
-
getUnreachable
Returns a list of all unreachable members for the givenrole.- Returns:
- a list of all unreachable members for the given
role.
-
getLeader
Returns the optional leader for the givenrole.- Returns:
- the leader or an empty optional.
-
toJson
public org.eclipse.ditto.json.JsonObject toJson()- Specified by:
toJsonin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
-
equals
-
hashCode
public int hashCode() -
toString
-