Package adams.scripting.processor
Interface RemoteCommandProcessor
-
- All Known Implementing Classes:
AbstractRemoteCommandProcessor,DefaultProcessor,JsonProcessor
public interface RemoteCommandProcessorInterface for command processors, classes that parse and format commands.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringformat(Properties header, byte[] payload)Turns the command properties and payload into a single string to send.RemoteCommandparse(String data, MessageCollection errors)Instantiates the command from the received data string.RemoteCommandread(File file, MessageCollection errors)Reads a remote command from a file.booleanwrite(RemoteCommand cmd, File file, MessageCollection errors)Writes a remote command to a file.
-
-
-
Method Detail
-
parse
RemoteCommand parse(String data, MessageCollection errors)
Instantiates the command from the received data string.- Parameters:
data- the data string to parseerrors- for collecting errors- Returns:
- the instantiated command, null if failed to parse
-
format
String format(Properties header, byte[] payload)
Turns the command properties and payload into a single string to send.- Parameters:
header- the header datapayload- the payload- Returns:
- the assembled string
-
read
RemoteCommand read(File file, MessageCollection errors)
Reads a remote command from a file.- Parameters:
file- the file to readerrors- for collecting errors- Returns:
- the remote command, null if failed to load
-
write
boolean write(RemoteCommand cmd, File file, MessageCollection errors)
Writes a remote command to a file.- Parameters:
cmd- the command to writefile- the file to write toerrors- for collecting errors- Returns:
- true if successful
-
-