Class HttpRequest.HttpRequestBuilder
java.lang.Object
org.sentrysoftware.metricshub.engine.client.http.HttpRequest.HttpRequestBuilder
- Enclosing class:
HttpRequest
Builder for creating instances of
HttpRequest.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet theBodyobject.static Optional<EmbeddedFile> getHttpEmbeddedFile(String value, String context, String connectorId, String hostname) Get the HTTP embedded file.Set theHeaderobject.
-
Constructor Details
-
HttpRequestBuilder
public HttpRequestBuilder()
-
-
Method Details
-
header
public HttpRequest.HttpRequestBuilder header(String value, String connectorId, String hostname) throws IOException Set theHeaderobject.- 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 theBodyobject.- 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:
Optionalinstance that may contain theEmbeddedFileinstance.- Throws:
IOException- If an I/O error occurs while processing the embedded file.
-