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

📄 uservo.java

📁 this is example use EJB with jboss.
💻 JAVA
字号:
/*
 * Copyright(C) 2008, NTT AT Co., Ltd.
 * Project: AWGStar
 *
 * 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;
import java.util.Hashtable;

/**
 * Class name : UserInfo <BR>
 * 
 * Package : jp.co.nttat.awgstar.server.user <BR>
 * 
 * Description: Store information about an user <BR>
 * 
 * 
 * @author : AI&T
 * @version : 1.0
 */

public class UserVO implements Serializable {

	private static final long serialVersionUID = 6382687042137848463L;

	/** Define fields of database table*/
	public static final String USER_TBL  = "user_tbl";
	public static final String USER_ID   = "user_id";
	public static final String USER_NAME = "user_name";
	public static final String USER_TYPE = "user_type";
	public static final String USER_PASS = "user_password";
	/*User permission*/
	public static final int USER_ROOT    = 0;
	public static final int USER_ADMIN   = 1;
	public static final int USER_NORMAL  = 2;

	public static int TIMEOUT = -1;// ms
	/* user id */
	private long userID = -1;
	/* user name */
	private String userName = "";
	/* user password */
	private String userPwd = "";
	/* user role */
	private int userRole = -1;
	private String strIPAddress = "";

	/* requestQueueName of operation terminal */
	private String requestQueueName = "";
	/* replyQueueName of operation terminal */
	private String replyQueueName = "";
	/*Time period to send living sign to server (default 30 seconds)*/
	private int timeToSendLivingSign = 30; 
	private int maxCurrentAlarm = 1000; // 
	/*Used to check client timeout*/
	private int countTimeAccess = 0;
	/*Virtual view table for trap history*/
	private String alarmTblView = "";
	/*Virtual view table for operation history*/
	private String operationTblView = "";
	/* Hashtable object contains the permission of user corresponding 
	 * to each menu action
	 */
	private Hashtable<String, Integer> htbPermission;
	
	/**
	 * Constructot default
	 */
	public UserVO() {
	}

	/***
	 * Constructor with all user information
	 * 
	 * @param strName
	 * @param strPwd
	 * @param intRole
	 * @param strIPAddress
	 */
	public UserVO(String strName, String strPwd, int intRole,
			String strIPAddress) {
		this.userName = strName;// .toLowerCase();
		this.userPwd = strPwd;// .toLowerCase(); //
								// Base64.encodeString(strPwd.toLowerCase());
		this.userRole = intRole;
		this.strIPAddress = strIPAddress;
	}

	/**
	 * @return Returns the user id.
	 */
	public long getID() {
		return this.userID;
	}

	/**
	 * @param countTimeAccess
	 *            The countTimeAccess to set.
	 */
	public void setCountTimeAccess(int countTimeAccess) {
		this.countTimeAccess = countTimeAccess;
	}

	/**
	 * @return Returns the user id.
	 */
	public int getCountTimeAccess() {
		return this.countTimeAccess;
	}

	/**
	 * @param userID
	 *            The userID to set.
	 */
	public void setID(long userID) {
		this.userID = userID;
	}

	/**
	 * @return Returns the dtTimeAccess.
	 */
	public int getTimeSendLivingSign() {
		return this.timeToSendLivingSign;
	}

	/**
	 * @param dtTimeAccess
	 *            The dtTimeAccess to set.
	 */
	public void setTimeSendLivingSign(int dtTimeAccess) {
		this.timeToSendLivingSign = dtTimeAccess;
	}

	public int getMaxCurrentAlarm() {
		return this.maxCurrentAlarm;
	}

	public void setMaxCurrentAlarm(int value) {
		this.maxCurrentAlarm = value;
	}

	/**
	 * @return Returns the strRole.
	 */
	public int getRole() {
		return this.userRole;
	}

	/**
	 * @param userRole
	 *            The userRole to set.
	 */
	public void setRole(int userRole) {
		this.userRole = userRole;
	}

	/**
	 * @return Returns the strIPAddress.
	 */
	public String getIPAddress() {
		return strIPAddress;
	}

	/**
	 * @param strIPAddress
	 *            The strIPAddress to set.
	 */
	public void setIPAddress(String strIPAddress) {
		this.strIPAddress = strIPAddress;
	}

	/**
	 * @param userName
	 *            The strName to set.
	 */
	public void setName(String userName) {
		this.userName = userName;
	}

	/**
	 * @return Returns the strName.
	 */
	public String getName() {
		return userName;
	}

	/**
	 * @return Returns the strPwd.
	 */
	public String getPassword() {
		return userPwd;
	}

	/**
	 * @param strPwd
	 *            The strPwd to set.
	 */
	public void setPassword(String strPwd) {
		if (strPwd == null) {
			strPwd = "";
		}
		this.userPwd = strPwd;// strPwd.toLowerCase();//
								// Base64.encodeString(strPwd.toLowerCase());
	}

	/**
	 * Set Request Queue Name
	 * 
	 * @param requestQueueName
	 */
	public void setRequestQueueName(String requestQueueName) {
		this.requestQueueName = requestQueueName;
	}

	/**
	 * @return Returns the requestQueueName.
	 */
	public String getRequestQueueName() {
		return requestQueueName;
	}

	/**
	 * Set Reply Queue Name
	 * 
	 * @param replyQueueName
	 */
	public void setReplyQueueName(String replyQueueName) {
		this.replyQueueName = replyQueueName;
	}

	/**
	 * @return Returns the replyQueueName.
	 */
	public String getReplyQueueName() {
		return replyQueueName;
	}

	/**
	 * Set virtual view of trap history table
	 * 
	 * @param viewTbl
	 */
	public void setAlarmViewTbl(String viewTbl) {
		this.alarmTblView = viewTbl;
	}

	/**
	 * @return Returns the virtual view of trap history table.
	 */
	public String getAlarmViewTbl() {
		return alarmTblView;
	}
	
	/**
	 * Set virtual view of trap history table
	 * 
	 * @param viewTbl
	 */
	public void setOperationViewTbl(String viewTbl) {
		this.operationTblView = viewTbl;
	}

	/**
	 * @return Returns the virtual view of trap history table.
	 */
	public String getOperationViewTbl() {
		return operationTblView;
	}
	
	/**
	 * Set hashtable object permission of user 
	 * 
	 * @param htbPermission
	 * 					Hashtable<String, Long> object
	 */
	public void setPermissionTbl(Hashtable<String, Integer> htbPermission) {
		this.htbPermission = htbPermission;
	}

	/**
	 * @return Returns Hashtable<String, Long> object permission of user 
	 */
	public Hashtable<String, Integer> getPermissionTbl() {
		return this.htbPermission;
	}
	
	/**
	 * Return info of UserVO
	 * @return a String object contains info of UserVO 
	 */
	public String toString() {
		StringBuffer buff = new StringBuffer();
		buff.append( "name: " + getName() + ", ");
		buff.append( "Role: " + getRole());
		buff.append( ">");
		return buff.toString();
	}
}

⌨️ 快捷键说明

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