public final class Maestro extends Object implements MaestroRequester
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the container of received messages
|
CompletableFuture<List<? extends MaestroNote>> |
drainRequest(String topic,
String duration,
String url,
int parallelCount)
Issues a drain request
|
static <T> void |
exec(Function<T,CompletableFuture<List<? extends MaestroNote>>> function,
T value) |
static <T> void |
exec(Supplier<CompletableFuture<List<? extends MaestroNote>>> function) |
CompletableFuture<List<? extends MaestroNote>> |
flushRequest()
Sends a flush request
|
CompletableFuture<List<? extends MaestroNote>> |
flushRequest(String topic)
Sends a flush request
|
MaestroCollector |
getCollector()
Get the collector receiving the messages
|
CompletableFuture<List<? extends MaestroNote>> |
getDataServer()
Sends a get request
|
CompletableFuture<List<? extends MaestroNote>> |
halt()
Sends a halt request
|
void |
logRequest(LocationType locationType,
String typeName)
Sends a log request
|
void |
logRequest(String topic,
LocationType locationType,
String typeName)
Sends a log request
|
CompletableFuture<List<? extends MaestroNote>> |
pingRequest()
Sends a ping request
|
CompletableFuture<List<? extends MaestroNote>> |
pingRequest(String topic)
Sends a ping request
|
static <T,U> void |
set(BiFunction<T,U,CompletableFuture<List<? extends MaestroNote>>> function,
T value1,
U value2) |
static <T> void |
set(Function<T,CompletableFuture<List<? extends MaestroNote>>> function,
T value) |
CompletableFuture<List<? extends MaestroNote>> |
setBroker(String value)
Sends a set broker request
|
CompletableFuture<List<? extends MaestroNote>> |
setBroker(String topic,
String value)
Sends a set broker request
|
CompletableFuture<List<? extends MaestroNote>> |
setDuration(Object value)
Sends a set duration request
|
CompletableFuture<List<? extends MaestroNote>> |
setDuration(String topic,
Object value)
Sends a set duration request
|
CompletableFuture<List<? extends MaestroNote>> |
setFCL(int value)
Sends a set fail-condition-latency (FCL) request
|
CompletableFuture<List<? extends MaestroNote>> |
setLogLevel(String value)
Sends a set log level request
|
CompletableFuture<List<? extends MaestroNote>> |
setLogLevel(String topic,
String value)
Sends a set log level request
|
CompletableFuture<List<? extends MaestroNote>> |
setManagementInterface(String value)
Sets the management interface URL
|
CompletableFuture<List<? extends MaestroNote>> |
setMessageSize(long value)
Sends a set message size request (this one can be used for fixed message sizes)
|
CompletableFuture<List<? extends MaestroNote>> |
setMessageSize(String value)
Sends a set message size request (this one can be used for fixed or variable message sizes)
|
CompletableFuture<List<? extends MaestroNote>> |
setParallelCount(int value)
Sends a set parallel count request
|
CompletableFuture<List<? extends MaestroNote>> |
setParallelCount(String topic,
int value)
Sends a set parallel count request
|
CompletableFuture<List<? extends MaestroNote>> |
setRate(int value)
Sends a set rate request
|
CompletableFuture<List<? extends MaestroNote>> |
setRate(String topic,
int value)
Sends a set rate request
|
CompletableFuture<List<? extends MaestroNote>> |
setThrottle(int value)
Sends a set throttle request
|
CompletableFuture<List<? extends MaestroNote>> |
setThrottle(String topic,
int value)
Sends a set throttle request
|
CompletableFuture<List<? extends MaestroNote>> |
sourceRequest(String sourceUrl,
String branch)
Sends a source request to the agent (which causes it to download the given source)
|
CompletableFuture<List<? extends MaestroNote>> |
startAgent()
Sends a start agent request
|
CompletableFuture<List<? extends MaestroNote>> |
startAll(String inspectorName)
Starts all of the receivers, senders and inspectors peers on the test cluster
|
CompletableFuture<List<? extends MaestroNote>> |
startInspector(String value)
Sends a start inspector request
|
CompletableFuture<List<? extends MaestroNote>> |
startReceiver()
Sends a start receiver request
|
CompletableFuture<List<? extends MaestroNote>> |
startSender()
Sends a start sender request
|
CompletableFuture<List<? extends MaestroNote>> |
statsRequest()
Sends a stats request
|
void |
stop()
Stops maestro
|
CompletableFuture<List<? extends MaestroNote>> |
stopAgent()
Sends a stop agent request
|
CompletableFuture<List<? extends MaestroNote>> |
stopAll()
Sends a stop receiver request
|
CompletableFuture<List<? extends MaestroNote>> |
stopInspector()
Sends a stop inspector request
|
CompletableFuture<List<? extends MaestroNote>> |
stopReceiver()
Sends a stop receiver request
|
CompletableFuture<List<? extends MaestroNote>> |
stopSender()
Sends a stop sender request
|
CompletableFuture<List<? extends MaestroNote>> |
userCommand(long option,
String payload)
Sends a user command request
|
CompletableFuture<List<? extends MaestroNote>> |
waitForDrain()
Waits for the drain notifications
|
CompletableFuture<List<? extends MaestroNote>> |
waitForDrain(int expect)
Waits for the drain notifications
|
CompletableFuture<List<? extends MaestroNote>> |
waitForNotifications(int expect)
Waits for notifications
|
public Maestro(String url) throws MaestroException
url
- URL of the maestro brokerMaestroException
- if unable to connect to the maestro brokerpublic void stop() throws MaestroConnectionException
stop
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> flushRequest() throws MaestroConnectionException
flushRequest
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> flushRequest(String topic) throws MaestroConnectionException
flushRequest
in interface MaestroRequester
topic
- the topic to send the request toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> pingRequest() throws MaestroConnectionException
pingRequest
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> pingRequest(String topic) throws MaestroConnectionException
pingRequest
in interface MaestroRequester
topic
- the topic to send the request toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setBroker(String value) throws MaestroConnectionException
setBroker
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setBroker(String topic, String value) throws MaestroConnectionException
setBroker
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setDuration(Object value) throws MaestroException
setDuration
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setDuration(String topic, Object value) throws MaestroException
setDuration
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setLogLevel(String value) throws MaestroConnectionException
setLogLevel
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setLogLevel(String topic, String value) throws MaestroConnectionException
setLogLevel
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setParallelCount(int value) throws MaestroConnectionException
setParallelCount
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setParallelCount(String topic, int value) throws MaestroConnectionException
setParallelCount
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setMessageSize(String value) throws MaestroConnectionException
setMessageSize
in interface MaestroRequester
value
- the value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setMessageSize(long value) throws MaestroConnectionException
setMessageSize
in interface MaestroRequester
value
- the value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setThrottle(int value) throws MaestroConnectionException
setThrottle
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setThrottle(String topic, int value) throws MaestroConnectionException
setThrottle
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setRate(int value) throws MaestroConnectionException
setRate
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setRate(String topic, int value) throws MaestroConnectionException
setRate
in interface MaestroRequester
topic
- the topic to send the request tovalue
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setFCL(int value) throws MaestroConnectionException
setFCL
in interface MaestroRequester
value
- The value to set the (remote) parameter toMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> setManagementInterface(String value) throws MaestroException
value
- The management interface URLMaestroException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> startInspector(String value) throws MaestroConnectionException
startInspector
in interface MaestroRequester
value
- The name of the inspector to start. The URL is set via setManagementInterface
commandMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> stopInspector() throws MaestroConnectionException
stopInspector
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> startSender() throws MaestroConnectionException
startSender
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> stopSender() throws MaestroConnectionException
stopSender
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> startReceiver() throws MaestroConnectionException
startReceiver
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> stopReceiver() throws MaestroConnectionException
stopReceiver
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> stopAll() throws MaestroConnectionException
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> startAll(String inspectorName) throws MaestroConnectionException
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> statsRequest() throws MaestroConnectionException
statsRequest
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> halt() throws MaestroConnectionException
halt
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> getDataServer() throws MaestroConnectionException
getDataServer
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> startAgent() throws MaestroConnectionException
startAgent
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> stopAgent() throws MaestroConnectionException
stopAgent
in interface MaestroRequester
MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> userCommand(long option, String payload) throws MaestroConnectionException
userCommand
in interface MaestroRequester
option
- An optional numeric option that can be associated w/ the commandpayload
- An option string payload to be sent along w/ the commandMaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> sourceRequest(String sourceUrl, String branch) throws MaestroConnectionException
sourceUrl
- the source url (ie.: git://host/path/to/extension-endpoint.git)branch
- branch to use for the source URLMaestroConnectionException
- if unable to send the MQTT requestpublic void logRequest(LocationType locationType, String typeName) throws MaestroConnectionException
locationType
- The location typetypeName
- The optional type name (mandatory if the location type is ANY)MaestroConnectionException
- if unable to send the MQTT requestpublic void logRequest(String topic, LocationType locationType, String typeName) throws MaestroConnectionException
topic
- the topic to send the request tolocationType
- The location typetypeName
- The optional type name (mandatory if the location type is ANY)MaestroConnectionException
- if unable to send the MQTT requestpublic CompletableFuture<List<? extends MaestroNote>> drainRequest(String topic, String duration, String url, int parallelCount)
topic
- the topic to send the request toduration
- duration of the drainurl
- URL to drainparallelCount
- parallel countpublic void clear()
public MaestroCollector getCollector()
public CompletableFuture<List<? extends MaestroNote>> waitForDrain(int expect)
expect
- Number of retries before considering stale (every retry == 1 second of wait)public CompletableFuture<List<? extends MaestroNote>> waitForDrain()
public CompletableFuture<List<? extends MaestroNote>> waitForNotifications(int expect)
expect
- how many notifications to expectpublic static <T> void set(Function<T,CompletableFuture<List<? extends MaestroNote>>> function, T value)
public static <T,U> void set(BiFunction<T,U,CompletableFuture<List<? extends MaestroNote>>> function, T value1, U value2)
public static <T> void exec(Supplier<CompletableFuture<List<? extends MaestroNote>>> function)
public static <T> void exec(Function<T,CompletableFuture<List<? extends MaestroNote>>> function, T value)
This documentation was released into the public domain.