use of com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient in project aws-sdk-android by aws-amplify.
the class KinesisVideoAndroidServiceClient method tagStream.
@Override
public void tagStream(@NonNull final String streamArn, @Nullable final Map<String, String> tags, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
final TagStreamRequest tagStreamRequest = new TagStreamRequest().withStreamARN(streamArn).withTags(tags);
log.debug("calling tag resource: " + tagStreamRequest.toString());
final TagStreamResult tagStreamResult;
try {
tagStreamResult = serviceClient.tagStream(tagStreamRequest);
} catch (final AmazonClientException e) {
log.exception(e, "Service call failed.");
throw new KinesisVideoException(e);
}
log.debug("tag resource result: " + tagStreamResult.toString());
}
use of com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient in project aws-sdk-android by aws-amplify.
the class KinesisVideoAndroidServiceClient method createAwsKinesisVideoClient.
private static AWSKinesisVideoClient createAwsKinesisVideoClient(final AWSCredentials credentials, final Region region, final String endpoint, final int timeoutInMillis) throws KinesisVideoException {
final ClientConfiguration clientConfiguration = createClientConfiguration(timeoutInMillis);
final AWSKinesisVideoClient awsKinesisVideoClient = new AWSKinesisVideoClient(credentials, clientConfiguration);
awsKinesisVideoClient.setRegion(region);
awsKinesisVideoClient.setSignerRegionOverride(region.getName());
awsKinesisVideoClient.setServiceNameIntern("kinesisvideo");
awsKinesisVideoClient.setEndpoint(endpoint);
return awsKinesisVideoClient;
}
use of com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient 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());
}
use of com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient in project aws-sdk-android by aws-amplify.
the class KinesisVideoAndroidServiceClient method getDataEndpoint.
@Override
public String getDataEndpoint(@NonNull final String streamName, @NonNull final String apiName, long timeoutInMillis, @Nullable final KinesisVideoCredentialsProvider credentialsProvider) throws KinesisVideoException {
final AWSKinesisVideoClient serviceClient = createAwsKinesisVideoClient(credentialsProvider, Region.getRegion(Regions.fromName(configuration.getRegion())), configuration.getEndpoint(), (int) timeoutInMillis);
final GetDataEndpointRequest getDataEndpointRequest = new GetDataEndpointRequest().withStreamName(streamName).withAPIName(apiName);
log.debug("calling get data endpoint: " + getDataEndpointRequest.toString());
final GetDataEndpointResult getDataEndpointResult;
try {
getDataEndpointResult = serviceClient.getDataEndpoint(getDataEndpointRequest);
} catch (final AmazonClientException e) {
log.exception(e, "Service call failed.");
throw new KinesisVideoException(e);
}
log.debug("get data endpoint result: " + getDataEndpointResult.toString());
return getDataEndpointResult.getDataEndpoint();
}
use of com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient 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);
}
Aggregations