当前位置: 首页>>代码示例>>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;未经允许,请勿转载。