Class RestClientOpenSearchConfigurationProperties
java.lang.Object
io.micronaut.opensearch.restclient.conf.RestClientOpenSearchConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
,RestClientOpenSearchConfiguration
@ConfigurationProperties("micronaut.opensearch.rest-client")
@Internal
public final class RestClientOpenSearchConfigurationProperties
extends Object
implements RestClientOpenSearchConfiguration
ConfigurationProperties
implementation of RestClientOpenSearchConfiguration
.- Since:
- 1.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default enable value.static final String
OpenSearch configuration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.Header[]
The default headers that need to be sent with each request, to prevent having to specify them with each single request.org.apache.http.HttpHost[]
The one or more hosts that the client will communicate with, provided as instances ofHttpHost
.org.opensearch.client.NodeSelector
The node selector to be used to filter the nodes the client will send requests to among the ones that are set to the client itself.boolean
void
setDefaultHeaders
(org.apache.http.Header[] defaultHeaders) void
setEnabled
(boolean enabled) If OpenSearch integration is enabled.void
setHttpHosts
(org.apache.http.HttpHost[] httpHosts) void
setNodeSelector
(org.opensearch.client.NodeSelector nodeSelector)
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
PREFIX
OpenSearch configuration.- See Also:
-
-
Constructor Details
-
RestClientOpenSearchConfigurationProperties
public RestClientOpenSearchConfigurationProperties()
-
-
Method Details
-
getHttpHosts
public org.apache.http.HttpHost[] getHttpHosts()Description copied from interface:RestClientOpenSearchConfiguration
The one or more hosts that the client will communicate with, provided as instances ofHttpHost
.- Specified by:
getHttpHosts
in interfaceRestClientOpenSearchConfiguration
- Returns:
- An array of
HttpHost
-
setHttpHosts
public void setHttpHosts(org.apache.http.HttpHost[] httpHosts) - Parameters:
httpHosts
- One or more hosts that client will connect to.
-
setNodeSelector
public void setNodeSelector(org.opensearch.client.NodeSelector nodeSelector) - Parameters:
nodeSelector
- TheNodeSelector
to be used, in case of multiple nodes.
-
getNodeSelector
public org.opensearch.client.NodeSelector getNodeSelector()Description copied from interface:RestClientOpenSearchConfiguration
The node selector to be used to filter the nodes the client will send requests to among the ones that are set to the client itself. By default, the client sends requests to every configured node.- Specified by:
getNodeSelector
in interfaceRestClientOpenSearchConfiguration
- Returns:
- The
NodeSelector
to be used.
-
getDefaultHeaders
public org.apache.http.Header[] getDefaultHeaders()Description copied from interface:RestClientOpenSearchConfiguration
The default headers that need to be sent with each request, to prevent having to specify them with each single request.- Specified by:
getDefaultHeaders
in interfaceRestClientOpenSearchConfiguration
- Returns:
- An array of
Header
.
-
setDefaultHeaders
public void setDefaultHeaders(org.apache.http.Header[] defaultHeaders) - Parameters:
defaultHeaders
- The defaultsHeader
to sent with each request.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) If OpenSearch integration is enabled. Default value true- Parameters:
enabled
- True if security is enabled
-