Class AbstractOcpDatabaseController<C extends DatabaseClient<?,?>>
java.lang.Object
io.debezium.testing.system.tools.databases.AbstractOcpDatabaseController<C>
- All Implemented Interfaces:
DatabaseController<C>,PortForwardableDatabaseController
- Direct Known Subclasses:
OcpMongoController,OcpMongoShardedController,OcpSqlDatabaseController
public abstract class AbstractOcpDatabaseController<C extends DatabaseClient<?,?>>
extends Object
implements DatabaseController<C>, PortForwardableDatabaseController
- Author:
- Jakub Cechacek
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.fabric8.kubernetes.api.model.apps.Deploymentprivate static final Stringprivate intprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate static final intprotected Stringprotected final io.fabric8.openshift.client.OpenShiftClientprotected final OpenShiftUtilsprotected io.fabric8.kubernetes.client.PortForwardprotected final Stringprotected List<io.fabric8.kubernetes.api.model.Service> -
Constructor Summary
ConstructorsConstructorDescriptionAbstractOcpDatabaseController(io.fabric8.kubernetes.api.model.apps.Deployment deployment, List<io.fabric8.kubernetes.api.model.Service> services, io.fabric8.openshift.client.OpenShiftClient ocp) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidexecuteCommand(io.fabric8.kubernetes.api.model.apps.Deployment deployment, String... commands) protected voidexecuteInitCommand(io.fabric8.kubernetes.api.model.apps.Deployment deployment, String... commands) voidprivate intintprivate intprivate io.fabric8.kubernetes.client.dsl.PodResource<io.fabric8.kubernetes.api.model.Pod>getPodResource(io.fabric8.kubernetes.api.model.Pod pod) intprivate io.fabric8.kubernetes.api.model.ServicevoidDatabase initialisationprivate io.fabric8.kubernetes.client.dsl.TtyExecErrorChannelable<String,OutputStream, PipedInputStream, io.fabric8.kubernetes.client.dsl.ExecWatch> prepareExec(io.fabric8.kubernetes.api.model.apps.Deployment deployment) voidreload()Reloads the database to initial stateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.testing.system.tools.databases.DatabaseController
getDatabaseClient, getPublicDatabaseUrl
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
FORWARDED_HOST
- See Also:
-
MAX_PORT_SEARCH_ATTEMPTS
private static final int MAX_PORT_SEARCH_ATTEMPTS- See Also:
-
MIN_PORT
private static final int MIN_PORT- See Also:
-
MAX_PORT
private static final int MAX_PORT- See Also:
-
ocp
protected final io.fabric8.openshift.client.OpenShiftClient ocp -
project
-
ocpUtils
-
deployment
protected io.fabric8.kubernetes.api.model.apps.Deployment deployment -
name
-
services
-
portForward
protected io.fabric8.kubernetes.client.PortForward portForward -
localPort
private int localPort
-
-
Constructor Details
-
AbstractOcpDatabaseController
public AbstractOcpDatabaseController(io.fabric8.kubernetes.api.model.apps.Deployment deployment, List<io.fabric8.kubernetes.api.model.Service> services, io.fabric8.openshift.client.OpenShiftClient ocp)
-
-
Method Details
-
getService
private io.fabric8.kubernetes.api.model.Service getService() -
reload
Description copied from interface:DatabaseControllerReloads the database to initial state- Specified by:
reloadin interfaceDatabaseController<C extends DatabaseClient<?,?>> - Throws:
InterruptedException- on timing issue
-
getDatabaseHostname
- Specified by:
getDatabaseHostnamein interfaceDatabaseController<C extends DatabaseClient<?,?>> - Returns:
- available hostname of the database
-
getDatabasePort
public int getDatabasePort()- Specified by:
getDatabasePortin interfaceDatabaseController<C extends DatabaseClient<?,?>> - Returns:
- available port of the database
-
getPublicDatabaseHostname
- Specified by:
getPublicDatabaseHostnamein interfaceDatabaseController<C extends DatabaseClient<?,?>> - Returns:
- publicly available hostname of the database
-
getPublicDatabasePort
public int getPublicDatabasePort()- Specified by:
getPublicDatabasePortin interfaceDatabaseController<C extends DatabaseClient<?,?>> - Returns:
- publicly available port of the database
-
initialize
Description copied from interface:DatabaseControllerDatabase initialisation- Specified by:
initializein interfaceDatabaseController<C extends DatabaseClient<?,?>> - Throws:
InterruptedException- on timing issue
-
forwardDatabasePorts
public void forwardDatabasePorts()- Specified by:
forwardDatabasePortsin interfacePortForwardableDatabaseController
-
closeDatabasePortForwards
- Specified by:
closeDatabasePortForwardsin interfacePortForwardableDatabaseController- Throws:
IOException
-
executeInitCommand
protected void executeInitCommand(io.fabric8.kubernetes.api.model.apps.Deployment deployment, String... commands) throws InterruptedException - Throws:
InterruptedException
-
executeCommand
protected void executeCommand(io.fabric8.kubernetes.api.model.apps.Deployment deployment, String... commands) throws InterruptedException - Throws:
InterruptedException
-
prepareExec
private io.fabric8.kubernetes.client.dsl.TtyExecErrorChannelable<String,OutputStream, prepareExecPipedInputStream, io.fabric8.kubernetes.client.dsl.ExecWatch> (io.fabric8.kubernetes.api.model.apps.Deployment deployment) -
getPodResource
private io.fabric8.kubernetes.client.dsl.PodResource<io.fabric8.kubernetes.api.model.Pod> getPodResource(io.fabric8.kubernetes.api.model.Pod pod) -
getOriginalDatabasePort
private int getOriginalDatabasePort() -
getAvailablePort
- Throws:
IOException
-