Package org.infinispan.server.test.core
Class ContainerInfinispanServerDriver
- java.lang.Object
-
- org.infinispan.server.test.core.AbstractInfinispanServerDriver
-
- org.infinispan.server.test.core.ContainerInfinispanServerDriver
-
- All Implemented Interfaces:
InfinispanServerDriver
public class ContainerInfinispanServerDriver extends AbstractInfinispanServerDriver
- Since:
- 10.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
-
Field Summary
Fields Modifier and Type Field Description static StringIMAGE_USERstatic StringINFINISPAN_SERVER_HOMEstatic StringJDK_BASE_IMAGE_NAMEstatic intJMX_PORT-
Fields inherited from class org.infinispan.server.test.core.AbstractInfinispanServerDriver
BASE_DN, configuration, DEFAULT_CLUSTERED_INFINISPAN_CONFIG_FILE_NAME, KEY_ALGORITHM, KEY_PASSWORD, KEY_SIGNATURE_ALGORITHM, KEYSTORE_TYPE, TEST_HOST_ADDRESS, testHostAddress
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedContainerInfinispanServerDriver(InfinispanServerTestConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InfinispanGenericContainergetContainer(int i)MBeanServerConnectiongetJmxConnection(int server)Returns aMBeanServerConnectionto the specified serverInetAddressgetServerAddress(int server)Returns an InetAddress that points to a specific server.InetSocketAddressgetServerSocket(int server, int port)Returns an InetSocketAddress for connecting to a specific port on a specific server.intgetTimeout()Returns the amount of time in seconds that we should wait for a server start/stop operation.booleanisRunning(int server)Determines whether a specific server is running as part of a server configurationvoidkill(int server)Forcefully stops a server.voidpause(int server)Pauses the server.voidrestart(int server)Restarts a previously stopped server.voidrestartCluster()Restarts all of the nodesvoidresume(int server)Resumes a paused server.protected voidstart(String name, File rootDir, File configurationFile)protected voidstop()voidstop(int server)Gracefully stops a running server-
Methods inherited from class org.infinispan.server.test.core.AbstractInfinispanServerDriver
applyKeyStore, applyKeyStore, applyTrustStore, applyTrustStore, copyArtifactsToUserLibDir, createKeyStores, createRemoteCacheManager, createSelfSignedCertificate, createServerHierarchy, createServerHierarchy, createServerHierarchy, createSignedCertificate, createUserFile, debugJvmOption, dn, getCertificateFile, getConfDir, getConfiguration, getRootDir, getStatus, prepare, start, stop
-
-
-
-
Field Detail
-
INFINISPAN_SERVER_HOME
public static final String INFINISPAN_SERVER_HOME
- See Also:
- Constant Field Values
-
JMX_PORT
public static final int JMX_PORT
- See Also:
- Constant Field Values
-
JDK_BASE_IMAGE_NAME
public static final String JDK_BASE_IMAGE_NAME
- See Also:
- Constant Field Values
-
IMAGE_USER
public static final String IMAGE_USER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContainerInfinispanServerDriver
protected ContainerInfinispanServerDriver(InfinispanServerTestConfiguration configuration)
-
-
Method Detail
-
start
protected void start(String name, File rootDir, File configurationFile)
- Specified by:
startin classAbstractInfinispanServerDriver
-
getContainer
public InfinispanGenericContainer getContainer(int i)
-
stop
protected void stop()
- Specified by:
stopin classAbstractInfinispanServerDriver
-
isRunning
public boolean isRunning(int server)
Description copied from interface:InfinispanServerDriverDetermines whether a specific server is running as part of a server configuration- Parameters:
server- the- Returns:
- true if the server is running, false otherwise
-
getServerSocket
public InetSocketAddress getServerSocket(int server, int port)
Description copied from interface:InfinispanServerDriverReturns an InetSocketAddress for connecting to a specific port on a specific server. The implementation will need to provide a specific mapping (e.g. port offset).- Parameters:
server- the index of the serverport- the service port- Returns:
- an unresolved InetSocketAddress pointing to the actual running service
-
getServerAddress
public InetAddress getServerAddress(int server)
Description copied from interface:InfinispanServerDriverReturns an InetAddress that points to a specific server.- Parameters:
server- the index of the server- Returns:
- an InetAddress pointing to the server's address
-
pause
public void pause(int server)
Description copied from class:AbstractInfinispanServerDriverPauses the server. Equivalent to kill -SIGSTOP- Specified by:
pausein interfaceInfinispanServerDriver- Overrides:
pausein classAbstractInfinispanServerDriver- Parameters:
server- the index of the server
-
resume
public void resume(int server)
Description copied from interface:InfinispanServerDriverResumes a paused server. Equivalent to kill -SIGCONT- Parameters:
server- the index of the server
-
stop
public void stop(int server)
Description copied from interface:InfinispanServerDriverGracefully stops a running server- Parameters:
server- the index of the server
-
kill
public void kill(int server)
Description copied from interface:InfinispanServerDriverForcefully stops a server. Equivalent to kill -SIGKILL- Parameters:
server- the index of the server
-
restart
public void restart(int server)
Description copied from interface:InfinispanServerDriverRestarts a previously stopped server.- Parameters:
server- the index of the server
-
restartCluster
public void restartCluster()
Description copied from interface:InfinispanServerDriverRestarts all of the nodes
-
getJmxConnection
public MBeanServerConnection getJmxConnection(int server)
Description copied from interface:InfinispanServerDriverReturns aMBeanServerConnectionto the specified server- Parameters:
server- the index of the server
-
getTimeout
public int getTimeout()
Description copied from interface:InfinispanServerDriverReturns the amount of time in seconds that we should wait for a server start/stop operation. This may vary depending on the type of driver (embedded, container)- Returns:
- the number of seconds after which a server start/stop is considered to timeout
-
-