use of cern.c2mon.server.common.device.CommandList in project c2mon by c2mon.
the class DeviceClassFacadeImpl method parseXmlCommands.
/**
* Parse the XML representation of the commands of a device class (which comes
* from configuration) and return it as a list of commands.
*
* @param xmlString the XML representation string of the device class commands
*
* @return the list of commands
* @throws Exception if the XML could not be parsed
*/
private List<Command> parseXmlCommands(String xmlString) throws Exception {
List<Command> commands = new ArrayList<>();
Serializer serializer = new Persister();
CommandList commandList = serializer.read(CommandList.class, xmlString);
for (Command command : commandList.getCommands()) {
commands.add(command);
}
return commands;
}
Aggregations