Class ElastiCacheConfig


public class ElastiCacheConfig extends AbstractServiceConfig<ElastiCacheConfig.Builder>
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();
 
  • Method Details

    • builder

      public static ElastiCacheConfig.Builder builder()
      Returns a new ElastiCacheConfig.Builder for this configuration.
      Returns:
      a new builder
    • toBuilder

      public ElastiCacheConfig.Builder toBuilder()
      Returns a new ElastiCacheConfig.Builder for this configuration, initialized with the current values of this instance.
      Specified by:
      toBuilder in class AbstractServiceConfig<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 from getProxyBasePort().
      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

      public String getDefaultImage()
      Returns the default Docker image used for ElastiCache (Valkey) instances.
      Returns:
      the image name
    • getDefaultMemcachedImage

      public String getDefaultMemcachedImage()
      Returns the default Docker image used for Memcached instances.
      Returns:
      the Memcached image name (default "memcached:1.6")
    • getDockerNetwork

      public String getDockerNetwork()
      Returns the Docker network used for ElastiCache containers, or null if not set.
      Returns:
      the Docker network name, or null
    • applyEnvVarsToContainer

      public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by setting the appropriate environment variables.
      Overrides:
      applyEnvVarsToContainer in class AbstractServiceConfig<ElastiCacheConfig.Builder>
      Parameters:
      container - the container to configure
    • applyExposedPortsToContainer

      public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container)
      Description copied from class: AbstractServiceConfig
      Applies this service configuration to the given container by exposing the appropriate ports.
      Overrides:
      applyExposedPortsToContainer in class AbstractServiceConfig<ElastiCacheConfig.Builder>
      Parameters:
      container - the container to configure