Examples of CloudApplication


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

      if (getClient().getService(service.getName()) == null) {
        throw new MojoExecutionException(String.format("Service '%s' does not exist", service.getName()));
      }

      try {
        final CloudApplication application = getClient().getApplication(getAppname());
        if (application.getServices().contains(service.getName())) {
          getLog().info(String.format("Unbinding Service '%s'", service.getName()));
          getClient().unbindService(getAppname(), service.getName());
        } else {
          getLog().info(String.format("Service '%s' is not bound to application '%s'",
              service.getName(), application.getName()));
        }
      } catch (CloudFoundryException e) {
        throw new MojoExecutionException(String.format("Application '%s' does not exist", getAppname()));
      }
View Full Code Here

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

    String serviceName = "test_database";
    createMySqlService(serviceName);

    String appName = createSpringTravelApp("bind1");

    CloudApplication app = connectedClient.getApplication(appName);
    assertNotNull(app.getServices());
    assertTrue(app.getServices().isEmpty());

    connectedClient.bindService(appName, serviceName);

    app = connectedClient.getApplication(appName);
    assertNotNull(app.getServices());
    assertEquals(1, app.getServices().size());
    assertEquals(serviceName, app.getServices().get(0));

    connectedClient.unbindService(appName, serviceName);

    app = connectedClient.getApplication(appName);
    assertNotNull(app.getServices());
    assertTrue(app.getServices().isEmpty());
  }
View Full Code Here

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

  }

  @Test
  public void appsWithRoutesAreCounted() throws IOException {
    String appName = namespacedAppName("my_route3");
    CloudApplication app = createAndUploadSimpleTestApp(appName);
    List<String> uris = app.getUris();
    uris.add("my_route3." + TEST_DOMAIN);
    connectedClient.addDomain(TEST_DOMAIN);
    connectedClient.updateApplicationUris(appName, uris);

    List<CloudRoute> routes = connectedClient.getRoutes(TEST_DOMAIN);
View Full Code Here

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

  //

  private boolean getInstanceInfosWithTimeout(String appName, int count, boolean shouldBeRunning) {
    if (count > 1) {
      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++) {
View Full Code Here

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

      try {
        final StartingInfo startingInfo = getClient().startApplication(appname);
        showStagingStatus(startingInfo);

        final CloudApplication app = getClient().getApplication(appname);
        showStartingStatus(app);
        showStartResults(app, uris);
      } catch (CloudFoundryException e) {
        throw new MojoExecutionException(String.format("Error while creating application '%s'. Error message: '%s'. Description: '%s'",
            getAppname(), e.getMessage(), e.getDescription()), e);
View Full Code Here

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

      getLog().info(String.format("Restarting application '%s'", getAppname()));

      final StartingInfo startingInfo = getClient().restartApplication(getAppname());
      showStagingStatus(startingInfo);

      final CloudApplication application = getClient().getApplication(getAppname());
      showStartingStatus(application);
      showStartResults(application, getAllUris());
    } catch (CloudFoundryException e) {
      if (HttpStatus.NOT_FOUND.equals(e.getStatusCode())) {
        throw new MojoExecutionException(String.format("Application '%s' does not exist",
View Full Code Here

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

      if (getClient().getService(service.getName()) == null) {
        throw new MojoExecutionException(String.format("Service '%s' does not exist", service.getName()));
      }

      try {
        final CloudApplication application = getClient().getApplication(getAppname());
        if (application.getServices().contains(service.getName())) {
          getLog().info(String.format("Service '%s' is already bound to application '%s'",
              service.getName(), application.getName()));
        } else {
          getClient().bindService(getAppname(), service.getName());
          getLog().info(String.format("Binding Service '%s'", service.getName()));
        }
      }
View Full Code Here

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

public class App extends AbstractApplicationAwareCloudFoundryMojo {

  @Override
  protected void doExecute() {
    try {
      final CloudApplication application = getClient().getApplication(getAppname());
      final ApplicationStats stats = getClient().getApplicationStats(getAppname());
      getLog().info("\n" + UiUtils.renderCloudApplicationDataAsTable(application, stats));
    } catch (CloudFoundryException e) {
      getLog().info(String.format("Application '%s' doesn't exist", getAppname()));
    }
View Full Code Here

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

    deleteCaldecottServerApp();
    finalize(this.client);
  }

  private void deleteCaldecottServerApp() {
    CloudApplication app =  null;
    try {
      app = client.getApplication(TunnelHelper.getTunnelAppName());
    } catch (CloudFoundryException ignore) {}
    if (app != null) {
      client.deleteApplication(TunnelHelper.getTunnelAppName());
View Full Code Here

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

      client.deleteApplication(TunnelHelper.getTunnelAppName());
    }
  }

  private void checkForCaldecottServerApp() throws Exception {
    CloudApplication app =  null;
    try {
      try {
        app = client.getApplication(TunnelHelper.getTunnelAppName());
      } catch (CloudFoundryException ignore) {}
      if (app == null) {
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.