Package com.adito.tunnels

Examples of com.adito.tunnels.TunnelException


                            + (tunnel.getSourceInterface() == null || tunnel.getSourceInterface().equals("") ? "" : tunnel
                                            .getSourceInterface());
            remoteTunnel = tunnels.get(tunnelId);
            if (remoteTunnel != null) {
                if (remoteTunnel.getAgent() == agent) {
                    throw new TunnelException(TunnelException.REMOTE_TUNNEL_IN_USE, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
                }
                throw new TunnelException(TunnelException.REMOTE_TUNNEL_LOCKED, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
            }
            try {
                remoteTunnel = new RemoteTunnel(tunnel, agent, this, launchSession);
                agent.addListener(new RemoteTunnelListener(remoteTunnel));
                if (log.isInfoEnabled())
                    log.info("Adding remote tunnel with id of " + tunnelId);
                List<RemoteTunnel> sessionTunnels = tunnelsBySession.get(agent.getSession().getId());
                if (sessionTunnels == null) {
                    sessionTunnels = new ArrayList<RemoteTunnel>();
                    tunnelsBySession.put(agent.getSession().getId(), sessionTunnels);
                }
                sessionTunnels.add(remoteTunnel);
                tunnels.put(tunnelId, remoteTunnel);
            } catch (IOException e) {
                log.error("Failed to create new remote tunnel.", e);
                throw new TunnelException(TunnelException.PORT_ALREADY_IN_USE, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
            }
        }
        return remoteTunnel;
    }
View Full Code Here

TOP

Related Classes of com.adito.tunnels.TunnelException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.