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

📄 defaulttunnel.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.tunnels;

import java.util.Calendar;

import com.sslexplorer.boot.HostService;
import com.sslexplorer.policyframework.AbstractResource;
import com.sslexplorer.policyframework.PolicyConstants;

public class DefaultTunnel extends AbstractResource implements Tunnel {

    int type;
    String username;
    boolean autoStart;
    String transport;
    int sourcePort;
    HostService destination;
    boolean allowExternalHosts;

    /**
     * @param id tunnel id
     * @param type type
     * @param autoStart automatically start tunnel upon login
     * @param transport transport
     * @param username username
     * @param sourcePort source port
     * @param destinationPort destination port
     * @param destinationHost destination host
     * @param allowExternHosts allow external hosts
     * @param parentResourcePermission parent resource permission
     * @param dateCreated date created
     * @param dateAmended date amended
     */
    public DefaultTunnel(String name, String description, int id, int type, boolean autoStart, String transport, String username, int sourcePort,
                         HostService destination, boolean allowExternalHosts,
                         int parentResourcePermission, Calendar dateCreated, Calendar dateAmended) {
        super(PolicyConstants.SSL_TUNNEL_RESOURCE_TYPE, id, name, description, parentResourcePermission, dateCreated, dateAmended);
        this.type = type;
        this.autoStart = autoStart;
        this.transport = transport;
        this.username = username;
        this.allowExternalHosts = allowExternalHosts;
        this.sourcePort = sourcePort;
        this.destination = destination;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#getType()
     */
    public int getType() {
        return type;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#isAutoStart()
     */
    public boolean isAutoStart() {
        return autoStart;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#getTransport()
     */
    public String getTransport() {
        return transport;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#getUsername()
     */
    public String getUsername() {
        return username;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#getSourcePort()
     */
    public int getSourcePort() {
        return sourcePort;
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.sslexplorer.forwarding.Tunnel#getDestinationHost()
     */
    public HostService getDestination() {
        return destination;
    }

    /**
     * @param allowExternalHosts The allowExternalHosts to set.
     */
    public void setAllowExternalHosts(boolean allowExternalHosts) {
        this.allowExternalHosts = allowExternalHosts;
    }

    /**
     * @param autoStart The autoStart to set.
     */
    public void setAutoStart(boolean autoStart) {
        this.autoStart = autoStart;
    }

    /**
     * @param destinationHost The destinationHost to set.
     */
    public void setDestination(HostService destination) {
        this.destination = destination;
    }

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

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

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

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

    public boolean isAllowExternalHosts() {
        return allowExternalHosts;
    }
}

⌨️ 快捷键说明

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