Package io.ebean.test.containers
Class ElasticContainer.Builder
java.lang.Object
io.ebean.test.containers.ElasticContainer.Builder
- All Implemented Interfaces:
ContainerBuilder<ElasticContainer,ElasticContainer.Builder>
- Enclosing class:
ElasticContainer
Builder for ElasticContainer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe internal port.protected intThe exposed port.protected StringContainer name.protected StringDocker command.protected StringThe host name.protected StringImage name.protected intThe internal port.protected intMaximum number of attempts to find the 'database ready to accept connections' log message in the container.protected StringDefine a mirror for images to use with CI builds.protected final StringThe database platform.protected intThe exposed port.protected StopModeBy default, via JVM shutdown hook stop and remove the container unless there is a ~/.ebean/ignore-docker-shutdown marker file.protected StartModeThe mode used when starting (create, dropCreate, container [only]).protected final String -
Method Summary
Modifier and TypeMethodDescriptionadminInternalPort(int adminInternalPort) Set the internal admin (to the container) port.adminPort(int adminPort) Set the exposed admin port.build()Build the container.protected StringOverride to build jdbc url for extraDb.protected Stringprotected StringOverride to build appropriate jdbc url.containerName(String containerName) Set the container name.protected Stringdocker()Set the docker command to use (defaults to 'docker').protected voidextraProperties(Properties properties) Override to configure extra properties.protected StringgetHost()protected intgetPort()Set the docker image to use.protected io.ebean.test.containers.InternalConfigReturn the internal configuration.internalPort(int internalPort) Set the internal (to the container) port.maxReadyAttempts(int maxReadyAttempts) Set the max attempts to wait for DB ready.Set a container mirror for images to use with CI builds.port(int port) Set the exposed port with 0 meaning use a random port.protected intprop(Properties properties, String key, int defaultValue) protected Stringprop(Properties properties, String key, String defaultValue) properties(Properties properties) Load configuration from properties.protected ElasticContainer.Builderself()shutdownMode(StopMode shutdownMode) Set the shutdown hook mode to automatically stop/remove the container on JVM shutdown.start()Build and start the container.Set the start mode.
-
Field Details
-
platform
The database platform.Expected to be one of 'postgres','mysql', 'oracle' or 'sqlserver'.
-
containerName
Container name. -
host
The host name. When running in Docker this is often set to172.17.0.1invalid input: '<'/code. -
port
protected int portThe exposed port. -
internalPort
protected int internalPortThe internal port. -
adminPort
protected int adminPortThe exposed port. -
adminInternalPort
protected int adminInternalPortThe internal port. -
mirror
Define a mirror for images to use with CI builds. -
image
Image name. -
startMode
The mode used when starting (create, dropCreate, container [only]). -
shutdownMode
By default, via JVM shutdown hook stop and remove the container unless there is a ~/.ebean/ignore-docker-shutdown marker file. -
maxReadyAttempts
protected int maxReadyAttemptsMaximum number of attempts to find the 'database ready to accept connections' log message in the container.100 attempts equates to 10 seconds.
-
docker
Docker command. -
version
-
-
Method Details
-
build
Description copied from interface:ContainerBuilderBuild the container. -
start
Description copied from interface:ContainerBuilderBuild and start the container. -
docker
-
getHost
-
getPort
protected int getPort() -
self
-
startMode
Description copied from interface:ContainerBuilderSet the start mode. One of create, dropCreate, or container [only].- Specified by:
startModein interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
shutdownMode
Description copied from interface:ContainerBuilderSet the shutdown hook mode to automatically stop/remove the container on JVM shutdown.- Specified by:
shutdownModein interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
properties
Load configuration from properties.- Specified by:
propertiesin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
extraProperties
Override to configure extra properties. -
prop
-
prop
-
containerName
Set the container name.- Specified by:
containerNamein interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
mirror
Set a container mirror for images to use with CI builds.For example "my.ecr/mirror".
The mirror is not used when deemed to be running locally. Typically determined via a
~/.ebean/ignore-docker-shutdownfile or alternative marker file set via system propertyebean.test.localDevelopment>.- Specified by:
mirrorin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
port
Set the exposed port with 0 meaning use a random port.When the port is set to `0` then docker will assign a random port. This port is available after the container has started.
LocalstackContainer container = LocalstackContainer.builder("0.14") .port(0) .build(); container.start(); int assignedPort = container.port(); AmazonDynamoDB amazonDynamoDB = container.dynamoDB();- Specified by:
portin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
internalPort
Set the internal (to the container) port.- Specified by:
internalPortin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
adminPort
Set the exposed admin port.- Specified by:
adminPortin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
adminInternalPort
Set the internal admin (to the container) port.- Specified by:
adminInternalPortin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
image
Set the docker image to use.- Specified by:
imagein interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
maxReadyAttempts
Set the max attempts to wait for DB ready.- Specified by:
maxReadyAttemptsin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
docker
Set the docker command to use (defaults to 'docker').- Specified by:
dockerin interfaceContainerBuilder<C,SELF extends io.ebean.test.containers.BaseBuilder<C, SELF>>
-
internalConfig
protected io.ebean.test.containers.InternalConfig internalConfig()Return the internal configuration. -
buildJdbcUrl
Override to build appropriate jdbc url. -
buildExtraJdbcUrl
Override to build jdbc url for extraDb. -
buildJdbcAdminUrl
-