⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trapvo.java

📁 this is example use EJB with jboss.
💻 JAVA
字号:
/*
 * Copyright(C) 2008, NTT AT Co., Ltd.
 * Project: AWGView
 *
 * Notes:
 *  N/A
 *
 * Record of change:
 * Date         Version      Name       Content
 * 2008/12/15   1.0          TriNT      First create       
 */
package jp.co.ntt.awgview.server.vo;

import java.io.Serializable;

/**
 * Class name : TrapVO <BR>
 * 
 * Package : jp.co.ntt_at.awgview.server.common <BR>
 * 
 * Description : Store information about an Alarm data.<BR>
 * 
 * @author : AI&T
 * @version : 1.0
 */
public class TrapVO implements Serializable {
	private static final long serialVersionUID = 7526471155622776147L;

	// Define fields of database table
	public static final String TRAP_TBL     = "traphistory_tbl";
	public static final String TRAP_VTBL    = "traphistory_view_tbl";
	public static final String TRAP_ID      = "traphistory_id";
	public static final String TRAP_SLOTNUM = "traphistory_slotnum";
	public static final String TRAP_TYPE    = "traphistory_type";
	public static final String TRAP_LEVEL   = "traphistory_level";
	public static final String TRAP_TIME    = "traphistory_time";
	public static final String MAIN_STATUS  = "main_status";
	public static final String IMPL_STATUS  = "implement_status";
	public static final String TRAP_OID     = "trap_oid";

	private static long countTrap = Long.MIN_VALUE;
	/** Trap ID */
	private long trapID = -1;
	/** Node name */
	private String nodeName = "Unknown";
	/** Function block name */
	private String blockName = "Unknown";
	/** Function block IP */
	private String blockIP = "Unknown";
	/** Package name */
	private String packageTypeName = "Unknown";
	/** Trap slot number */
	private int trapSlotNumber = -1;
	/** Trap type */
	private String trapType = "Unknown"; // Trap type
	/** Trap level */
	private String trapLevel = "Unknown";
	/** Trap time */
	private long trapTime = -1;
	/** OID of Trap */
	private String strapOID = "";
	/** Screen ID */
	private int screenID = 0; // 0: Diagram Sreen, Package Implement //1:Diagram
								// Sreen //2:Package Implement
	/** Status of Trap is on or off */
	private boolean turnOff = false; // False: Trap is on. // True: Trap is off.

	/** Trap status on main view */
	private int stMainView  = 1; // 1 for on state
	/**Trap status on package implement view */
	private int stImplView  = 1;
	/**
	 * Empty constructor
	 */
	public TrapVO() {
		countTrap++;
		trapID = countTrap;
	}
	/**
	 * Copy constructor
	 * @param tvo
	 * 			TrapVO object
	 */
	public TrapVO(final TrapVO tvo) {
		countTrap++;
		trapID = countTrap;
		clone(tvo);
	}
	
	/**
	 * Creates a clone of a TrapVO object. A new instance is allocated 
	 * and copy the contents of this Object into the clone
	 * @param tvo
	 *       TrapVO object
	 */
	public void clone(final TrapVO tvo){
		this.blockIP    = tvo.getBlockIP();
		this.blockName  = tvo.getBlockName();
		this.nodeName   = tvo.getNodeName();
		this.screenID   = tvo.getScreenID();
		this.stImplView = tvo.getTrapStatusOnImplView();
		this.stMainView = tvo.getTrapStatusOnMainView();
		this.strapOID   = tvo.getTrapOID();
		this.trapID     = tvo.getID();
		this.trapLevel  = tvo.getTrapLevel();
		this.trapTime   = tvo.getTime();
		this.trapType   = tvo.getTrapType();
		this.turnOff    = tvo.turnOff();
		this.trapSlotNumber  = tvo.getSlotNumber();
		this.packageTypeName = tvo.getPackageTypeName();
	}

	/***
	 * Sets the Trap ID
	 * 
	 * @param trapID
	 */
	public void setID(long trapID) {
		this.trapID = trapID;
	}

	/***
	 * Returns the Trap ID
	 * 
	 * @return trapID
	 */
	public long getID() {
		return this.trapID;
	}

	/***
	 * Sets the Node name
	 * 
	 * @param nodeName
	 */
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	/***
	 * Returns the node name
	 * 
	 * @return nodeName
	 */
	public String getNodeName() {
		return this.nodeName;
	}

	/***
	 * Sets the Function block name
	 * 
	 * @param blockName
	 */
	public void setBlockName(String blockName) {
		this.blockName = blockName;
	}

	/***
	 * Returns the Function block name
	 * 
	 * @return blockName
	 */
	public String getBlockName() {
		return this.blockName;
	}

