List of usage examples for com.amazonaws.http HttpResponse HttpResponse
public HttpResponse(Request<?> request, HttpRequestBase httpRequest)
From source file:org.apache.beam.sdk.io.kinesis.AmazonKinesisMock.java
License:Apache License
@Override public DescribeStreamResult describeStream(String streamName, String exclusiveStartShardId) { int nextShardId = 0; if (exclusiveStartShardId != null) { nextShardId = parseInt(exclusiveStartShardId) + 1; }//from w w w . ja v a2 s . c o m boolean hasMoreShards = nextShardId + 1 < shardedData.size(); List<Shard> shards = new ArrayList<>(); if (nextShardId < shardedData.size()) { shards.add(new Shard().withShardId(Integer.toString(nextShardId))); } HttpResponse response = new HttpResponse(null, null); response.setStatusCode(200); DescribeStreamResult result = new DescribeStreamResult(); result.setSdkHttpMetadata(SdkHttpMetadata.from(response)); result.withStreamDescription(new StreamDescription().withHasMoreShards(hasMoreShards).withShards(shards) .withStreamName(streamName)); return result; }