Search in sources :

Example 1 with GetDataEndpointRequest

use of com.amazonaws.services.kinesisvideo.model.GetDataEndpointRequest 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();
}
Also used : AWSKinesisVideoClient(com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient) AmazonClientException(com.amazonaws.AmazonClientException) GetDataEndpointRequest(com.amazonaws.services.kinesisvideo.model.GetDataEndpointRequest) GetDataEndpointResult(com.amazonaws.services.kinesisvideo.model.GetDataEndpointResult) KinesisVideoException(com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)

Example 2 with GetDataEndpointRequest

use of com.amazonaws.services.kinesisvideo.model.GetDataEndpointRequest in project amazon-kinesis-video-streams-parser-library by aws.

the class GetMediaForFragmentListWorker method create.

public static GetMediaForFragmentListWorker create(final String streamName, final List<String> fragmentNumbers, final AWSCredentialsProvider awsCredentialsProvider, final Regions region, final AmazonKinesisVideo amazonKinesisVideo, final MkvElementVisitor elementVisitor) {
    final GetDataEndpointRequest request = new GetDataEndpointRequest().withAPIName(APIName.GET_MEDIA_FOR_FRAGMENT_LIST).withStreamName(streamName);
    final String endpoint = amazonKinesisVideo.getDataEndpoint(request).getDataEndpoint();
    return new GetMediaForFragmentListWorker(streamName, fragmentNumbers, awsCredentialsProvider, endpoint, region, elementVisitor);
}
Also used : GetDataEndpointRequest(com.amazonaws.services.kinesisvideo.model.GetDataEndpointRequest)

Aggregations

GetDataEndpointRequest (com.amazonaws.services.kinesisvideo.model.GetDataEndpointRequest)2 AmazonClientException (com.amazonaws.AmazonClientException)1 KinesisVideoException (com.amazonaws.kinesisvideo.common.exception.KinesisVideoException)1 AWSKinesisVideoClient (com.amazonaws.services.kinesisvideo.AWSKinesisVideoClient)1 GetDataEndpointResult (com.amazonaws.services.kinesisvideo.model.GetDataEndpointResult)1