/** * Constructs a new client to invoke service methods on Amazon Rekognition using the specified parameters. * * <p> * All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonRekognitionClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); }
/** * Normal invoke with authentication. Credentials are required and may be overriden at the request level. **/ private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler, ExecutionContext executionContext) { return invoke(request, responseHandler, executionContext, null, null); }
private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("rekognition.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/rekognition/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/rekognition/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); }
request = beforeClientExecution(request); return executeDeleteCollection(request);
/** * <p> * Stops a running stream processor that was created by <a>CreateStreamProcessor</a>. * </p> * * @param stopStreamProcessorRequest * @return Result of the StopStreamProcessor operation returned by the service. * @throws AccessDeniedException * You are not authorized to perform the action. * @throws InternalServerErrorException * Amazon Rekognition experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request. Try your call again. * @throws InvalidParameterException * Input parameter violated a constraint. Validate your parameter before calling the API operation again. * @throws ResourceNotFoundException * The collection specified in the request cannot be found. * @throws ResourceInUseException * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Rekognition. * @sample AmazonRekognition.StopStreamProcessor */ @Override public StopStreamProcessorResult stopStreamProcessor(StopStreamProcessorRequest request) { request = beforeClientExecution(request); return executeStopStreamProcessor(request); }
/** * <p> * Gets a list of stream processors that you have created with <a>CreateStreamProcessor</a>. * </p> * * @param listStreamProcessorsRequest * @return Result of the ListStreamProcessors operation returned by the service. * @throws AccessDeniedException * You are not authorized to perform the action. * @throws InternalServerErrorException * Amazon Rekognition experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request. Try your call again. * @throws InvalidParameterException * Input parameter violated a constraint. Validate your parameter before calling the API operation again. * @throws InvalidPaginationTokenException * Pagination token in the request is not valid. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Rekognition. * @sample AmazonRekognition.ListStreamProcessors */ @Override public ListStreamProcessorsResult listStreamProcessors(ListStreamProcessorsRequest request) { request = beforeClientExecution(request); return executeListStreamProcessors(request); }
@SdkInternalApi final DeleteFacesResult executeDeleteFaces(DeleteFacesRequest deleteFacesRequest) { ExecutionContext executionContext = createExecutionContext(deleteFacesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request<DeleteFacesRequest> request = null; Response<DeleteFacesResult> response = null; try { awsRequestMetrics.startEvent(Field.RequestMarshallTime); try { request = new DeleteFacesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFacesRequest)); // Binds the request metrics to the current request. request.setAWSRequestMetrics(awsRequestMetrics); request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion()); request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Rekognition"); request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFaces"); request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); } finally { awsRequestMetrics.endEvent(Field.RequestMarshallTime); } HttpResponseHandler<AmazonWebServiceResponse<DeleteFacesResult>> responseHandler = protocolFactory.createResponseHandler( new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFacesResultJsonUnmarshaller()); response = invoke(request, responseHandler, executionContext); return response.getAwsResponse(); } finally { endClientExecution(awsRequestMetrics, request, response); } }
ExecutionContext executionContext = createExecutionContext(getCelebrityInfoRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); unmarshaller); response = invoke(request, responseHandler, executionContext); endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
/** * Constructs a new client to invoke service methods on AmazonRekognition * using the specified AWS account credentials provider, client * configuration options and request metric collector. * <p> * All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. * @param clientConfiguration The client configuration options controlling * how this client connects to AmazonRekognition (ex: proxy * settings, retry counts, etc.). * @param httpClient A http client */ public AmazonRekognitionClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient) { super(adjustClientConfiguration(clientConfiguration), httpClient); this.awsCredentialsProvider = awsCredentialsProvider; init(); }
/** * <p> * Provides information about a stream processor created by <a>CreateStreamProcessor</a>. You can get information * about the input and output streams, the input parameters for the face recognition being performed, and the * current status of the stream processor. * </p> * * @param describeStreamProcessorRequest * @return Result of the DescribeStreamProcessor operation returned by the service. * @throws AccessDeniedException * You are not authorized to perform the action. * @throws InternalServerErrorException * Amazon Rekognition experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request. Try your call again. * @throws InvalidParameterException * Input parameter violated a constraint. Validate your parameter before calling the API operation again. * @throws ResourceNotFoundException * The collection specified in the request cannot be found. * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Rekognition. * @sample AmazonRekognition.DescribeStreamProcessor */ @Override public DescribeStreamProcessorResult describeStreamProcessor(DescribeStreamProcessorRequest request) { request = beforeClientExecution(request); return executeDescribeStreamProcessor(request); }
/** * <p> * Starts processing a stream processor. You create a stream processor by calling <a>CreateStreamProcessor</a>. To * tell <code>StartStreamProcessor</code> which stream processor to start, use the value of the <code>Name</code> * field specified in the call to <code>CreateStreamProcessor</code>. * </p> * * @param startStreamProcessorRequest * @return Result of the StartStreamProcessor operation returned by the service. * @throws AccessDeniedException * You are not authorized to perform the action. * @throws InternalServerErrorException * Amazon Rekognition experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request. Try your call again. * @throws InvalidParameterException * Input parameter violated a constraint. Validate your parameter before calling the API operation again. * @throws ResourceNotFoundException * The collection specified in the request cannot be found. * @throws ResourceInUseException * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Rekognition. * @sample AmazonRekognition.StartStreamProcessor */ @Override public StartStreamProcessorResult startStreamProcessor(StartStreamProcessorRequest request) { request = beforeClientExecution(request); return executeStartStreamProcessor(request); }
request = beforeClientExecution(request); return executeDeleteFaces(request);
/** * <p> * Deletes the stream processor identified by <code>Name</code>. You assign the value for <code>Name</code> when you * create the stream processor with <a>CreateStreamProcessor</a>. You might not be able to use the same name for a * stream processor for a few seconds after calling <code>DeleteStreamProcessor</code>. * </p> * * @param deleteStreamProcessorRequest * @return Result of the DeleteStreamProcessor operation returned by the service. * @throws AccessDeniedException * You are not authorized to perform the action. * @throws InternalServerErrorException * Amazon Rekognition experienced a service issue. Try your call again. * @throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request. Try your call again. * @throws InvalidParameterException * Input parameter violated a constraint. Validate your parameter before calling the API operation again. * @throws ResourceNotFoundException * The collection specified in the request cannot be found. * @throws ResourceInUseException * @throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon * Rekognition. * @sample AmazonRekognition.DeleteStreamProcessor */ @Override public DeleteStreamProcessorResult deleteStreamProcessor(DeleteStreamProcessorRequest request) { request = beforeClientExecution(request); return executeDeleteStreamProcessor(request); }
request = beforeClientExecution(request); return executeGetCelebrityInfo(request);
request = beforeClientExecution(request); return executeDescribeCollection(request);
request = beforeClientExecution(request); return executeListFaces(request);
request = beforeClientExecution(request); return executeDetectModerationLabels(request);
request = beforeClientExecution(request); return executeCreateStreamProcessor(request);
request = beforeClientExecution(request); return executeListCollections(request);
request = beforeClientExecution(request); return executeCreateCollection(request);