Search in sources :

Example 1 with DescribeStreamRequest

use of com.amazonaws.services.kinesisvideo.model.DescribeStreamRequest in project aws-sdk-android by aws-amplify.

the class KinesisVideoAndroidServiceClient method describeStream.

@Override
public StreamDescription describeStream(@NonNull final String streamName, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
    final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
    final DescribeStreamRequest describeStreamRequest = new DescribeStreamRequest().withStreamName(streamName);
    log.debug("calling describe stream: " + describeStreamRequest.toString());
    final DescribeStreamResult describeStreamResult;
    try {
        describeStreamResult = serviceClient.describeStream(describeStreamRequest);
    } catch (final AmazonClientException e) {
        log.exception(e, "Service call failed.");
        throw new KinesisVideoException(e);
    }
    if (null == describeStreamResult) {
        log.debug("describe stream returned null");
        return null;
    }
    log.debug("describe stream result: " + describeStreamResult.toString());
    return toStreamDescription(describeStreamResult);
}
Also used : AWSKinesisVideoClient(com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient) AmazonClientException(com.amazonaws.AmazonClientException) DescribeStreamRequest(com.amazonaws.services.kinesisvideo.model.DescribeStreamRequest) DescribeStreamResult(com.amazonaws.services.kinesisvideo.model.DescribeStreamResult) KinesisVideoException(com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)

Aggregations

AmazonClientException (com.amazonaws.AmazonClientException)1 KinesisVideoException (com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)1 AWSKinesisVideoClient (com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient)1 DescribeStreamRequest (com.amazonaws.services.kinesisvideo.model.DescribeStreamRequest)1 DescribeStreamResult (com.amazonaws.services.kinesisvideo.model.DescribeStreamResult)1