Example usage for com.amazonaws.waiters NoOpWaiterHandler NoOpWaiterHandler

List of usage examples for com.amazonaws.waiters NoOpWaiterHandler NoOpWaiterHandler

Introduction

In this page you can find the example usage for com.amazonaws.waiters NoOpWaiterHandler NoOpWaiterHandler.

Prototype

NoOpWaiterHandler

Source Link

Usage

From source file:org.wildfly.camel.test.common.aws.KinesisUtils.java

License:Apache License

public static void createStream(AmazonKinesisClient client, String streamName) throws Exception {

    client.createStream(streamName, 1);/*from w ww . ja  va2s. co m*/

    Waiter<DescribeStreamRequest> waiter = client.waiters().streamExists();
    DescribeStreamRequest request = new DescribeStreamRequest().withStreamName(streamName);
    Assert.assertNotNull("Cannot obtain stream description", request);
    Future<Void> future = waiter.runAsync(new WaiterParameters<DescribeStreamRequest>(request),
            new NoOpWaiterHandler());
    future.get(1, TimeUnit.MINUTES);
}

From source file:org.wildfly.camel.test.common.aws.S3Utils.java

License:Apache License

@SuppressWarnings("unchecked")
public static void createBucket(AmazonS3Client client, String bucketName) throws Exception {

    client.createBucket(bucketName);/*from w w  w  .  ja  v a2s  .com*/

    HeadBucketRequest request = new HeadBucketRequest(bucketName);
    Waiter<HeadBucketRequest> waiter = client.waiters().bucketExists();
    Future<Void> future = waiter.runAsync(new WaiterParameters<HeadBucketRequest>(request),
            new NoOpWaiterHandler());
    future.get(1, TimeUnit.MINUTES);
}