public class StreamUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TMP_DIR |
Constructor and Description |
---|
StreamUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
destroyAllStreams(java.net.URL adminServer)
Removes all the streams from the cluster.
|
static java.lang.String |
httpGet(java.net.URL url)
Executes a http get for the client and returns the results as a string
|
static boolean |
isStreamDeployed(java.lang.String streamName,
java.net.URL adminServer)
Checks to see if the specified stream is deployed on the XD cluster.
|
static java.net.URL |
replacePort(java.net.URL url,
int port)
Substitutes the port associated with the URL with another port.
|
static void |
stream(java.lang.String streamName,
java.lang.String streamDefinition,
java.net.URL adminServer)
Creates the stream definition and deploys it to the cluster being tested.
|
static java.lang.String |
transferResultsToLocal(XdEnvironment xdEnvironment,
java.net.URL url,
java.lang.String fileName)
Copies the specified file from a remote machine to local machine.
|
static void |
undeployStream(java.net.URL adminServer,
java.lang.String streamName)
Undeploys the specified stream name
|
static boolean |
waitForStreamDeployment(java.lang.String streamName,
java.net.URL adminServer,
int waitTime)
Waits up to the wait time for a stream to be deployed.
|
public static final java.lang.String TMP_DIR
public static void stream(java.lang.String streamName, java.lang.String streamDefinition, java.net.URL adminServer)
streamName
- The name of the streamstreamDefinition
- The definition that needs to be deployed for this stream.adminServer
- The admin server that this stream will be deployed against.public static java.lang.String httpGet(java.net.URL url)
url
- The location to execute the get against.public static void destroyAllStreams(java.net.URL adminServer)
adminServer
- The admin server that the command will be executed against.public static void undeployStream(java.net.URL adminServer, java.lang.String streamName)
adminServer
- The admin server that the command will be executed against.streamName
- The name of the stream to undeploypublic static java.lang.String transferResultsToLocal(XdEnvironment xdEnvironment, java.net.URL url, java.lang.String fileName)
xdEnvironment
- The environment configuration for this testurl
- The remote machine's url.fileName
- The fully qualified file name of the file to be transferred.public static java.net.URL replacePort(java.net.URL url, int port)
url
- The URL that needs a port replaced.port
- The new port numberpublic static boolean waitForStreamDeployment(java.lang.String streamName, java.net.URL adminServer, int waitTime)
streamName
- The name of the stream to be evaluated.adminServer
- The admin server URL that will be queried.waitTime
- the amount of time in millis to wait.public static boolean isStreamDeployed(java.lang.String streamName, java.net.URL adminServer)
streamName
- The name of the stream to be evaluated.adminServer
- The admin server URL that will be queried.