Package adams.scripting.processor
Interface RemoteCommandProcessor
-
- All Known Implementing Classes:
AbstractRemoteCommandProcessor
,DefaultProcessor
,JsonProcessor
public interface RemoteCommandProcessor
Interface 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 String
format(Properties header, byte[] payload)
Turns the command properties and payload into a single string to send.RemoteCommand
parse(String data, MessageCollection errors)
Instantiates the command from the received data string.RemoteCommand
read(File file, MessageCollection errors)
Reads a remote command from a file.boolean
write(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
-
-