Examples of HostAndPort


Examples of com.google.common.net.HostAndPort

      assertEquals(server.getStatus(), ServerStatus.ACTIVE);
   }

   @Test(dependsOnMethods = "testCreateAndStartServer")
   public void testConnectivity() throws Exception {
      HostAndPort vncsocket = HostAndPort.fromParts(server.getVnc().getIp(), 5900);
      Logger.getAnonymousLogger().info("awaiting vnc: " + vncsocket);
      assert socketTester.apply(vncsocket) : server;
      HostAndPort sshsocket = HostAndPort.fromParts(server.getNics().get(0).getDhcp(), 22);
      Logger.getAnonymousLogger().info("awaiting ssh: " + sshsocket);
      assert socketTester.apply(sshsocket) : server;
      doConnectViaSsh(server, getSshCredentials(server));
   }
View Full Code Here

Examples of com.google.common.net.HostAndPort

      Stopwatch watch = new Stopwatch().start();
      ExecResponse exec = client.runScriptOnNode(node.getId(), process, runAsRoot(false).wrapInInitScript(false));
      stats.backgroundProcessMilliseconds = watch.elapsed(TimeUnit.MILLISECONDS);
      watch.reset().start();
     
      HostAndPort socket = null;
      try {
         socket = openSocketFinder.findOpenSocketOnNode(node, 8080, 600, TimeUnit.SECONDS);
      } catch (NoSuchElementException e) {
         throw new NoSuchElementException(format("%s%n%s%s", e.getMessage(), exec.getOutput(), exec.getError()));
      }
View Full Code Here

Examples of com.google.common.net.HostAndPort

      Stopwatch watch = new Stopwatch().start();
      ExecResponse exec = client.runScriptOnNode(node.getId(), process, runAsRoot(false).wrapInInitScript(false));
      stats.backgroundProcessMilliseconds = watch.elapsed(TimeUnit.MILLISECONDS);
      watch.reset().start();
     
      HostAndPort socket = null;
      try {
         socket = openSocketFinder.findOpenSocketOnNode(node, 8080, 600, TimeUnit.SECONDS);
      } catch (NoSuchElementException e) {
         throw new NoSuchElementException(format("%s%n%s%s", e.getMessage(), exec.getOutput(), exec.getError()));
      }
View Full Code Here

Examples of com.google.common.net.HostAndPort

    assertEquals(Optional.<HostAndPort>absent(), leaderRedirector.getRedirect());
  }

  @Test
  public void testNotLeader() {
    HostAndPort remote = HostAndPort.fromParts("foobar", HTTP_PORT);
    publishSchedulers(remote);

    assertEquals(Optional.of(remote), leaderRedirector.getRedirect());
  }
View Full Code Here

Examples of com.google.common.net.HostAndPort

    assertEquals(Optional.of(remote), leaderRedirector.getRedirect());
  }

  @Test
  public void testLeaderOnSameHost() {
    HostAndPort local = localPort(555);
    publishSchedulers(local);

    assertEquals(Optional.of(local), leaderRedirector.getRedirect());
  }
View Full Code Here

Examples of com.google_voltpatches.common.net.HostAndPort

        attemptConnect(host, username, password);

        SSHTools ssh = new SSHTools(username, null);
        SFTPSession sftp = null;

        HostAndPort hostAndPort = HostAndPort.fromString(host);
        if (hostAndPort.hasPort()) {
            sftp = ssh.getSftpSession(username, password, null, hostAndPort.getHostText(), hostAndPort.getPort(), null);
        }
        else {
            sftp = ssh.getSftpSession(username, password, null, host, null);
        }
View Full Code Here

Examples of com.sun.enterprise.admin.util.HostAndPort

    public static void setHostAndPort(DeploymentRequest req)
            throws ServerInstanceException, ConfigException {

        String virtualServers = (String) req.getOptionalAttributes().get(ServerTags.VIRTUAL_SERVERS);
        if (virtualServers==null) {
            HostAndPort hap = getHostAndPort(false);
            if(hap != null) {
                req.setHttpHostName(getHostName(hap));
                req.setHttpPort(getPort(hap, false));
            }
            hap = getHostAndPort(true);
            if(hap != null) {
                req.setHttpsHostName(getHostName(hap));
                req.setHttpsPort(getPort(hap, true));
            }
        } else {
            StringTokenizer st = new StringTokenizer(virtualServers,",");
            if (st.hasMoreTokens()) {
                String aVirtualServer = st.nextToken();
                HostAndPort hap = getVirtualServerHostAndPort(aVirtualServer, false);
                if(hap != null) {
                    req.setHttpHostName(getHostName(hap));

                    req.setHttpPort(getPort(hap, false));
                }
View Full Code Here

Examples of com.sun.enterprise.util.HostAndPort

        if (getServerDirs().getLocalPassword() == null)
            return instanceNotRunning();

        String serverName = getServerDirs().getServerName();
        HostAndPort addr = getAdminAddress(serverName);
        programOpts.setHostAndPort(addr);

        logger.finer("StopInstance.stoppingMessage" + addr.getPort());

        if (!isRunning())
            return instanceNotRunning();

        logger.finer("It's the correct Instance");
View Full Code Here

Examples of org.factor45.malabarista.util.HostAndPort

        // public static methods --------------------------------------------------------------------------------------

        public static CommandLineOptions parseCommandLineOptions(String[] args) {
            CommandLineOptions options = new CommandLineOptions();
            HostAndPort address;

            for (String arg : args) {
                if (arg.length() < 3) {
                    System.err.println("Invalid argument ignored: " + arg);
                    continue;
View Full Code Here

Examples of org.jmxtrans.embedded.util.net.HostAndPort

     */
    @Override
    public void start() {
        int port = getIntSetting(SETTING_PORT, DEFAULT_GRAPHITE_SERVER_PORT);
        String host = getStringSetting(SETTING_HOST);
        graphiteServerHostAndPort = new HostAndPort(host, port);

        logger.info("Start Graphite writer connected to '{}'...", graphiteServerHostAndPort);

        metricPathPrefix = getStringSetting(SETTING_NAME_PREFIX, DEFAULT_NAME_PREFIX);
        metricPathPrefix = getStrategy().resolveExpression(metricPathPrefix);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.