List of usage examples for com.amazonaws.http SdkHttpMetadata from
public static SdkHttpMetadata from(HttpResponse httpResponse)
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 www. ja va 2 s . com 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; }