package net.blackshard.clarity.tome;

import java.util.Date;
import javax.persistence.*;

/**
 * @author Matthew R. Trower
 * class CPUReading
 * 
 * DTO for CPU Scribblet Readings
 */
@Entity
@Table(name = "plugin_cpu")
public class CPUReading implements Reading {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;

    @Column(name = "machine_id")
    private Integer machineId;

    private Date timestamp;
    private Integer metric_system;
    private Integer metric_user;
    private Integer metric_idle;


    public CPUReading() {}

    public CPUReading(Integer machineId, Date timestamp,
            Integer system, Integer user, Integer idle) {
        this.id = id;
        this.machineId = machineId;
        this.timestamp = timestamp;
        this.metric_system = system;
        this.metric_user = user;
        this.metric_idle = idle;
    }
    

    public Long getId() { return id; }
    public Integer getMachineId() { return machineId; }
    public Date getTimestamp() { return timestamp; }
    public Integer getSystem() { return metric_system; }
    public Integer getUser() { return metric_user; }
    public Integer getIdle() { return metric_idle; }

    public void setId(Long value) { id = value; }
    public void setMachineId(Integer value) { machineId = value; }
    public void setTimestamp(Date value) { timestamp = value; }
    public void setSystem(Integer value) { metric_system = value; }
    public void setUser(Integer value) { metric_user = value; }
    public void setIdle(Integer value) { metric_idle = value; }
}

@@ -458,26 +458,25 @@
 teger metric
-_s
+S
 ystem;%0A    p
@@ -492,26 +492,25 @@
 teger metric
-_u
+U
 ser;%0A    pri
@@ -524,26 +524,25 @@
 teger metric
-_i
+I
 dle;%0A%0A%0A    p
@@ -788,26 +788,25 @@
  this.metric
-_s
+S
 ystem = syst
@@ -824,26 +824,25 @@
  this.metric
-_u
+U
 ser = user;%0A
@@ -856,26 +856,25 @@
  this.metric
-_i
+I
 dle = idle;%0A
@@ -1055,16 +1055,22 @@
 eger get
+Metric
 System()
@@ -1081,26 +1081,25 @@
 eturn metric
-_s
+S
 ystem; %7D%0A   
@@ -1117,16 +1117,22 @@
 eger get
+Metric
 User() %7B
@@ -1145,18 +1145,17 @@
 n metric
-_u
+U
 ser; %7D%0A 
@@ -1175,16 +1175,22 @@
 eger get
+Metric
 Idle() %7B
@@ -1203,18 +1203,17 @@
 n metric
-_i
+I
 dle; %7D%0A%0A
@@ -1412,16 +1412,22 @@
 void set
+Metric
 System(I
@@ -1452,10 +1452,9 @@
 tric
-_s
+S
 yste
@@ -1485,16 +1485,22 @@
 void set
+Metric
 User(Int
@@ -1523,10 +1523,9 @@
 tric
-_u
+U
 ser 
@@ -1554,16 +1554,22 @@
 void set
+Metric
 Idle(Int
@@ -1588,18 +1588,17 @@
 %7B metric
-_i
+I
 dle = va

Update CPUReading to JavaBean format