/* 
 * Copyright (C) 2012-2015 Open Source Consulting, Inc. All rights reserved by Open Source Consulting, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * Revision History
 * Author			Date				Description
 * ---------------	----------------	------------
 * BongJin Kwon		2016. 4. 19.		First Draft.
 */
package com.athena.meerkat.controller.web.monitoring.server;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

/**
 * <pre>
 * 
 * </pre>
 * @author Bongjin Kwon
 * @version 1.0
 */
@Entity
@Table(name = "mon_fs_tbl")
@IdClass(MonFsPK.class)
public class MonFs {

	@Id
	@Column(name = "server_id")
	private int serverId;//
	
	@Id
	@Column(name = "fs_name")
	private String fsName;//
	
	@Id
	@Column(name = "mon_dt")
	private java.util.Date monDt;//
	
	
	@Column(name = "total")
	private int total;//
	@Column(name = "used")
	private int used;//
	@Column(name = "use_per")
	private Double usePer;//
	@Column(name = "avail")
	private int avail;//

	/**
	 * <pre>
	 * 
	 * </pre>
	 */
	public MonFs() {
		// TODO Auto-generated constructor stub
	}

	/**
	 * @return the serverId
	 */
	public int getServerId() {
		return serverId;
	}

	/**
	 * @param serverId the serverId to set
	 */
	public void setServerId(int serverId) {
		this.serverId = serverId;
	}

	/**
	 * @return the fsName
	 */
	public String getFsName() {
		return fsName;
	}

	/**
	 * @param fsName the fsName to set
	 */
	public void setFsName(String fsName) {
		this.fsName = fsName;
	}

	/**
	 * @return the monDt
	 */
	public java.util.Date getMonDt() {
		return monDt;
	}

	/**
	 * @param monDt the monDt to set
	 */
	public void setMonDt(java.util.Date monDt) {
		this.monDt = monDt;
	}

	/**
	 * @return the total
	 */
	public int getTotal() {
		return total;
	}

	/**
	 * @param total the total to set
	 */
	public void setTotal(int total) {
		this.total = total;
	}

	/**
	 * @return the used
	 */
	public int getUsed() {
		return used;
	}

	/**
	 * @param used the used to set
	 */
	public void setUsed(int used) {
		this.used = used;
	}

	/**
	 * @return the usePer
	 */
	public Double getUsePer() {
		return usePer;
	}

	/**
	 * @param usePer the usePer to set
	 */
	public void setUsePer(Double usePer) {
		this.usePer = usePer;
	}

	/**
	 * @return the avail
	 */
	public int getAvail() {
		return avail;
	}

	/**
	 * @param avail the avail to set
	 */
	public void setAvail(int avail) {
		this.avail = avail;
	}

}
//end of MonFs.java
@@ -1067,16 +1067,42 @@
 ver;%0D%0A%0D%0A
+import java.util.Date;%0D%0A%0D%0A
 import j
@@ -1251,21 +1251,96 @@
 istence.
-Table
+PrePersist;%0D%0Aimport javax.persistence.Table;%0D%0Aimport javax.persistence.Transient
 ;%0D%0A%0D%0A/**
@@ -1367,16 +1367,21 @@
 %3C/pre%3E%0D%0A
+ * %0D%0A
  * @auth
@@ -1564,25 +1564,24 @@
 erverId;//%0D%0A
-%09
 %0D%0A%09@Id%0D%0A%09@Co
@@ -1631,17 +1631,16 @@
 ame;//%0D%0A
-%09
 %0D%0A%09@Id%0D%0A
@@ -1700,20 +1700,16 @@
 nDt;//%0D%0A
-%09%0D%0A%09
 %0D%0A%09@Colu
@@ -2131,16 +2131,32 @@
 serverId
+%0D%0A%09 *           
  the ser
@@ -2365,16 +2365,32 @@
 m fsName
+%0D%0A%09 *           
  the fsN
@@ -2596,16 +2596,32 @@
 am monDt
+%0D%0A%09 *           
  the mon
@@ -2819,16 +2819,32 @@
 am total
+%0D%0A%09 *           
  the tot
@@ -3027,16 +3027,32 @@
 ram used
+%0D%0A%09 *           
  the use
@@ -3241,16 +3241,32 @@
 m usePer
+%0D%0A%09 *           
  the use
@@ -3461,16 +3461,32 @@
 am avail
+%0D%0A%09 *           
  the ava
@@ -3568,16 +3568,158 @@
 %0A%09%7D%0D
+%0A%09%0D%0A%09@PrePersist%0D%0A%09public void onPrePersist() %7B%0D%0A%09%09this.monDt = new Date();%0D%0A%09%7D%0D%0A%0D%0A%09public Double getAvailPer() %7B%0D%0A%09%09return 100 - usePer;%0D%0A%09%7D%0D
 %0A%0D%0A%7D%0D%0A//
 end 
@@ -3714,16 +3714,17 @@
 %0A%0D%0A%7D%0D%0A//
+ 
 end of M

add @PrePersist in MonFs class.