public class MacUserInfo implements Serializable
{
/**序列化UID */
private static final long serialVersionUID = 600000053L;
/**
* 时间精确度,单位毫秒, 默认精确到分钟
*/
private static int iExactTime = PortalCommonConst.NUM_60 * PortalCommonConst.NUM_1000;
/**
* 用户名
*/
private String userName = null;
/**
* 用户授权时间,以int类型存储
*/
private int authTime = 0;
/**
*
* 构造函数。
*
*/
public MacUserInfo()
{
//构造的时候直接生成认证时间,精确到分钟,不对外提供接口设置,避免出错
authTime = (int)(System.currentTimeMillis() / iExactTime);
}
/**
*
* 获取用户名
*
* @return 用户名
*/
public String getUserName()
{
return userName;
}
/**
*
* 设置 用户名
*
* @param userName 用户名
*/
public void setUserName(String userName)
{
this.userName = userName;
}
/**
*
* 获取用户 MAC自动认证授权时间
*
* @return 用户 MAC自动认证授权时间
*/
public int getAuthTime()
{
return authTime;
}
/**
*
* 设置用户 MAC自动认证授权时间
*
* @param authTime 用户 MAC自动认证授权时间
*/
public void setAuthTime(int authTime)
{
this.authTime = authTime;
}
/**
*
* 判断用户注册的MAC信息是否超时老化。
*
* @return true 超时老化; false 未老化;
*/
public boolean isOverTime()
{
return ((System.currentTimeMillis() / iExactTime) - this.authTime) > SystemConfig.getMacOutTime();
}
}
{
/**序列化UID */
private static final long serialVersionUID = 600000053L;
/**
* 时间精确度,单位毫秒, 默认精确到分钟
*/
private static int iExactTime = PortalCommonConst.NUM_60 * PortalCommonConst.NUM_1000;
/**
* 用户名
*/
private String userName = null;
/**
* 用户授权时间,以int类型存储
*/
private int authTime = 0;
/**
*
* 构造函数。
*
*/
public MacUserInfo()
{
//构造的时候直接生成认证时间,精确到分钟,不对外提供接口设置,避免出错
authTime = (int)(System.currentTimeMillis() / iExactTime);
}
/**
*
* 获取用户名
*
* @return 用户名
*/
public String getUserName()
{
return userName;
}
/**
*
* 设置 用户名
*
* @param userName 用户名
*/
public void setUserName(String userName)
{
this.userName = userName;
}
/**
*
* 获取用户 MAC自动认证授权时间
*
* @return 用户 MAC自动认证授权时间
*/
public int getAuthTime()
{
return authTime;
}
/**
*
* 设置用户 MAC自动认证授权时间
*
* @param authTime 用户 MAC自动认证授权时间
*/
public void setAuthTime(int authTime)
{
this.authTime = authTime;
}
/**
*
* 判断用户注册的MAC信息是否超时老化。
*
* @return true 超时老化; false 未老化;
*/
public boolean isOverTime()
{
return ((System.currentTimeMillis() / iExactTime) - this.authTime) > SystemConfig.getMacOutTime();
}
}