public interface UDPAccessor
Allows sending of UDP commands, and adding or removal of UDP command listeners.
Modifier and Type | Method and Description |
---|---|
void |
addUDPCommandListener(String command,
UDPCommandListener udpCommandListener)
Adds the command listener for the specified command.
|
boolean |
removeUDPCommandListener(String command,
UDPCommandListener udpCommandListener)
Removes the command listener for the specified command.
|
void |
send(String commandAndArguments)
Sends the specified command and arguments string to the
default destination.
|
void |
send(String commandAndArguments,
InetAddress address,
int port)
Sends the specified command and arguments string to the
specified address and port.
|
void addUDPCommandListener(String command, UDPCommandListener udpCommandListener)
Adds the command listener for the specified command. The listener will now be informed each time that command is executed.
If a particular listener is added mulitple times for the same command, then it will be informed of a single execution of that command multiple times.
A particular listener can be used to listen to multiple commands. If this is the case, then the listener can identify which command was executed from the first command argument - this is always the name of the command itself.
command
- The command that the listener is being
added for.udpCommandListener
- The listener that should be informed
when the command is executed.boolean removeUDPCommandListener(String command, UDPCommandListener udpCommandListener) throws UDPCommandRemovalException
Removes the command listener for the specified command. If the listener is successfully removed it will no longer be informed whenever that command is executed.
If a listener has been added multiple times for the same command, only the first occurrence will be removed.
command
- The command that the listener is being
added for.udpCommandListener
- The listener that should be informed
when the command is executed.UDPCommandRemovalException
- If the last listener for a
particular command is removed, and the implementation
is unable to find the command to remove.UDPCommandRemovalException
- If either the command or
udpCommandListener arguments are null.void send(String commandAndArguments) throws UDPSendException
Sends the specified command and arguments string to the default destination. The string should begin with the command, with the arguments included afterwards, separated with spaces.
For example:
send("memory_write")
send("symbol_publish LON* NY* JPN*")
commandAndArguments
- The command to send and its arguments,
in a space separated list.UDPSendException
- If the commandAndArguments
argument is null.void send(String commandAndArguments, InetAddress address, int port) throws UDPSendException
Sends the specified command and arguments string to the specified address and port. The string should begin with the command, with the arguments included afterwards, separated with spaces.
For example:
send("memory_write")
send("symbol_publish LON* NY* JPN*")
commandAndArguments
- The command to send and its arguments,
in a space separated list.address
- The address to send the command toport
- The prot to send the command toUDPSendException
- If the commandAndArguments
argument is null.Please send bug reports and comments to Caplin support