package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

import models.Server.Status;
import play.db.jpa.Model;

@Entity
public class EventLog extends Model {

  @OneToOne
  @JoinColumn(name = "server_id")
  public Server server;
  @Enumerated(EnumType.ORDINAL)
  public Status status;
  public String message;
  public Date created;

}

@@ -143,309 +143,429 @@
 ed;%0A
-import javax.persistence.JoinColumn;%0Aimport javax.persistence.OneToOne;%0A%0Aimport models.Server.Status;%0Aimport play.db.jpa.Model;%0A%0A@Entity%0Apublic class EventLog extends Model %7B%0A%0A  @OneToOne%0A  @JoinColumn(name = %22server_id%22)%0A  public Server server;%0A  @Enumerated(EnumType.ORDINAL)%0A  public Status status;
+%0Aimport play.db.jpa.Model;%0A%0A@Entity%0Apublic class EventLog extends Model %7B%0A%0A  public static enum Type %7B%0A    Server, Probe;%0A  %7D%0A%0A  // Event creates from server status or probe status%0A  @Enumerated(EnumType.ORDINAL)%0A  public Type type;%0A%0A  // Event instance, server id or probe id%0A  public Long instance;%0A%0A  // Event status, e.g. 0 for server means fail and 1 for server means ok.%0A  public Integer status;%0A%0A  // Event message
 %0A  p

Change event model to support probe status.