public class DeploymentVerifier
extends java.lang.Object
wait...
methods block for a specified
amount of time and throw RuntimeTimeoutException
if the
expected path is not present (in the case of create/deploy) or
is still present (in the case of undeploy/destroy) in the
time allotted. Deployment paths are determined by the
DeploymentPathProvider
passed into the constructor.Constructor and Description |
---|
DeploymentVerifier(ZooKeeperConnection zkConnection,
DeploymentPathProvider provider)
Construct a
DeploymentVerifier using the default timeout indicated
by DEFAULT_TIMEOUT . |
DeploymentVerifier(ZooKeeperConnection zkConnection,
DeploymentPathProvider provider,
int verifyTimeout)
Construct a
DeploymentVerifier using the provided timeout. |
Modifier and Type | Method and Description |
---|---|
protected ZooKeeperConnection |
getZooKeeperConnection()
Return the ZooKeeper connection.
|
void |
waitForCreate(java.lang.String name)
Block the executing thread until the named deployment definition
has been created.
|
void |
waitForDeploy(java.lang.String name)
Block the executing thread until the named deployment has been deployed.
|
void |
waitForDestroy(java.lang.String name)
Block the executing thread until the named deployment definition
has been destroyed.
|
void |
waitForUndeploy(java.lang.String name)
Block the executing thread until the named deployment has been undeployed.
|
public DeploymentVerifier(ZooKeeperConnection zkConnection, DeploymentPathProvider provider)
DeploymentVerifier
using the default timeout indicated
by DEFAULT_TIMEOUT
.zkConnection
- ZooKeeper connectionprovider
- definition/deployment path providerpublic DeploymentVerifier(ZooKeeperConnection zkConnection, DeploymentPathProvider provider, int verifyTimeout)
DeploymentVerifier
using the provided timeout.zkConnection
- ZooKeeper connectionprovider
- definition/deployment path providerverifyTimeout
- timeout value in millisecondsprotected ZooKeeperConnection getZooKeeperConnection()
public void waitForCreate(java.lang.String name) throws RuntimeTimeoutException
name
- deployment nameRuntimeTimeoutException
- if the definition isn't created in the
allotted timepublic void waitForDestroy(java.lang.String name) throws RuntimeTimeoutException
name
- deployment nameRuntimeTimeoutException
- if the definition isn't destroyed in the
allotted timepublic void waitForDeploy(java.lang.String name) throws RuntimeTimeoutException
name
- deployment nameRuntimeTimeoutException
- if the deployment isn't deployed in the
allotted timepublic void waitForUndeploy(java.lang.String name) throws RuntimeTimeoutException
name
- deployment nameRuntimeTimeoutException
- if the deployment isn't undeployed in the
allotted time