@Override protected Object doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { client.deleteAllApplications(); return null; } }.run(monitor);
@Override protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { client.deleteApplication(applicationName); return null; } }.run(monitor);
@Override protected CloudApplication doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { return client.getApplication(appName); } }.run(monitor);
CloudServiceInstance instance = client.getServiceInstance(service); List<CloudServiceBinding> bindings = (instance != null) ? instance.getBindings() : null; shouldDelete = bindings == null || bindings.isEmpty(); List<CloudApplication> apps = client.getApplications(); if (apps != null) { for (int i = 0; shouldDelete && i < apps.size(); i++) { client.deleteService(service); Messages.CloudFoundryServerBehaviour_ERROR_DELETE_SERVICES_BOUND, boundServs))); return client.getServices();
@Override protected List<CloudService> doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { SubMonitor serviceProgress = SubMonitor.convert(progress, services.length); for (CloudService service : services) { serviceProgress.subTask(NLS.bind(Messages.CloudFoundryServerBehaviour_CREATING_SERVICE, service.getName())); client.createService(service); serviceProgress.worked(1); } return client.getServices(); } };
@Override protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { // Look up the existing urls locally first to avoid a client // call CloudFoundryApplicationModule existingAppModule = getCloudFoundryServer().getExistingCloudModule( appName); List<String> oldUrls = existingAppModule != null && existingAppModule.getDeploymentInfo() != null ? existingAppModule .getDeploymentInfo().getUris() : null; if (oldUrls == null) { oldUrls = client.getApplication(appName).getUris(); } client.updateApplicationUris(appName, urls); if (existingAppModule != null) { ServerEventHandler.getDefault().fireServerEvent( new AppUrlChangeEvent(getCloudFoundryServer(), CloudServerEvent.EVENT_APP_URL_CHANGED, existingAppModule.getLocalModule(), Status.OK_STATUS, oldUrls, urls)); } return null; } };
String appName = appModule.getDeploymentInfo().getDeploymentName(); List<CloudApplication> existingApps = client.getApplications(); boolean found = false; for (CloudApplication existingApp : existingApps) { subMonitor.subTask(creatingAppLabel); try { client.createApplication(appName, staging, appModule.getDeploymentInfo().getMemory(), uris, services);
@Override protected ApplicationStats doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { return client.getApplicationStats(applicationId); } }.run(monitor);
@Override protected List<CloudApplication> doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { return client.getApplications(); } }.run(monitor);
@Override protected InstancesInfo doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { return client.getApplicationInstances(applicationId); } }.run(monitor);
@Override protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { for (CloudRoute route : routes) { client.deleteRoute(route.getHost(), route.getDomain().getName()); } return null; } }.run(monitor);
boolean waitForStart(CloudFoundryOperations client, String deploymentId, IProgressMonitor monitor) throws InterruptedException { long initialInterval = CloudOperationsConstants.SHORT_INTERVAL; Thread.sleep(initialInterval); long timeLeft = CloudOperationsConstants.DEPLOYMENT_TIMEOUT - initialInterval; while (timeLeft > 0) { CloudApplication deploymentDetails = client.getApplication(deploymentId); if (isApplicationReady(deploymentDetails)) { return true; } Thread.sleep(CloudOperationsConstants.ONE_SECOND_INTERVAL); timeLeft -= CloudOperationsConstants.ONE_SECOND_INTERVAL; } return false; }
@Override protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException { client.deleteApplication(cloudModule.getDeployedApplicationName()); return null; } }.run(monitor);