public class MaestroCollector extends AbstractMaestroPeer<MaestroNote>
clientName
Constructor and Description |
---|
MaestroCollector(String url)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addCallback(MaestroNoteCallback callback)
Adds a callback to be executed on note arrival
|
void |
clear()
Clear the collected messages
|
List<MaestroNote> |
collect(Predicate<? super MaestroNote> predicate)
Collect notes matching a given predicate
|
boolean |
isRunning()
Checks the running state of the collector
|
void |
monitor(MaestroMonitor monitor)
Adds a monitor for message arrival
|
protected void |
noteArrived(MaestroNote note)
The entry point for handling Maestro messages
|
void |
remove(MaestroMonitor monitor)
Removes a monitor
|
connect, connectComplete, connectionLost, deliveryComplete, disconnect, getClientName, getId, isConnected, messageArrived, reconnect, setClientName, subscribe, subscribe
public MaestroCollector(String url) throws MaestroConnectionException
url
- the URL to the Maestro brokerMaestroConnectionException
- if unable to connectprotected void noteArrived(MaestroNote note)
AbstractMaestroPeer
noteArrived
in class AbstractMaestroPeer<MaestroNote>
note
- the note that arrivedpublic boolean isRunning()
isRunning
in class AbstractMaestroPeer<MaestroNote>
public void clear()
public List<MaestroNote> collect(Predicate<? super MaestroNote> predicate)
predicate
- the predicate that notes need to match in order to be collectedpublic void addCallback(MaestroNoteCallback callback)
callback
- the callback to executepublic void monitor(MaestroMonitor monitor)
monitor
- the monitor to addpublic void remove(MaestroMonitor monitor)
monitor
- the monitor to removeThis documentation was released into the public domain.