@Test public void testResumeSystemAsync() throws Exception { Task responseTask = getExpectedTaskResponse(); DeploymentApi deploymentApi = new DeploymentRestApi(restClient); final CountDownLatch latch = new CountDownLatch(1); deploymentApi.resumeSystemAsync("deploymentId1", new FutureCallback<Task>() { @Override public void onSuccess(Task result) { assertEquals(result, responseTask); latch.countDown(); } @Override public void onFailure(Throwable t) { fail(t.toString()); latch.countDown(); } }); assertThat(latch.await(COUNTDOWNLATCH_AWAIT_TIMEOUT, TimeUnit.SECONDS), is(true)); }
@Override public void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); createObjectAsync(path, null, responseCallback); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); createObjectAsync(path, null, responseCallback); } }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); createObjectAsync(path, null, responseCallback); } DeploymentRestApi(RestClient restClient); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); createObjectAsync(path, null, responseCallback); } DeploymentRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceList<Deployment> listAll(); @Override void listAllAsync(final FutureCallback<ResourceList<Deployment>> responseCallback); @Override Task pauseSystem(String deploymentId); @Override void pauseSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override Task resumeSystem(String deploymentId); @Override void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override ResourceList<Vm> getAllDeploymentVms(final String deploymentId); @Override void getAllDeploymentVmsAsync(String deploymentId, final FutureCallback<ResourceList<Vm>> responseCallback); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); createObjectAsync(path, null, responseCallback); } DeploymentRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceList<Deployment> listAll(); @Override void listAllAsync(final FutureCallback<ResourceList<Deployment>> responseCallback); @Override Task pauseSystem(String deploymentId); @Override void pauseSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override Task resumeSystem(String deploymentId); @Override void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override ResourceList<Vm> getAllDeploymentVms(final String deploymentId); @Override void getAllDeploymentVmsAsync(String deploymentId, final FutureCallback<ResourceList<Vm>> responseCallback);  }