Class OpenSearchConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<OpenSearchConfig.Builder>
io.floci.testcontainers.config.services.OpenSearchConfig
Configuration for OpenSearch-specific container settings.
Instances are created via OpenSearchConfig.Builder:
OpenSearchConfig config = OpenSearchConfig.builder()
.enabled(true)
.mock(true)
.proxyPortRange(9400, 100)
.build();
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
DEFAULT_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.static OpenSearchConfig.Builderbuilder()Returns a newOpenSearchConfig.Builderfor this configuration.Returns the default Docker image used for OpenSearch instances, ornullif not set.Returns the Docker network used for OpenSearch containers, ornullif not set.intReturns the base port for the OpenSearch proxy port range.intReturns the maximum port for the OpenSearch proxy port range.intReturns the number of ports allocated for the OpenSearch proxy, starting fromgetProxyBasePort().booleanisMock()Returns whether domains are simulated in-memory without real Docker containers.Returns a newOpenSearchConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
applyExposedPortsToContainer, isEnabled
-
Method Details
-
builder
Returns a newOpenSearchConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newOpenSearchConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<OpenSearchConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
isMock
public boolean isMock()Returns whether domains are simulated in-memory without real Docker containers.- Returns:
trueif mock mode is enabled
-
getDefaultImage
Returns the default Docker image used for OpenSearch instances, ornullif not set.- Returns:
- the image name, or
null
-
getProxyBasePort
public int getProxyBasePort()Returns the base port for the OpenSearch proxy port range.- Returns:
- the base port
-
getProxyPortsCount
public int getProxyPortsCount()Returns the number of ports allocated for the OpenSearch proxy, starting fromgetProxyBasePort().- Returns:
- the number of proxy ports
-
getProxyMaxPort
public int getProxyMaxPort()Returns the maximum port for the OpenSearch proxy port range.- Returns:
- the maximum port
-
getDockerNetwork
Returns the Docker network used for OpenSearch containers, ornullif not set.- Returns:
- the Docker network name, or
null
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by setting the appropriate environment variables.- Overrides:
applyEnvVarsToContainerin classAbstractServiceConfig<OpenSearchConfig.Builder>- Parameters:
container- the container to configure
-