Package org.jclouds.glacier.domain

Examples of org.jclouds.glacier.domain.JobMetadata


   @Test(groups = {"live", "livelong", "longtest"}, dependsOnMethods = {"testInitiateJob"})
   public void testDescribeJob() {
      VaultMetadata vaultMetadata = api.describeVault(VAULT_NAME);

      JobMetadata archiveRetrievalMetadata = api.describeJob(VAULT_NAME, archiveRetrievalJob);
      assertThat(archiveRetrievalMetadata.getArchiveId()).isEqualTo(archiveId);
      assertThat(archiveRetrievalMetadata.getJobId()).isEqualTo(archiveRetrievalJob);
      assertThat(archiveRetrievalMetadata.getVaultArn()).isEqualTo(vaultMetadata.getVaultARN());

      JobMetadata inventoryRetrievalMetadata = api.describeJob(VAULT_NAME, inventoryRetrievalJob);
      assertThat(inventoryRetrievalMetadata.getJobId()).isEqualTo(inventoryRetrievalJob);
      assertThat(inventoryRetrievalMetadata.getVaultArn()).isEqualTo(vaultMetadata.getVaultARN());
   }
View Full Code Here


   public BasePollingStrategy(GlacierClient client) {
      this(DEFAULT_INITIAL_WAIT, DEFAULT_TIME_BETWEEN_POLLS, client);
   }

   private boolean inProgress(String job, String vault) {
      JobMetadata jobMetadata = client.describeJob(vault, job);
      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.IN_PROGRESS);
   }
View Full Code Here

         Thread.sleep(timeBetweenPolls);
      }
   }

   private boolean succeeded(String job, String vault) {
      JobMetadata jobMetadata = client.describeJob(vault, job);
      return (jobMetadata != null) && (jobMetadata.getStatusCode() == JobStatus.SUCCEEDED);
   }
View Full Code Here

      mr.addHeader(HttpHeaders.CONTENT_TYPE, MediaType.JSON_UTF_8);
      mr.setBody(getResponseBody("/json/describeJobResponseBody.json"));
      mr.addHeader(HttpHeaders.CONTENT_LENGTH, mr.getBody().length);
      server.enqueue(mr);

      JobMetadata job = client.describeJob(VAULT_NAME, JOB_ID);
      assertThat(job.getAction()).isEqualTo("ArchiveRetrieval");
      assertThat(job.getArchiveId()).isEqualTo(ARCHIVE_ID);
      assertThat(ContentRange.fromString("0-16777215")).isEqualTo(job.getRetrievalByteRange());
      assertThat(job.getVaultArn()).isEqualTo("arn:aws:glacier:us-east-1:012345678901:vaults/examplevault");

      assertEquals(server.takeRequest().getRequestLine(), "GET /-/vaults/" + VAULT_NAME + "/jobs/" + JOB_ID + " " + HTTP);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.glacier.domain.JobMetadata

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.