Class AbstractServiceConfig<B extends AbstractServiceConfigBuilder<B,?>>
java.lang.Object
io.floci.testcontainers.config.services.AbstractServiceConfig<B>
- Type Parameters:
B- the concreteAbstractServiceConfigBuildersubtype used to build and rebuild this configuration, allowingtoBuilder()to be implemented in a type-safe way by subclasses
- Direct Known Subclasses:
AcmConfig,AmazonMqConfig,ApiGatewayConfig,ApiGatewayV2Config,AppConfigConfig,AppConfigDataConfig,AppSyncConfig,AthenaConfig,BackupConfig,BatchConfig,BcmDataExportsConfig,BedrockRuntimeConfig,CloudControlConfig,CloudFormationConfig,CloudFrontConfig,CloudMapConfig,CloudTrailConfig,CloudWatchLogsConfig,CloudWatchMetricsConfig,CodeBuildConfig,CodeDeployConfig,CodePipelineConfig,CognitoConfig,ConfigServiceConfig,CostExplorerConfig,CurConfig,DocumentDbConfig,DynamoDbConfig,Ec2Config,EcrConfig,EcsConfig,EksConfig,ElastiCacheConfig,ElasticBeanstalkConfig,ElbV2Config,EmrConfig,EventBridgeConfig,FirehoseConfig,GlueConfig,IamConfig,IotConfig,IotDataConfig,KinesisConfig,KmsConfig,LambdaConfig,LightsailConfig,MemoryDbConfig,MskConfig,NeptuneConfig,OpenSearchConfig,PipesConfig,PricingConfig,RdsConfig,RdsDataConfig,ResourceGroupsTaggingConfig,Route53Config,S3Config,S3VectorsConfig,SchedulerConfig,SecretsManagerConfig,SesConfig,SnsConfig,SqsConfig,SsmConfig,StepFunctionsConfig,TextractConfig,TransferFamilyConfig,WafV2Config
public abstract class AbstractServiceConfig<B extends AbstractServiceConfigBuilder<B,?>>
extends Object
Base class for Floci service configurations.
Every service configuration supports an isEnabled() flag and can apply its
settings to a container via applyEnvVarsToContainer(Container).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final booleanDefault value for theisEnabled()flag. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractServiceConfig(boolean enabled) Creates a new service configuration with the given enabled flag. -
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.booleanReturns whether this service is enabled.abstract BReturns a new builder for this configuration, initialized with the current values of this instance.
-
Field Details
-
DEFAULT_ENABLED
protected static final boolean DEFAULT_ENABLEDDefault value for theisEnabled()flag.- See Also:
-
-
Constructor Details
-
AbstractServiceConfig
protected AbstractServiceConfig(boolean enabled) Creates a new service configuration with the given enabled flag.- Parameters:
enabled-trueto enable the service
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns whether this service is enabled.- Returns:
trueif this service is enabled
-
toBuilder
Returns a new builder for this configuration, initialized with the current values of this instance. Every subclass must implement this to return its ownBuildertype, pre-populated via the builder's copy constructor.- Returns:
- a new builder pre-populated with this configuration's values
-
applyEnvVarsToContainer
public void applyEnvVarsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by setting the appropriate environment variables.- Parameters:
container- the container to configure
-
applyExposedPortsToContainer
public void applyExposedPortsToContainer(org.testcontainers.containers.Container<?> container) Applies this service configuration to the given container by exposing the appropriate ports.- Parameters:
container- the container to configure
-