Class ElastiCacheConfig
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<ElastiCacheConfig.Builder>
io.floci.testcontainers.config.services.ElastiCacheConfig
Configuration for ElastiCache-specific container settings.
Instances are created via ElastiCacheConfig.Builder:
ElastiCacheConfig config = ElastiCacheConfig.builder()
.enabled(true)
.proxyPortRange(6379, 20)
.defaultImage("valkey/valkey:8")
.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.voidapplyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.static ElastiCacheConfig.Builderbuilder()Returns a newElastiCacheConfig.Builderfor this configuration.Returns the default Docker image used for ElastiCache (Valkey) instances.Returns the default Docker image used for Memcached instances.Returns the Docker network used for ElastiCache containers, ornullif not set.intReturns the base port for the ElastiCache proxy port range.intReturns the maximum port for the ElastiCache proxy port range.intReturns the number of ports allocated for the ElastiCache proxy, starting fromgetProxyBasePort().Returns a newElastiCacheConfig.Builderfor this configuration, initialized with the current values of this instance.Methods inherited from class io.floci.testcontainers.config.services.AbstractServiceConfig
isEnabled
-
Method Details
-
builder
Returns a newElastiCacheConfig.Builderfor this configuration.- Returns:
- a new builder
-
toBuilder
Returns a newElastiCacheConfig.Builderfor this configuration, initialized with the current values of this instance.- Specified by:
toBuilderin classAbstractServiceConfig<ElastiCacheConfig.Builder>- Returns:
- a new builder pre-populated with this configuration's values
-
getProxyBasePort
public int getProxyBasePort()Returns the base port for the ElastiCache proxy port range.- Returns:
- the base port
-
getProxyPortsCount
public int getProxyPortsCount()Returns the number of ports allocated for the ElastiCache proxy, starting fromgetProxyBasePort().- Returns:
- the number of proxy ports
-
getProxyMaxPort
public int getProxyMaxPort()Returns the maximum port for the ElastiCache proxy port range.- Returns:
- the maximum port
-
getDefaultImage
Returns the default Docker image used for ElastiCache (Valkey) instances.- Returns:
- the image name
-
getDefaultMemcachedImage
Returns the default Docker image used for Memcached instances.- Returns:
- the Memcached image name (default "memcached:1.6")
-
getDockerNetwork
Returns the Docker network used for ElastiCache 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<ElastiCacheConfig.Builder>- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Description copied from class:AbstractServiceConfigApplies this service configuration to the given container by exposing the appropriate ports.- Overrides:
applyExposedPortsToContainerin classAbstractServiceConfig<ElastiCacheConfig.Builder>- Parameters:
container- the container to configure
-