Package org.cloudfoundry.client.lib.domain

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


    getRestTemplate().put(getUrl("/v2/apps/{guid}"), appRequest, appId);
  }

  @Override
  public void updateApplicationServices(String appName, List<String> services) {
    CloudApplication app = getApplication(appName);
    List<UUID> addServices = new ArrayList<UUID>();
    List<UUID> deleteServices = new ArrayList<UUID>();
    // services to add
    for (String serviceName : services) {
      if (!app.getServices().contains(serviceName)) {
        CloudService cloudService = getService(serviceName);
        if (cloudService != null) {
          addServices.add(cloudService.getMeta().getGuid());
        }
        else {
          throw new CloudFoundryException(HttpStatus.NOT_FOUND, "Service with name " + serviceName +
              " not found in current space " + sessionSpace.getName());
        }
      }
    }
    // services to delete
    for (String serviceName : app.getServices()) {
      if (!services.contains(serviceName)) {
        CloudService cloudService = getService(serviceName);
        if (cloudService != null) {
          deleteServices.add(cloudService.getMeta().getGuid());
        }
      }
    }
    for (UUID serviceId : addServices) {
      doBindService(app.getMeta().getGuid(), serviceId);
    }
    for (UUID serviceId : deleteServices) {
      doUnbindService(app.getMeta().getGuid(), serviceId);
    }
  }
View Full Code Here


    getRestTemplate().put(getUrl("/v2/apps/{guid}"), appRequest, appId);
  }

  @Override
  public void updateApplicationUris(String appName, List<String> uris) {
    CloudApplication app = getApplication(appName);
    List<String> newUris = new ArrayList<String>(uris);
    newUris.removeAll(app.getUris());
    List<String> removeUris = app.getUris();
    removeUris.removeAll(uris);
    removeUris(removeUris, app.getMeta().getGuid());
    addUris(newUris, app.getMeta().getGuid());
  }
View Full Code Here

    doUnbindService(appId, cloudService.getMeta().getGuid());
  }

  @Override
  public InstancesInfo getApplicationInstances(String appName) {
    CloudApplication app = getApplication(appName);
    return getApplicationInstances(app);
  }
View Full Code Here

      Assert.fail();
    }

    Assert.assertNotNull(expectedTableAsString);

    final CloudApplication app1 = new CloudApplication("first", "command",
             "buildpack", 512, 1, uris, services, AppState.STARTED);
    final CloudApplication app2 = new CloudApplication("second", "command",
             "buildpack", 1024, 2, uris, services, AppState.STOPPED);

    final List<CloudApplication> applications = Arrays.asList(app1, app2);

    final String renderedTableAsString = UiUtils.renderCloudApplicationsDataAsTable(applications);
View Full Code Here

TOP

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

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.