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

  public static boolean isComplete(V1Job job) {
    if (job == null) {
      return false;
    }

    V1JobStatus status = job.getStatus();
    LOGGER.fine(
        "JobWatcher.isComplete status of job " + job.getMetadata().getName() + ": " + status);
    if (status != null) {
      List<V1JobCondition> conds = status.getConditions();
      if (conds != null) {
        for (V1JobCondition cond : conds) {
          if ("Complete".equals(cond.getType())) {
            if ("True".equals(cond.getStatus())) { // TODO: Verify V1JobStatus.succeeded count?
              // Job is complete!
              LOGGER.info(MessageKeys.JOB_IS_COMPLETE, job.getMetadata().getName(), status);
              return true;
            }
          }
        }
      }
    }
    return false;
  }

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

}