@SdkInternalApi
    final StopApplicationResult executeStopApplication(StopApplicationRequest stopApplicationRequest) {

        ExecutionContext executionContext = createExecutionContext(stopApplicationRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<StopApplicationRequest> request = null;
        Response<StopApplicationResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new StopApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopApplicationRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Kinesis Analytics");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopApplication");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            HttpResponseHandler<AmazonWebServiceResponse<StopApplicationResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopApplicationResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<note>
<p>
This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL
applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see
<a href="/kinesisanalytics/latest/apiv2/Welcome.html">Amazon Kinesis Data Analytics API V2 Documentation</a>.
</p>
</note>
<p>
Stops the application from processing input data. You can stop an application only if it is in the running state.
You can use the <a
href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html">DescribeApplication
</a> operation to find the application state. After the application is stopped, Amazon Kinesis Analytics stops
reading data from the input, the application stops processing data, and there is no output written to the
destination.
</p>
<p>
This operation requires permissions to perform the <code>kinesisanalytics:StopApplication</code> action.
</p>

@param stopApplicationRequest
@return Result of the StopApplication operation returned by the service.
@throws ResourceNotFoundException
        Specified application can't be found.
@throws ResourceInUseException
        Application is not available for this operation.
@throws UnsupportedOperationException
        The request was rejected because a specified parameter is not supported or a specified resource is not
        valid for this operation.
@sample AmazonKinesisAnalytics.StopApplication
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/StopApplication"
     target="_top">AWS API Documentation</a>
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisanalytics/AmazonKinesisAnalyticsClient.java