java.lang.Object
org.qubership.integration.platform.engine.opensearch.ism.model.rest.GenericRequest
All Implemented Interfaces:
org.opensearch.client.opensearch.generic.Request, org.opensearch.client.transport.GenericSerializable

public class GenericRequest extends Object implements org.opensearch.client.transport.GenericSerializable, org.opensearch.client.opensearch.generic.Request
Generic HTTP request to OpenSearch, copied from org.opensearch.client.opensearch.generic.GenericRequest
  • Constructor Details

    • GenericRequest

      public GenericRequest(String method, String endpoint, Collection<Map.Entry<String,String>> headers)
      Create the GenericRequest.
      Parameters:
      method - the HTTP method
      endpoint - the path of the request (without scheme, host, port, or prefix)
      headers - list of headers
    • GenericRequest

      public GenericRequest(String method, String endpoint, Collection<Map.Entry<String,String>> headers, Map<String,String> parameters, @Nullable org.opensearch.client.opensearch.generic.Body body)
      Create the GenericRequest.
      Parameters:
      method - the HTTP method
      endpoint - the path of the request (without scheme, host, port, or prefix)
      headers - list of headers
      parameters - query parameters
      body - optional body
  • Method Details

    • getMethod

      public String getMethod()
      The HTTP method.
      Specified by:
      getMethod in interface org.opensearch.client.opensearch.generic.Request
    • getEndpoint

      public String getEndpoint()
      The path of the request (without scheme, host, port, or prefix).
      Specified by:
      getEndpoint in interface org.opensearch.client.opensearch.generic.Request
    • getParameters

      public Map<String,String> getParameters()
      Query string parameters. The returned map is an unmodifiable view of the map in the request.
      Specified by:
      getParameters in interface org.opensearch.client.opensearch.generic.Request
    • getHeaders

      public Collection<Map.Entry<String,String>> getHeaders()
      Specified by:
      getHeaders in interface org.opensearch.client.opensearch.generic.Request
    • getBody

      public Optional<org.opensearch.client.opensearch.generic.Body> getBody()
      The body of the request. If null then no body is sent with the request.
      Specified by:
      getBody in interface org.opensearch.client.opensearch.generic.Request
    • toString

      public String toString()
      Convert request to string representation
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Compare two requests for equality
      Overrides:
      equals in class Object
      Parameters:
      obj - request instance to compare with
    • hashCode

      public int hashCode()
      Calculate the hash code of the request
      Overrides:
      hashCode in class Object
    • serialize

      public String serialize(OutputStream out)
      Specified by:
      serialize in interface org.opensearch.client.transport.GenericSerializable