class JobWatcher extends Watcher<V1Job> implements WatchListener<V1Job> {

  static String getFailedReason(V1Job job) {
    V1JobStatus status = job.getStatus();
    if (status != null && status.getConditions() != null) {
      for (V1JobCondition cond : status.getConditions()) {
        if ("Failed".equals(cond.getType()) && "True".equals(cond.getStatus())) {
          return cond.getReason();
        }
      }
    }
    return null;
  }

  private  JobWatcher(
      String namespace,
      String initialResourceVersion,
      WatchTuning tuning,
      AtomicBoolean isStopping);

}