Package com.adito.agent.client.util

Examples of com.adito.agent.client.util.TunnelConfiguration


     * @see com.adito.vpn.util.ApplicationType#getRedirectParameters()
     */
    public String getRedirectParameters() {
        StringBuffer buf = new StringBuffer();
        for (Enumeration e = launcher.getTunnels().elements(); e.hasMoreElements();) {
            TunnelConfiguration l = (TunnelConfiguration) e.nextElement();
            if (buf.length() == 0) {
                buf.append("tunnels="); //$NON-NLS-1$
            } else {
                buf.append(","); //$NON-NLS-1$
            }
            buf.append(l.getName());
            buf.append(":"); //$NON-NLS-1$
            buf.append("localhost"); //$NON-NLS-1$
            buf.append(":"); //$NON-NLS-1$
            buf.append(l.getSourcePort());
            buf.append("&"); //$NON-NLS-1$
        }
        buf.append("adito="); //$NON-NLS-1$
        buf.append(URLEncoder.encode(launcher.getApplicationStoreProtocol() + "://" //$NON-NLS-1$
            + launcher.getApplicationStoreHost()
View Full Code Here


         * no active connections when starting or remove it when
         * stopping
         */
        PortMonitor portMonitor = agent.getGUI().getPortMonitor();
        if(request.getRequestName().equals(START_REMOTE_TUNNEL)) {
          TunnelConfiguration conf = new DefaultTunnel(
              resourceId, TunnelConfiguration.REMOTE_TUNNEL, TunnelConfiguration.TCP_TUNNEL, listeningInterface, listeningPort, destinationPort, destinationHost, true, false, resourceName, launchId);
          RemotePortItem portItem = new RemotePortItem(conf);
          portMonitor.addPortItem(portItem);
        }
        else {
View Full Code Here

      int idx = agent.getGUI().getPortMonitor().getIndexForId(localForwardingServer.getId());
      if (idx != -1) {
        agent.getGUI().getPortMonitor().removeItemAt(idx);
      }
    }
    TunnelConfiguration listeningSocketConfiguration = localForwardingServer.getTunnel();
    if (agent.getConfiguration().isDisplayInformationPopups()) {
      agent.getGUI()
              .popup(null,
                MessageFormat.format(Messages.getString("TunnelManager.closingLocalTunnel"), new Object[] { listeningSocketConfiguration.getName(),//$NON-NLS-1$ 
                    String.valueOf(listeningSocketConfiguration.getSourcePort()),
                    listeningSocketConfiguration.getDestinationHost() + ":" + listeningSocketConfiguration.getDestinationPort() }), //$NON-NLS-1$
                Messages.getString("Agent.title"), //$NON-NLS-1$
                "popup-tunnel", -1); //$NON-NLS-1$
    }
    agent.updateInformation();
  }
View Full Code Here

        int port = Integer.parseInt((String) e.getAttribute("port")); //$NON-NLS-1$
        boolean usePreferredPort = ("true".equals(e.getAttribute("usePreferredPort"))); //$NON-NLS-1$ //$NON-NLS-2$
        boolean singleConnection = !("false".equals(e.getAttribute("singleConnection"))); //$NON-NLS-1$ //$NON-NLS-2$
        boolean localhostWorkaround = "true".equals(e.getAttribute("localhostWorkaround")); //$NON-NLS-1$ //$NON-NLS-2$
        if (events != null) {
            TunnelConfiguration listeningSocketConfiguration = events.createTunnel(name,
                hostname,
                port,
                usePreferredPort,
                singleConnection,
                localhostWorkaround ? "127.0.0.2" : agent.getConfiguration().getLocalhostAddress());
View Full Code Here

     * @see com.adito.agent.client.util.AbstractApplicationLauncher#replaceTokens(java.lang.String)
     */
    public String replaceTokens(String str) {
      str = super.replaceTokens(str);
        for (Enumeration e = tunnels.elements(); e.hasMoreElements();) {
            TunnelConfiguration listeningSocketConfiguration = (TunnelConfiguration) e.nextElement();
            String paramHost = "${tunnel:" + listeningSocketConfiguration.getName() + ".hostname}"; //$NON-NLS-1$ //$NON-NLS-2$
            String paramPort = "${tunnel:" + listeningSocketConfiguration.getName() + ".port}"; //$NON-NLS-1$ //$NON-NLS-2$

            str = replaceAllTokens(str, paramHost, listeningSocketConfiguration.getSourceInterface()); //$NON-NLS-1$
            str = replaceAllTokens(str, paramPort, String.valueOf(listeningSocketConfiguration.getSourcePort()));
        }
        return str;
    }
View Full Code Here

    Application app = launchApplication(name, descriptor, parameters);
    app.start();
    Vector tunnels = ((AgentApplicationLauncher)app.getLauncher()).getTunnels();   
    ByteArrayWriter baw = new ByteArrayWriter();
    for(Enumeration e = tunnels.elements(); e.hasMoreElements(); ) {
            TunnelConfiguration listeningSocketConfiguration = (TunnelConfiguration) e.nextElement();
            baw.writeString(listeningSocketConfiguration.getName());
            baw.writeString(listeningSocketConfiguration.getSourceInterface());
            baw.writeInt(listeningSocketConfiguration.getSourcePort());     
    }
    request.setRequestData(baw.toByteArray());
   
    return true;
  }
View Full Code Here

TOP

Related Classes of com.adito.agent.client.util.TunnelConfiguration

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.