Package org.cloudfoundry.client.lib.domain

Examples of org.cloudfoundry.client.lib.domain.InstancesInfo


          protected boolean internalRunInWait(IProgressMonitor monitor) {
            List<DebugConnectionDescriptor> descriptors = null;
            try {

              InstancesInfo instancesInfo = cloudFoundryServer.getBehaviour().getInstancesInfo(
                  appModule.getDeployedApplicationName(), monitor);

              if (instancesInfo != null) {
                List<InstanceInfo> infos = instancesInfo.getInstances();
                if (infos != null) {
                  // make sure list of descriptors is same
                  // size as
                  // the
                  // number of instance infos, as the
View Full Code Here


    if (application == null) {
      throw CloudErrorUtil.toCoreException(Messages.ERROR_NO_CLOUD_APPLICATION_FOUND);
    }

    InstancesInfo info = internalUpdateInstancesInfo(appModule, monitor);
    ApplicationStats stats = internalUpdateStats(appModule, monitor);
    return info != null && stats != null;
  }
View Full Code Here

    return stats;
  }

  protected InstancesInfo internalUpdateInstancesInfo(CloudFoundryApplicationModule appModule,
      IProgressMonitor monitor) throws CoreException {
    InstancesInfo info = getInstancesInfo(appModule.getDeployedApplicationName(), monitor);
    appModule.setInstancesInfo(info);

    return info;
  }
View Full Code Here

    List<String> currentURIs = null;
    if (cloudApplication != null) {
      currentURIs = cloudApplication.getUris();

      ApplicationStats applicationStats = appModule.getApplicationStats();
      InstancesInfo instancesInfo = appModule.getInstancesInfo();
      if (applicationStats != null) {
        List<InstanceStats> statss = applicationStats.getRecords();
        List<InstanceInfo> infos = instancesInfo != null ? instancesInfo.getInstances() : null;
        InstanceStatsAndInfo[] statsAndInfos = new InstanceStatsAndInfo[statss.size()];

        for (int i = 0; i < statss.size(); i++) {
          InstanceStats stats = statss.get(i);
          InstanceInfo info = null;
View Full Code Here

    boolean passSingleMultipleInstances = getInstanceInfosWithTimeout(appName, 3, true);
    assertTrue("Couldn't get the right application state in 50 tries", passSingleMultipleInstances);

    connectedClient.stopApplication(appName);
    InstancesInfo instInfo = connectedClient.getApplicationInstances(appName);
    assertNull(instInfo);
  }
View Full Code Here

    connectedClient.deleteServiceBroker("haash-broker");
  }

  private boolean ensureApplicationRunning(String appName) {
    InstancesInfo instances;
    boolean pass = false;
    for (int i = 0; i < 50; i++) {
      try {
        instances = getInstancesWithTimeout(connectedClient, appName);
        assertNotNull(instances);

        List<InstanceInfo> infos = instances.getInstances();
        assertEquals(1, infos.size());

        int passCount = 0;
        for (InstanceInfo info : infos) {
          if (InstanceState.RUNNING.equals(info.getState())) {
View Full Code Here

      connectedClient.updateApplicationInstances(appName, count);
      CloudApplication app = connectedClient.getApplication(appName);
      assertEquals(count, app.getInstances());
    }

    InstancesInfo instances;
    boolean pass = false;
    for (int i = 0; i < 50; i++) {
      try {
        instances = getInstancesWithTimeout(connectedClient, appName);
        assertNotNull(instances);

        List<InstanceInfo> infos = instances.getInstances();
        assertEquals(count, infos.size());

        int passCount = 0;
        for (InstanceInfo info : infos) {
          if (shouldBeRunning) {
View Full Code Here

        Thread.sleep(2000);
      } catch (InterruptedException e1) {
        // ignore
      }

      final InstancesInfo applicationInstances = client.getApplicationInstances(appName);
      if (applicationInstances != null) {
        return applicationInstances;
      }

      if (System.currentTimeMillis() - start > STARTUP_TIMEOUT) {
View Full Code Here

      }
    }
  }

  private List<InstanceInfo> getApplicationInstances(CloudApplication app) {
    InstancesInfo instancesInfo = client.getApplicationInstances(app);
    if (instancesInfo != null) {
      return instancesInfo.getInstances();
    }
    return null;
  }
View Full Code Here

        }
        Map<String, Object> instanceMap = (Map<String, Object>) respMap.get(instanceId);
        instanceMap.put("index", index);
        instanceList.add(instanceMap);
      }
      return new InstancesInfo(instanceList);
    } catch (CloudFoundryException e) {
      if (e.getStatusCode().equals(HttpStatus.BAD_REQUEST)) {
        return null;
      } else {
        throw e;
View Full Code Here

TOP

Related Classes of org.cloudfoundry.client.lib.domain.InstancesInfo

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.