Enum WorkerStatus

java.lang.Object
java.lang.Enum<WorkerStatus>
co.yellowdog.platform.model.WorkerStatus
All Implemented Interfaces:
Serializable, Comparable<WorkerStatus>, java.lang.constant.Constable

public enum WorkerStatus extends Enum<WorkerStatus>
Describes the current status of a Worker.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The Worker has been instructed to execute a task.
    The Worker was considered to be lost but its heartbeat has returned, however it has not yet requested instruction.
    The Worker's heartbeat is late.
    The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost.
    The Worker has been instructed to shut down.
    The Worker has been instructed to sleep for a specified period of time.
    The Agent has been instructed to start the Worker.
    The Worker has been instructed to stop.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromAction(@NonNull WorkerAction action)
    Returns a WorkerStatus value based on the specified WorkerAction value.
    boolean
    Returns true, if the status indicates the Worker is currently available; otherwise, false.
    boolean
    Returns true, if the status indicates the Worker is currently healthy; otherwise, false.
    Returns the enum constant of this type with the specified name.
    static WorkerStatus[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DOING_TASK

      public static final WorkerStatus DOING_TASK
      The Worker has been instructed to execute a task.
    • SLEEPING

      public static final WorkerStatus SLEEPING
      The Worker has been instructed to sleep for a specified period of time.
    • STOPPED

      public static final WorkerStatus STOPPED
      The Worker has been instructed to stop.
    • STARTING

      public static final WorkerStatus STARTING
      The Agent has been instructed to start the Worker.
    • LATE

      public static final WorkerStatus LATE
      The Worker's heartbeat is late.
    • LOST

      public static final WorkerStatus LOST
      The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost.
    • FOUND

      public static final WorkerStatus FOUND
      The Worker was considered to be lost but its heartbeat has returned, however it has not yet requested instruction.
    • SHUTDOWN

      public static final WorkerStatus SHUTDOWN
      The Worker has been instructed to shut down.
  • Method Details

    • values

      public static WorkerStatus[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static WorkerStatus valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • fromAction

      public static WorkerStatus fromAction(@NonNull @NonNull WorkerAction action)
      Returns a WorkerStatus value based on the specified WorkerAction value.
      Parameters:
      action - the WorkerAction value
      Returns:
      a WorkerStatus value based on the specified WorkerAction value
    • isAvailable

      public boolean isAvailable()
      Returns true, if the status indicates the Worker is currently available; otherwise, false.
      Returns:
      true, if the status indicates the Worker is currently available; otherwise, false
    • isHealthy

      public boolean isHealthy()
      Returns true, if the status indicates the Worker is currently healthy; otherwise, false.
      Returns:
      true, if the status indicates the Worker is currently healthy; otherwise, false