Package org.cloudfoundry.caldecott.client

Examples of org.cloudfoundry.caldecott.client.TunnelServer


              ", but failed to create tunnel server for ports between: " + new Integer(BASE_PORT)
              + " and " + new Integer(MAX_PORT)); //$NON-NLS-1$ //$NON-NLS-2$
          return null;
        }

        TunnelServer tunnelServer = tunnelServers.get(0);

        progress.setTaskName("Starting tunnel server"); //$NON-NLS-1$
        tunnelServer.start();

        CaldecottTunnelDescriptor descriptor = new CaldecottTunnelDescriptor(serviceUserName, servicePassword,
            name, serviceName, dataBase, tunnelServer, localPort);

        CloudFoundryPlugin.getCaldecottTunnelCache().addDescriptor(cloudServer, descriptor);
View Full Code Here


  protected int getTunnelServer(TunnelFactory tunnelFactory, List<TunnelServer> tunnelServers) throws CoreException {

    RuntimeException se = null;

    int port = -1;
    TunnelServer tunnelServer = null;
    for (int i = BASE_PORT; i <= MAX_PORT; i++) {

      try {
        InetSocketAddress local = new InetSocketAddress(LOCAL_HOST, i);
        tunnelServer = new TunnelServer(local, tunnelFactory, getTunnelServerThreadExecutor());
        tunnelServers.add(tunnelServer);
        port = i;
        break;
      }
      catch (TunnelException e) {
View Full Code Here

    String svc_passwd = info.get("password");
    String svc_dbname = info.get("db") != null ? info.get("db") : info.get("name");
    String txt_dbname = info.get("db") != null ? "db" : "name";
    String svc_vhost = info.get("vhost");

    TunnelServer server = new TunnelServer(local, new HttpTunnelFactory(url, host, port, auth));

    server.start();

    System.out.println("Tunnel is running on " + LOCAL_HOST +" port " + LOCAL_PORT + " with auth=" + auth);
    if (svc_vhost != null) {
      System.out.println("Connect client with username=" + svc_username +" password=" + svc_passwd + " " + "vhost=" + svc_vhost);
    }
    else {
      System.out.println("Connect client with username=" + svc_username +" password=" + svc_passwd + " " + txt_dbname + "=" + svc_dbname);
    }
    while (true) {
      if (console != null) {
        String command = console.readLine("Enter exit to stop: ");
        if (command.toLowerCase().equals("exit")) {
          break;
        }
      }
      try {
        Thread.sleep(1000L);
      } catch (InterruptedException e) {}
    }
    server.stop();

    finalize(client);
    System.out.println("DONE!");
  }
View Full Code Here

TOP

Related Classes of org.cloudfoundry.caldecott.client.TunnelServer

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.