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
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default enable value.static final StringOpenSearch configuration. -
Constructor Summary
Constructors -
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.NodeSelectorThe 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.booleanvoidsetDefaultHeaders(org.apache.http.Header[] defaultHeaders) voidsetEnabled(boolean enabled) If OpenSearch integration is enabled.voidsetHttpHosts(org.apache.http.HttpHost[] httpHosts) voidsetNodeSelector(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:RestClientOpenSearchConfigurationThe one or more hosts that the client will communicate with, provided as instances ofHttpHost.- Specified by:
getHttpHostsin 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- TheNodeSelectorto be used, in case of multiple nodes.
-
getNodeSelector
public org.opensearch.client.NodeSelector getNodeSelector()Description copied from interface:RestClientOpenSearchConfigurationThe 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:
getNodeSelectorin interfaceRestClientOpenSearchConfiguration- Returns:
- The
NodeSelectorto be used.
-
getDefaultHeaders
public org.apache.http.Header[] getDefaultHeaders()Description copied from interface:RestClientOpenSearchConfigurationThe default headers that need to be sent with each request, to prevent having to specify them with each single request.- Specified by:
getDefaultHeadersin interfaceRestClientOpenSearchConfiguration- Returns:
- An array of
Header.
-
setDefaultHeaders
public void setDefaultHeaders(org.apache.http.Header[] defaultHeaders) - Parameters:
defaultHeaders- The defaultsHeaderto sent with each request.
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin 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
-