	/***
	 * Sets the Function block IP Address
	 * 
	 * @param blockIP
	 */
	public void setBlockIP(String blockIP) {
		this.blockIP = blockIP;
	}

	/***
	 * Returns the Function block IP Address
	 * 
	 * @return blockIP
	 */
	public String getBlockIP() {
		return this.blockIP;
	}

	/***
	 * Sets the Package type name
	 * 
	 * @param packageTypeName
	 */
	public void setPackageTypeName(String packageTypeName) {
		this.packageTypeName = packageTypeName;
	}

	/***
	 * Returns the Package type name
	 * 
	 * @return packageTypeName
	 */
	public String getPackageTypeName() {
		return this.packageTypeName;
	}

	/***
	 * Sets the slot number
	 * 
	 * @param slotNumber
	 */
	public void setSlotNumber(int slotNumber) {
		this.trapSlotNumber = slotNumber;
	}

	/***
	 * Returns slot number
	 * 
	 * @return trapSlotNumber
	 */
	public int getSlotNumber() {
		return this.trapSlotNumber;
	}

	/***
	 * Sets the Trap type
	 * 
	 * @param trapType
	 */
	public void setTrapType(String trapType) {
		this.trapType = trapType;
	}

	/***
	 * Returns the Trap type
	 * 
	 * @return trapType
	 */
	public String getTrapType() {
		return this.trapType;
	}

	/***
	 * Sets the Trap level
	 * 
	 * @param trapLevel
	 */
	public void setTrapLevel(String trapLevel) {
		this.trapLevel = trapLevel;
	}

	/***
	 * Returns the Trap level
	 * 
	 * @return trapLevel
	 */
	public String getTrapLevel() {
		return this.trapLevel;
	}

	/***
	 * Sets the OID
	 * 
	 * @param trapOID
	 */
	public void setOID(String trapOID) {
		this.strapOID = trapOID;
	}

	/***
	 * Returns the OID
	 * 
	 * @return strapOID
	 */
	public String getTrapOID() {
		return this.strapOID;
	}

	/***
	 * Sets the Trap time
	 * 
	 * @param trapTime
	 */
	public void setTime(long trapTime) {
		this.trapTime = trapTime;
	}

	/***
	 * Returns the Trap time
	 * 
	 * @return trapTime
	 */
	public long getTime() {
		return this.trapTime;
	}

	/***
	 * Sets the screen id
	 * 
	 * @param screenID
	 */
	public void setScreenID(int screenID) {
		this.screenID = screenID;
	}

	/***
	 * Returns the trap status on main view
	 * 
	 * @return trap status
	 */
	public int getTrapStatusOnMainView() {
		return this.stMainView;
	}
	
	/***
	 * Sets trap status on main view
	 * 
	 * @param status
	 * 			 pass 0 to off and 1 to on 
	 */
	public void setTrapStatusOnMainView(int status) {
		this.stMainView = status;
	}
	
	/***
	 * Returns the trap status on package implement view
	 * 
	 * @return trap status
	 */
	public int getTrapStatusOnImplView() {
		return this.stImplView;
	}
	
	/***
	 * Sets trap status on package implement view
	 * 
	 * @param status
	 * 			 pass 0 to off and 1 to on 
	 */
	public void setTrapStatusOnImplView(int status) {
		this.stImplView = status;
	}

	/***
	 * Returns the screen id
	 * 
	 * @return screenID
	 */
	public int getScreenID() {
		return this.screenID;
	}

	/***
	 * Sets the status of Trap: on/off
	 * 
	 * @param turnOff
	 */
	public void setTurnOff(boolean turnOff) {
		this.turnOff = turnOff;
	}

	/***
	 * Return the Trap status
	 * 
	 * @return turnOff
	 */
	public boolean turnOff() {
		return this.turnOff;
	}

	/***
	 * Return the TrapVO to String
	 * 
	 */
	public String toString() {
		StringBuffer buff = new StringBuffer();
		buff.append("\n\t-------------------------------------------");
		buff.append("\n\t---->strOID:		\t" + strapOID);
		buff.append("\n\t---->blockIP:		\t" + blockIP);
		buff.append("\n\t---->nodeName:		\t" + nodeName);
		buff.append("\n\t---->FuncBlockName:	\t" + blockName);
		buff.append("\n\t---->packageName:	\t" + packageTypeName);
		buff.append("\n\t---->time:		\t" + trapTime);
		buff.append("\n\t---->trapType:		\t" + trapType);
		buff.append("\n\t---->trapLevel:		\t" + trapLevel);
		buff.append("\n\t---->slotNumber:	\t" + trapSlotNumber);
		buff.append("\n\t---->turnOff:		\t" + turnOff);
		buff.append("\n\t-------------------------------------------");
		return buff.toString();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -