code: public ApplicationState getApplication(final String applicationId) throws IOException {
      final String url = this.getApplicationURL(applicationId);
      final HttpGet get = prepareGet(url);
      try (final CloseableHttpResponse response = this.httpClient.execute(get, this.httpClientContext)) {
        final String message = IOUtils.toString(response.getEntity().getContent());
        final ApplicationResponse result = this.objectMapper.readValue(message, ApplicationResponse.class);
        return result.getApplicationState();
      }
    }
docs: Gets the application state given a YARN application ID.
  @param applicationId
  @return Application state of the requested application.