use of com.amazonaws.services.kinesisvideo.model.CreateStreamRequest in project aws-sdk-android by aws-amplify.
the class KinesisVideoAndroidServiceClient method createStream.
@Override
public String createStream(@NonNull final String streamName, @NonNull final String deviceName, @NonNull final String contentType, @Nullable final String kmsKeyId, long retentionPeriodInHours, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
final CreateStreamRequest createStreamRequest = new CreateStreamRequest().withStreamName(streamName).withDeviceName(deviceName).withMediaType(contentType).withKmsKeyId(StringUtils.isBlank(kmsKeyId) ? null : kmsKeyId).withDataRetentionInHours((int) retentionPeriodInHours).withTags(null);
log.debug("calling create stream: " + createStreamRequest.toString());
final CreateStreamResult createStreamResult;
try {
createStreamResult = serviceClient.createStream(createStreamRequest);
} catch (final AmazonClientException e) {
// Wrap into an KinesisVideoException object
log.exception(e, "Service call failed.");
throw new KinesisVideoException(e);
}
log.debug("create stream result: " + createStreamResult.toString());
return createStreamResult.getStreamARN();
}
Aggregations