當前位置: 首頁>>代碼示例>>Java>>正文


Java AWSResponseException類代碼示例

本文整理匯總了Java中org.jclouds.aws.AWSResponseException的典型用法代碼示例。如果您正苦於以下問題:Java AWSResponseException類的具體用法?Java AWSResponseException怎麽用?Java AWSResponseException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AWSResponseException類屬於org.jclouds.aws包,在下文中一共展示了AWSResponseException類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPlacementGroupInRegion

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
private void createPlacementGroupInRegion(String region, String name) {
   checkNotNull(region, "region");
   checkNotNull(name, "name");
   logger.debug(">> creating placementGroup region(%s) name(%s)", region, name);
   try {
      ec2Api.getPlacementGroupApi().get().createPlacementGroupInRegion(region, name);
      logger.debug("<< created placementGroup(%s)", name);
      checkState(placementGroupAvailable.apply(new PlacementGroup(region, name, "cluster", State.PENDING)), String
               .format("placementGroup region(%s) name(%s) failed to become available", region, name));
   } catch (AWSResponseException e) {
      if (e.getError().getCode().equals("InvalidPlacementGroup.Duplicate")) {
         logger.debug("<< reused placementGroup(%s)", name);
      } else {
         throw e;
      }
   }
}
 
開發者ID:apache,項目名稱:stratos,代碼行數:18,代碼來源:CreatePlacementGroupIfNeeded.java

示例2: testDescribeSpotRequestsInRegionFilterInvalid

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Test(expectedExceptions = AWSResponseException.class)
public void testDescribeSpotRequestsInRegionFilterInvalid() {
   for (String region : Region.DEFAULT_REGIONS) {
      SortedSet<SpotInstanceRequest> allResults = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
              .describeSpotInstanceRequestsInRegion(region));
      assertNotNull(allResults);
      if (allResults.size() >= 1) {
         SpotInstanceRequest request = allResults.last();
         SortedSet<SpotInstanceRequest> result = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
                 .describeSpotInstanceRequestsInRegionWithFilter(region,
                         ImmutableMultimap.<String, String>builder()
                                 .put("invalid-filter", request.getId()).build()));
      }
   }

}
 
開發者ID:apache,項目名稱:stratos,代碼行數:17,代碼來源:SpotInstanceApiLiveTest.java

示例3: testPublicWriteOnObject

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testPublicWriteOnObject() throws InterruptedException,
        ExecutionException, TimeoutException, IOException {
    try {
        super.testPublicWriteOnObject();
        Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
    } catch (AWSResponseException are) {
        assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
        throw new SkipException("public-read-write-acl not supported", are);
    }
}
 
開發者ID:gaul,項目名稱:s3proxy,代碼行數:13,代碼來源:JcloudsS3ClientLiveTest.java

示例4: testUpdateObjectACL

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testUpdateObjectACL() throws InterruptedException,
        ExecutionException, TimeoutException, IOException {
    try {
        super.testUpdateObjectACL();
        Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
    } catch (AWSResponseException are) {
        assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
        throw new SkipException("XML ACLs not supported", are);
    }
}
 
開發者ID:gaul,項目名稱:s3proxy,代碼行數:13,代碼來源:JcloudsS3ClientLiveTest.java

示例5: testUpdateBucketACL

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testUpdateBucketACL() throws Exception {
    try {
        super.testUpdateBucketACL();
        Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
    } catch (AWSResponseException are) {
        assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
        throw new SkipException("XML ACLs not supported", are);
    }
}
 
開發者ID:gaul,項目名稱:s3proxy,代碼行數:12,代碼來源:JcloudsBucketsLiveTest.java

示例6: testBucketPayer

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testBucketPayer() throws Exception {
    try {
        super.testBucketPayer();
        Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
    } catch (AWSResponseException are) {
        assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
        throw new SkipException("bucket payer not supported", are);
    }
}
 
開發者ID:gaul,項目名稱:s3proxy,代碼行數:12,代碼來源:JcloudsBucketsLiveTest.java

示例7: testBucketLogging

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testBucketLogging() throws Exception {
    try {
        super.testBucketLogging();
        Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
    } catch (AWSResponseException are) {
        assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
        throw new SkipException("bucket logging not supported", are);
    }
}
 
開發者ID:gaul,項目名稱:s3proxy,代碼行數:12,代碼來源:JcloudsBucketsLiveTest.java

示例8: testFilterInvalid

import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Test(expectedExceptions = AWSResponseException.class)
public void testFilterInvalid() {
   for (String region : supportedRegions) {
      SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get()
              .describePlacementGroupsInRegion(region));
      assertNotNull(allResults);
      if (allResults.size() >= 1) {
         PlacementGroup group = allResults.last();
         client.getPlacementGroupApi().get()
                 .describePlacementGroupsInRegionWithFilter(region,
                         ImmutableMultimap.<String, String>builder()
                                 .put("invalid-filter", group.getName()).build());
      }
   }
}
 
開發者ID:apache,項目名稱:stratos,代碼行數:16,代碼來源:PlacementGroupApiLiveTest.java


注:本文中的org.jclouds.aws.AWSResponseException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。