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

    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 of reachable members.
    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 for the given role.
    Returns a list of all reachable members for the given role.
    Returns the cluster role.
    Returns a list of all unreachable members for the given role.
    int
     
    of(String role, Set<String> reachable, Set<String> unreachable, String leader)
    Returns a new ClusterRoleStatus instance with the specified leader, reachable and unreachable members.
    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_LEADER

      public static final org.eclipse.ditto.json.JsonFieldDefinition<String> 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 new ClusterRoleStatus instance with the specified leader, reachable and unreachable members.
      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

      public String getRole()
      Returns the cluster role.
      Returns:
      the cluster role.
    • getReachable

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

      public Set<String> getUnreachable()
      Returns a list of all unreachable members for the given role.
      Returns:
      a list of all unreachable members for the given role.
    • getLeader

      public Optional<String> getLeader()
      Returns the optional leader for the given role.
      Returns:
      the leader or an empty optional.
    • 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