Interface OpenSearchConfigManager

All Known Implementing Classes:
DefaultOpenSearchConfigManager

public interface OpenSearchConfigManager
Configuration manager for OpenSearch settings.
  • Method Details

    • isCompressionEnabled

      boolean isCompressionEnabled()
      Determines whether HTTP request compression is enabled for OpenSearch connections.
      Returns:
      true if compression is enabled, false otherwise. Returns the default value if the property is not configured.
    • getUsername

      Optional<String> getUsername()
      Gets the username for authentication.
      Returns:
      an Optional containing the username if configured, or Optional.empty() if not set
    • getPassword

      Optional<String> getPassword()
      Gets the password for basic authentication with Apache HTTP transport.
      Returns:
      an Optional containing the password if configured, or Optional.empty() if not set
    • getAwsRegion

      Optional<String> getAwsRegion()
      Gets the AWS region for Amazon OpenSearch Service connections.

      This is required when using AWS OpenSearch Service with request signing.

      Returns:
      an Optional containing the AWS region (e.g., "us-east-1") if configured, or Optional.empty() if not set
    • getApacheHosts

      List<org.apache.hc.core5.http.HttpHost> getApacheHosts()
      Gets the list of Apache HTTP hosts for OpenSearch cluster connections.

      This method parses a comma-separated list of URLs from the configuration and returns them as HttpHost objects. This is used when connecting to OpenSearch via Apache HTTP transport.

      Returns:
      a list of HttpHost objects representing the OpenSearch nodes
      Throws:
      NullPointerException - if the HTTP URL property is not configured
      ConfigParseException - if any URL is malformed
    • getAwsHost

      org.apache.hc.core5.http.HttpHost getAwsHost()
      Gets the AWS OpenSearch Service host.

      This method returns a single host for AWS OpenSearch Service connections. Unlike getApacheHosts(), this expects a single domain endpoint.

      Returns:
      an HttpHost object representing the AWS OpenSearch domain
      Throws:
      NullPointerException - if the HTTP URL property is not configured
      ConfigParseException - if the URL is malformed
    • getHttpHost

      org.apache.hc.core5.http.HttpHost getHttpHost(String url, String key)
      Creates an HttpHost object from a URL string.

      This utility method parses a URL string and creates an appropriate HttpHost object. It's used internally by other methods but exposed for flexibility.

      Parameters:
      url - the URL string to parse (e.g., "http://localhost:9200")
      key - the configuration property key, used for error messages
      Returns:
      an HttpHost object representing the parsed URL
      Throws:
      ConfigParseException - if the URL is malformed
    • getConnectTimeout

      int getConnectTimeout()
      Gets the connection timeout for OpenSearch HTTP connections.
      Returns:
      the connection timeout in milliseconds
    • getRequestConnectTimeout

      int getRequestConnectTimeout()
      Gets the request connection timeout for OpenSearch HTTP connections.
      Returns:
      the request connection timeout in milliseconds
    • getSocketTimeout

      int getSocketTimeout()
      Gets the socket timeout for OpenSearch HTTP connections.
      Returns:
      the socket timeout in milliseconds
    • getMaxHttpConnectionTotal

      int getMaxHttpConnectionTotal()
      Gets the maximum total number of HTTP connections allowed.
      Returns:
      the maximum total number of HTTP connections
    • getMaxHttpConnectionPerRoute

      int getMaxHttpConnectionPerRoute()
      Gets the maximum number of HTTP connections allowed per route.
      Returns:
      the maximum number of HTTP connections per route
    • getStreamBatchSize

      int getStreamBatchSize()
      Gets the batch size for streaming search results.
      Returns:
      the stream batch size (number of documents per batch)
    • isDfsQueryThenFetch

      boolean isDfsQueryThenFetch()
      Determines whether DFS query-then-fetch search type should be used.
      Returns:
      true if DFS query-then-fetch should be used, false otherwise
    • getPointInTimeKeepAlive

      Duration getPointInTimeKeepAlive()
      Gets the keep-alive duration for Point-in-Time (PIT) contexts.
      Returns:
      the PIT keep-alive duration
    • trustAllSsl

      boolean trustAllSsl()
      Configures the HTTP client to accept all SSL certificates for testing. Dev mode must also be enabled.
      Returns:
      true if all SSL certificates should be trusted, otherwise false
    • getPhysicalIndexName

      String getPhysicalIndexName(String jiraIndexName)
      Gets the actual index name in OpenSearch for a given Jira index name.
      Parameters:
      jiraIndexName - the logical Jira index name (e.g., "issues")
      Returns:
      the actual OpenSearch index name (e.g., "jira-issues")
    • forceRefreshOnWrite

      boolean forceRefreshOnWrite()
      If enabled OpenSearch index will be refreshed on every write. Otherwise, Jira will apply a more relaxed index consistency: read-your-writes consistency.

      CAUTION: enable this if you are having issues related to delayed consistency, but note that doing so would negatively impact write performance.

      Returns:
      true if force refresh is enabled, otherwise false
    • getMaxResultBuffer

      int getMaxResultBuffer()
      Gets the max result response buffer size
      Returns:
      the configured max result response buffer size
      Since:
      11.3