Class ElasticConnection
java.lang.Object
ghidra.features.bsim.query.elastic.ElasticConnection
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gson.JsonObject
executeBulk
(String path, String body) Send a bulk request to the elasticsearch server.com.google.gson.JsonObject
executeRawStatement
(String command, String path, String body) Send a raw request to the server that is not specific to the repository.com.google.gson.JsonObject
executeStatement
(String command, String path, String body) Execute an elastic search statement and return the JSON response to usercom.google.gson.JsonObject
executeStatementExpectFailure
(String command, String path, String body) Execute an elastic search statement and return the JSON response to user Do not throw an exception on failure, just return the error responsevoid
executeStatementNoResponse
(String command, String path, String body) Execute an elasticsearch command where we are not expecting a responsecom.google.gson.JsonObject
executeURIOnly
(String command, String path) boolean
-
Field Details
-
POST
- See Also:
-
PUT
- See Also:
-
GET
- See Also:
-
DELETE
- See Also:
-
hostURL
-
httpURLbase
-
-
Constructor Details
-
ElasticConnection
-
-
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 commandpath
- is the specific URL path receiving the commandbody
- 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 commandpath
- is the overarchingindex/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 commandpath
- is the overarchingindex/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 commandpath
- is the overarchingindex/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
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 commandbody
- 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
-