Class HttpRequest.HttpRequestBuilder

java.lang.Object
org.sentrysoftware.metricshub.engine.client.http.HttpRequest.HttpRequestBuilder
Enclosing class:
HttpRequest

public static class HttpRequest.HttpRequestBuilder extends Object
Builder for creating instances of HttpRequest.
  • Constructor Details

    • HttpRequestBuilder

      public HttpRequestBuilder()
  • Method Details

    • header

      public HttpRequest.HttpRequestBuilder header(String value, String connectorId, String hostname) throws IOException
      Set the Header object.
      Parameters:
      value - String value that can reference an embedded file.
      connectorId - The identifier of the connector.
      hostname - The hostname of the host being monitored.
      Returns:
      This builder.
      Throws:
      IOException - If an I/O error occurs while processing the embedded file.
    • body

      public HttpRequest.HttpRequestBuilder body(String value, String connectorId, String hostname) throws IOException
      Set the Body object.
      Parameters:
      value - String value that can reference an embedded file.
      connectorId - The identifier of the connector.
      hostname - The hostname of the host being monitored.
      Returns:
      This builder.
      Throws:
      IOException - If an I/O error occurs while processing the embedded file.
    • getHttpEmbeddedFile

      public static Optional<EmbeddedFile> getHttpEmbeddedFile(String value, String context, String connectorId, String hostname) throws IOException
      Get the HTTP embedded file.
      Parameters:
      value - Value from which to extract the embedded file.
      context - Operation context (header or body) used for logging.
      connectorId - The identifier of the connector used for logging.
      hostname - The hostname of the host being monitored.
      Returns:
      Optional instance that may contain the EmbeddedFile instance.
      Throws:
      IOException - If an I/O error occurs while processing the embedded file.