jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs-aws] JCLOUDS-457: Add polling strategy (#44)
Date Sat, 02 Aug 2014 01:20:12 GMT
> +
> +   private boolean inProgress(String job, String vault) {
> +      JobMetadata jobMetadata = client.describeJob(vault, job);
> +      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.IN_PROGRESS);
> +   }
> +
> +   private void waitForJob(String job, String vault) throws InterruptedException {
> +      Thread.sleep(initialWait);
> +      while (inProgress(job, vault)) {
> +         Thread.sleep(timeBetweenPolls);
> +      }
> +   }
> +
> +   private boolean succeeded(String job, String vault) {
> +      JobMetadata jobMetadata = client.describeJob(vault, job);
> +      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.SUCCEEDED);

See comment about `describeJob` above

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-aws/pull/44/files#r15726005
Mime
View raw message