src/main/java/io/jenkins/plugins/pipeline_elasticsearch_logs/ElasticSearchAccess.java
/**
   * Posts the given string to elastic search.
   *
   * @param data
   *          The data to post
   * @throws IOException
   */
Posts the given string to elastic search.
@param data
The data to post
@throws IOException
Posts the given string to elastic search . @param data The data to post @throws IOException
public void push(String data) throws IOException
  {
    HttpPost post = getHttpPost(data);
    try (CloseableHttpClient httpClient = getClientBuilder().build())
    {
      try (CloseableHttpResponse response = httpClient.execute(post))
      {
        if (!SUCCESS_CODES.contains(response.getStatusLine().getStatusCode()))
        {
          String errorMessage = this.getErrorMessage(response);
          throw new IOException(errorMessage);
        }
      }
      catch (Exception e)
      {
        throw new IOException(e);
      }
    }
  }
public void push ( String data ) throws IOException { HttpPost post = getHttpPost ( data ) ; try ( CloseableHttpClient httpClient = getClientBuilder ( ) . build ( ) ) { try ( CloseableHttpResponse response = httpClient . execute ( post ) ) { if ( ! SUCCESS_CODES . contains ( response . getStatusLine ( ) . getStatusCode ( ) ) ) { String errorMessage = this . getErrorMessage ( response ) ; throw new IOException ( errorMessage ) ; } } catch ( Exception e ) { throw new IOException ( e ) ; } } }
Posts the given string to elastic search.
Posts the given string to elastic search .