Class ElasticConnection

java.lang.Object
ghidra.features.bsim.query.elastic.ElasticConnection

public class ElasticConnection extends Object
  • Field Details

  • Constructor Details

    • ElasticConnection

      public ElasticConnection(String url, String repo)
  • Method Details

    • lastRequestSuccessful

      public boolean lastRequestSuccessful()
    • executeRawStatement

      public com.google.gson.JsonObject executeRawStatement(String command, String path, String body) throws ElasticException
      Send a raw request to the server that is not specific to the repository. Intended for general configuration or security commands
      Parameters:
      command - is the type of command
      path - is the specific URL path receiving the command
      body - is JSON document describing the command
      Returns:
      the response as parsed JsonObject
      Throws:
      ElasticException - for any problems with the connection
    • executeStatementNoResponse

      public void executeStatementNoResponse(String command, String path, String body) throws ElasticException
      Execute an elasticsearch command where we are not expecting a response
      Parameters:
      command - is the type of the command
      path - is the overarching index/type/<command>
      body - is the JSON document describing the request
      Throws:
      ElasticException - for any problems with the connecting
    • executeStatement

      public com.google.gson.JsonObject executeStatement(String command, String path, String body) throws ElasticException
      Execute an elastic search statement and return the JSON response to user
      Parameters:
      command - is the type of command
      path - is the overarching index/type/<command>
      body - is JSON document describing the request
      Returns:
      the parsed response as a JsonObject
      Throws:
      ElasticException - for any problems with the connection
    • executeStatementExpectFailure

      public com.google.gson.JsonObject executeStatementExpectFailure(String command, String path, String body) throws ElasticException
      Execute an elastic search statement and return the JSON response to user Do not throw an exception on failure, just return the error response
      Parameters:
      command - is the type of command
      path - is the overarching index/type/<command>
      body - is JSON document describing the request
      Returns:
      the parsed response as a JsonObject
      Throws:
      ElasticException - for any problems with the connection
    • executeBulk

      public com.google.gson.JsonObject executeBulk(String path, String body) throws ElasticException
      Send a bulk request to the elasticsearch server. This is a special format for combining multiple commands and is structured slightly differently from other commands.
      Parameters:
      path - is the specific URL path receiving the bulk command
      body - is structured list of JSON commands and source
      Returns:
      the response as parsed JsonObject
      Throws:
      ElasticException - for any problems with the connection
    • executeURIOnly

      public com.google.gson.JsonObject executeURIOnly(String command, String path) throws ElasticException
      Throws:
      ElasticException