package com.khoubyari.example.domain;

import java.util.Calendar;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * Created by ann on 4/16/15.
 */
public class Status {

  private final Boolean isUpdateNeeded;

  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssZ", timezone = "EST")
  private final Date timestamp;

  private final boolean runHealthCheckNow;

  private final String data = "get-process";

  private static final String healthCheckCronSchedule = " 0 08 * * * ";

  public Status(Boolean isUpdateNeeded) {
    this.isUpdateNeeded = isUpdateNeeded;
    timestamp = Calendar.getInstance().getTime();
    runHealthCheckNow = false;

  }

  public Boolean isUpdateNeeded() {
    return isUpdateNeeded;
  }

  public Date getTimestamp() {
    return timestamp;
  }

  public String getData() {

    return data;
  }

  public static String getHealthCheckCronSchedule() {
    return healthCheckCronSchedule;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o)
      return true;
    if (o == null || getClass() != o.getClass())
      return false;

    Status status = (Status) o;

    if (isUpdateNeeded != null ? !isUpdateNeeded.equals(status.isUpdateNeeded)
        : status.isUpdateNeeded != null)
      return false;
    return !(timestamp != null ? !timestamp.equals(status.timestamp) : status.timestamp != null);

  }

  @Override
  public int hashCode() {
    int result = isUpdateNeeded != null ? isUpdateNeeded.hashCode() : 0;
    result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
    return result;
  }

  @Override
  public String toString() {
    return "Status{" + "isUpdateNeeded=" + isUpdateNeeded + ", timestamp=" + timestamp + '}';
  }
}

@@ -472,23 +472,16 @@
 private 
-static 
 final St
@@ -889,15 +889,8 @@
 lic 
-static 
 Stri

send the cron schedule.