java.lang.Object
org.eclipse.ditto.internal.utils.health.cluster.ClusterStatus
All Implemented Interfaces:
org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>

@Immutable public final class ClusterStatus extends Object implements org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
Holds the status of the pekko cluster.
  • 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

    Fields
    Modifier and Type
    Field
    Description
    static 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 with all roles this cluster node has.
    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.JsonObject>
    JSON object with the cluster roles and their status.
    static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray>
    JSON array of all addresses of members which have seen this cluster state.
    static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray>
    JSON array of unreachable members.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Returns the optional leader.
    Returns a list of the roles this member has.
    Returns a list of all reachable members.
    Returns the status of each cluster roles members.
    Returns a list of all members that have seen this cluster state.
    Returns a list of all unreachable members.
    int
     
    of(Set<String> reachable, Set<String> unreachable, Set<String> seenBy, String leader, Set<String> ownRoles, Set<ClusterRoleStatus> roles)
    Returns a new ClusterStatus instance with the given parameters.
    org.eclipse.ditto.json.JsonObject
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods 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_REACHABLE
      JSON array of reachable members.
    • JSON_KEY_UNREACHABLE

      public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray> JSON_KEY_UNREACHABLE
      JSON array of unreachable members.
    • JSON_KEY_SEEN_BY

      public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray> JSON_KEY_SEEN_BY
      JSON array of all addresses of members which have seen this cluster state.
    • JSON_KEY_LEADER

      public static final org.eclipse.ditto.json.JsonFieldDefinition<String> JSON_KEY_LEADER
      JSON value of the leaders address.
    • JSON_KEY_OWN_ROLES

      public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonArray> JSON_KEY_OWN_ROLES
      JSON array with all roles this cluster node has.
    • JSON_KEY_ROLES

      public static final org.eclipse.ditto.json.JsonFieldDefinition<org.eclipse.ditto.json.JsonObject> JSON_KEY_ROLES
      JSON object with the cluster roles and their status.
  • Method Details

    • of

      public static ClusterStatus of(Set<String> reachable, Set<String> unreachable, Set<String> seenBy, String leader, Set<String> ownRoles, Set<ClusterRoleStatus> roles)
      Returns a new ClusterStatus instance with the given parameters.
      Parameters:
      reachable - a list of all reachable members.
      unreachable - a list of all unreachable members.
      seenBy - a list of all members that have seen this cluster state.
      leader - the leader.
      ownRoles - a list of all roles this member has.
      roles - the status of each cluster roles members.
      Returns:
      the ClusterState instance.
    • getReachable

      public Set<String> getReachable()
      Returns a list of all reachable members.
      Returns:
      a list of all reachable members.
    • getUnreachable

      public Set<String> getUnreachable()
      Returns a list of all unreachable members.
      Returns:
      a list of all unreachable members.
    • getSeenBy

      public Set<String> getSeenBy()
      Returns a list of all members that have seen this cluster state.
      Returns:
      a list of all members that have seen this cluster state.
    • getLeader

      public Optional<String> getLeader()
      Returns the optional leader.
      Returns:
      the leader or an empty optional.
    • getOwnRoles

      public Set<String> getOwnRoles()
      Returns a list of the roles this member has.
      Returns:
      a list of the roles this member has.
    • getRoles

      public Set<ClusterRoleStatus> getRoles()
      Returns the status of each cluster roles members.
      Returns:
      the status of each cluster roles members.
    • toJson

      public org.eclipse.ditto.json.JsonObject toJson()
      Specified by:
      toJson in interface org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object