Search in sources :

Example 1 with NoOpWaiterHandler

use of com.amazonaws.waiters.NoOpWaiterHandler in project wildfly-camel by wildfly-extras.

the class KinesisUtils method createStream.

public static void createStream(AmazonKinesisClient client, String streamName) throws Exception {
    client.createStream(streamName, 1);
    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);
}
Also used : NoOpWaiterHandler(com.amazonaws.waiters.NoOpWaiterHandler) DescribeStreamRequest(com.amazonaws.services.kinesis.model.DescribeStreamRequest)

Example 2 with NoOpWaiterHandler

use of com.amazonaws.waiters.NoOpWaiterHandler in project wildfly-camel by wildfly-extras.

the class S3Utils method createBucket.

@SuppressWarnings("unchecked")
public static void createBucket(AmazonS3Client client, String bucketName) throws Exception {
    client.createBucket(bucketName);
    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);
}
Also used : HeadBucketRequest(com.amazonaws.services.s3.model.HeadBucketRequest) NoOpWaiterHandler(com.amazonaws.waiters.NoOpWaiterHandler)

Aggregations

NoOpWaiterHandler (com.amazonaws.waiters.NoOpWaiterHandler)2 DescribeStreamRequest (com.amazonaws.services.kinesis.model.DescribeStreamRequest)1 HeadBucketRequest (com.amazonaws.services.s3.model.HeadBucketRequest)1