Switchboard
Listeners
The Switchboard Listeners are methods that should be declared in the same project in which you create the Switchboard. They listen for events that come from the services.
-
[your program].resultReceived()
Called whenever a result is received from one of the Switchboard services.
-
[your
program].endOfResults() [optional]
Called whenever a result is received from one of the Switchboard services. You don't have to declare
-
[your
program].status() [optional]
Returns status messages from the services so that you can see what is going on behind the scenes, and see when things go wrong.
Variables
These variables are usually used within their corresponding Listeners. They are accessed as members of the Switcboard that you constructed.
-
board.resultService
Always contains the Switchboard.CONSTANT that corresponds to the last service that returned a result.
-
board.doneService
Always contains the Switchboard.CONSTANT that corresponds to the last service that reported that it was done.
-
numReturned
The total number of results returned by doneService
-
board.statusService
Always contains the Switchboard.CONSTANT that corresponds to the last serviec that has returned a status message.
- board.statusMessage
The last returned status message.
Functions
These functions can be called at any time during the life of the Switchboard.
-
board.setProxy(String proxyHost, int proxyPort)
Sets the proxy used for all Switchboard services. Useful when used in conjunction with the proxy() service for services that will ban your IP.
-
board.pause(Switchboard.CONSTANT)
Pauses a service.
-
board.resume(Switchboard.CONSTANT)
Resumes a paused service.
-
board.stop(Switchboard.CONSTANT)
Stops a service.
