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

📄 activesession.java

📁 这是linux下ssl vpn的实现程序
💻 JAVA
字号:
/*
 *  SSL-Explorer
 *
 *  Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
 *
 *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
			
package com.sslexplorer.setup;

import java.text.DateFormat;
import java.util.List;

import com.sslexplorer.security.SessionInfo;
import com.sslexplorer.table.TableItem;

/**
 * Wrapper bean for display an item an the list of sessions on the status 
 * page.
 * 
 * @author Brett Smith <a href="mailto:brett@3sp.com">&lt;brett@3sp.com&gt;</a>
 * @version $Revision: 1.3 $
 */

public class ActiveSession implements TableItem {

    final static DateFormat dateFormat = DateFormat.getDateTimeInstance();
    
    // Private instance variables

	private List vpnSessions;
	private SessionInfo info;

    /**
     * Constructor
     * 
     * @param info session
     * @param vpnSessions list of VPN client session the web session is attached to
     */
	public ActiveSession(SessionInfo info, List vpnSessions) {
		super();
		this.info = info;
		this.vpnSessions = vpnSessions;
	}

    /**
     * Get all of the VPN client sessions this web session is attached to
     * 
     * @return list of VPN sessions
     */
	public List getVpnSessions() {
		return vpnSessions;
	}

    /**
     * Get the {@link SessionInfo} this object wraps.
     * 
     * @return session
     */
	public SessionInfo getInfo() {
		return info;
	}

    /**
     * Get the time the session logged on as plain text in the current
     * locales format.
     * 
     * @return logon time as text
     */
	public String getLogonTimeText() {
		return dateFormat.format(getInfo().getLogonTime().getTime());
	}

    /* (non-Javadoc)
     * @see com.sslexplorer.table.TableItem#getColumnValue(int)
     */
    public Object getColumnValue(int col) {
        switch(col) {
            case 0:
                return getInfo().getUser().getPrincipalName();
            case 1:
                return new Integer(getInfo().getType());
            case 2:
                return getInfo().getAddress();
            default:
                return getInfo().getLogonTime();            
        }
    }
}

⌨️ 快捷键说明

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