Package io.ebean.docker.commands
Class HanaContainer
- java.lang.Object
-
- io.ebean.docker.commands.HanaContainer
-
- All Implemented Interfaces:
Container
public class HanaContainer extends Object implements Container
Commands for controlling a SAP HANA docker container.
-
-
Constructor Summary
Constructors Constructor Description HanaContainer(HanaConfig config)Create with configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerConfigconfig()Returns the container configuration.static HanaContainercreate(String version, Properties properties)Create SAP HANA container with configuration from properties.ConnectioncreateConnection()Create a connection to this database container.booleanisRunning()Return true if the container is running.StringjdbcUrl()Return the JDBC url to connect to this container.voidregisterShutdownHook()Register a JVM Shutdown hook to stop the container with the given mode.booleanstart()Start the container.booleanstartContainerOnly()Start the container only without creating database, user, extensions etc.booleanstartWithCreate()Start the container and wait for it to be ready.booleanstartWithDropCreate()Start with a drop and create of the database and user.voidstop()Stop using the configured stopMode of 'stop' or 'remove'.voidstopOnly()Stop the container only (no remove).voidstopRemove()Stop and remove the container effectively deleting the database.booleanwaitForDatabaseReady()Return true when the DB is ready for taking commands (like create database, user etc).
-
-
-
Constructor Detail
-
HanaContainer
public HanaContainer(HanaConfig config)
Create with configuration.
-
-
Method Detail
-
create
public static HanaContainer create(String version, Properties properties)
Create SAP HANA container with configuration from properties.
-
startWithCreate
public boolean startWithCreate()
Start the container and wait for it to be ready.This checks if the container is already running.
Returns false if the wait for ready was unsuccessful.
-
startWithDropCreate
public boolean startWithDropCreate()
Start with a drop and create of the database and user.
-
jdbcUrl
public String jdbcUrl()
Return the JDBC url to connect to this container.
-
createConnection
public Connection createConnection() throws SQLException
Create a connection to this database container.- Throws:
SQLException
-
start
public boolean start()
Description copied from interface:ContainerStart the container.
-
startContainerOnly
public boolean startContainerOnly()
Start the container only without creating database, user, extensions etc.
-
waitForDatabaseReady
public boolean waitForDatabaseReady()
Return true when the DB is ready for taking commands (like create database, user etc).
-
config
public ContainerConfig config()
Description copied from interface:ContainerReturns the container configuration.
-
isRunning
public boolean isRunning()
Description copied from interface:ContainerReturn true if the container is running.
-
registerShutdownHook
public void registerShutdownHook()
Register a JVM Shutdown hook to stop the container with the given mode.
-
stop
public void stop()
Stop using the configured stopMode of 'stop' or 'remove'.Remove additionally removes the container (expected use in build agents).
-
stopRemove
public void stopRemove()
Stop and remove the container effectively deleting the database.
-
-