Search in sources :

Example 1 with DeleteStreamRequest

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

the class KinesisVideoAndroidServiceClient method deleteStream.

@Override
public void deleteStream(@NonNull final String streamName, @NonNull final String version, final Date creationTime, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
    final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
    final StreamDescription streamDescription = describeStream(streamName, timeoutInMillis, credentialsProvider);
    final DeleteStreamRequest deleteStreamRequest = new DeleteStreamRequest().withStreamARN(streamDescription.getStreamArn()).withCurrentVersion(streamDescription.getUpdateVersion());
    log.debug("calling delete stream: " + deleteStreamRequest.toString());
    final DeleteStreamResult deleteStreamResult;
    try {
        deleteStreamResult = serviceClient.deleteStream(deleteStreamRequest);
    } catch (final AmazonClientException e) {
        log.exception(e, "Service call failed.");
        throw new KinesisVideoException(e);
    }
    log.debug("delete stream result: " + deleteStreamResult.toString());
}
Also used : DeleteStreamRequest(com.amazonaws.services.kinesisvideo.model.DeleteStreamRequest) DeleteStreamResult(com.amazonaws.services.kinesisvideo.model.DeleteStreamResult) AWSKinesisVideoClient(com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient) StreamDescription(com.amazonaws.kinesisvideo.producer.StreamDescription) AmazonClientException(com.amazonaws.AmazonClientException) KinesisVideoException(com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)

Aggregations

AmazonClientException (com.amazonaws.AmazonClientException)1 KinesisVideoException (com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)1 StreamDescription (com.amazonaws.kinesisvideo.producer.StreamDescription)1 AWSKinesisVideoClient (com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient)1 DeleteStreamRequest (com.amazonaws.services.kinesisvideo.model.DeleteStreamRequest)1 DeleteStreamResult (com.amazonaws.services.kinesisvideo.model.DeleteStreamResult)1