Class OpenSearchConnector
java.lang.Object
ai.attackframework.tools.burp.utils.opensearch.OpenSearchConnector
Factory/cache for OpenSearch clients.
Ownership: Clients are cached per base URL (and optional credentials) and reused. Do not close the returned client; lifecycle is managed here.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.opensearch.client.opensearch.OpenSearchClientReturns a cached client for the given base URL, creating it on first use (no auth).static org.opensearch.client.opensearch.OpenSearchClientReturns a cached client for the given base URL and optional basic-auth credentials.
-
Method Details
-
getClient
Returns a cached client for the given base URL, creating it on first use (no auth).- Parameters:
baseUrl- e.g., https://opensearch.url:9200- Returns:
- shared client
- Throws:
OpenSearchClientBuildException- when the client cannot be constructed
-
getClient
public static org.opensearch.client.opensearch.OpenSearchClient getClient(String baseUrl, String username, String password) Returns a cached client for the given base URL and optional basic-auth credentials. When both username and password are non-null and non-empty, basic auth is configured.- Parameters:
baseUrl- e.g., https://opensearch.url:9200username- optional; null or empty to skip authpassword- optional; null or empty to skip auth- Returns:
- shared client
- Throws:
OpenSearchClientBuildException- when the client cannot be constructed
-