Class EmbeddedInfinispanServerDriver
java.lang.Object
org.infinispan.server.test.core.AbstractInfinispanServerDriver
org.infinispan.server.test.core.EmbeddedInfinispanServerDriver
- All Implemented Interfaces:
InfinispanServerDriver
- Since:
- 10.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
Field Summary
FieldsFields inherited from class org.infinispan.server.test.core.AbstractInfinispanServerDriver
BASE_DN, configuration, DEFAULT_CLUSTERED_INFINISPAN_CONFIG_FILE_NAME, JMX_PORT, JOIN_TIMEOUT, KEY_ALGORITHM, KEY_PASSWORD, KEY_SIGNATURE_ALGORITHM, TEST_HOST_ADDRESS, testHostAddressFields inherited from interface org.infinispan.server.test.core.InfinispanServerDriver
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmbeddedInfinispanServerDriver(InfinispanServerTestConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareCacheViewsComplete(List<org.infinispan.manager.EmbeddedCacheManager> cacheManagers, boolean fail) protected intgetJmxConnection(int server, String username, String password, Consumer<Closeable> reaper) Returns aMBeanServerConnectionto the specified servergetServerAddress(int serverIndex) Returns an InetAddress that points to a specific server.getServerSocket(int serverIndex, int port) Returns an InetSocketAddress for connecting to a specific port on a specific server.intReturns the amount of time in seconds that we should wait for a server start/stop operation.booleanisRunning(int serverIndex) Determines whether a specific server is running as part of a server configurationvoidkill(int serverIndex) Forcefully stops a server.voidpause(int serverIndex) Pauses the server.voidrestart(int serverIndex) Restarts a previously stopped server.voidRestarts all of the nodesvoidresume(int serverIndex) Resumes a paused server.protected voidprotected voidstop()voidstop(int serverIndex) Gracefully stops a running serversyncFilesFromServer(int server, String dir) Synchronizes files from the server to the local filesystemsyncFilesToServer(int server, String path) Methods inherited from class org.infinispan.server.test.core.AbstractInfinispanServerDriver
abbreviate, applyKeyStore, applyKeyStore, applyKeyStore, applyKeyStore, applyTrustStore, applyTrustStore, applyTrustStore, applyTrustStore, applyTrustStore, applyTrustStore, copyArtifactsToDataDir, copyArtifactsToUserLibDir, createCertificate, createKeyStores, createRemoteCacheManager, createServerHierarchy, createServerHierarchy, createSignedCertificate, createUserFile, debugJvmOption, dn, getCertificateFile, getConfDir, getConfiguration, getName, getRootDir, getStatus, prepare, serverRoot, start, stop, writeKeyStore
-
Field Details
-
OFFSET_FACTOR
public static final int OFFSET_FACTOR- See Also:
-
-
Constructor Details
-
EmbeddedInfinispanServerDriver
-
-
Method Details
-
clusterPortOffset
protected int clusterPortOffset() -
start
- Specified by:
startin classAbstractInfinispanServerDriver
-
stop
protected void stop()- Specified by:
stopin classAbstractInfinispanServerDriver
-
getServerSocket
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:
serverIndex- the index of the serverport- the service port- Returns:
- an unresolved InetSocketAddress pointing to the actual running service
-
getServerAddress
Description copied from interface:InfinispanServerDriverReturns an InetAddress that points to a specific server.- Parameters:
serverIndex- the index of the server- Returns:
- an InetAddress pointing to the server's address
-
pause
public void pause(int serverIndex) Description copied from class:AbstractInfinispanServerDriverPauses the server. Equivalent to kill -SIGSTOP- Specified by:
pausein interfaceInfinispanServerDriver- Overrides:
pausein classAbstractInfinispanServerDriver- Parameters:
serverIndex- the index of the server
-
resume
public void resume(int serverIndex) Description copied from interface:InfinispanServerDriverResumes a paused server. Equivalent to kill -SIGCONT- Parameters:
serverIndex- the index of the server
-
stop
public void stop(int serverIndex) Description copied from interface:InfinispanServerDriverGracefully stops a running server- Parameters:
serverIndex- the index of the server
-
kill
public void kill(int serverIndex) Description copied from interface:InfinispanServerDriverForcefully stops a server. Equivalent to kill -SIGKILL- Parameters:
serverIndex- the index of the server
-
restart
public void restart(int serverIndex) Description copied from interface:InfinispanServerDriverRestarts a previously stopped server.- Parameters:
serverIndex- the index of the server
-
restartCluster
public void restartCluster()Description copied from interface:InfinispanServerDriverRestarts all of the nodes -
isRunning
public boolean isRunning(int serverIndex) Description copied from interface:InfinispanServerDriverDetermines whether a specific server is running as part of a server configuration- Parameters:
serverIndex- the- Returns:
- true if the server is running, false otherwise
-
getJmxConnection
public MBeanServerConnection getJmxConnection(int server, String username, String password, Consumer<Closeable> reaper) 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
-
areCacheViewsComplete
public static boolean areCacheViewsComplete(List<org.infinispan.manager.EmbeddedCacheManager> cacheManagers, boolean fail) -
syncFilesFromServer
Description copied from interface:InfinispanServerDriverSynchronizes files from the server to the local filesystem- Parameters:
server- the serverdir- if relative, the path relative to the server root, otherwise an absolute path- Returns:
- the path where the data has been synced to
-
syncFilesToServer
-