/** * Parses logical routers data from message and puts it into routerModel. * * @param routerModel to store parsed data * @param message to parse logical routers data from * @return routerModel updated with logical routers information from message. * @throws IOException * @throws SAXException */ private System parseLRs(System routerModel, String message) throws IOException, SAXException { // remove LR from the model before parsing new configuration routerModel.removeAllremoveManagedSystemElementByType(ComputerSystem.class); DigesterEngine listLogicalRoutersParser = new ListLogicalRoutersParser(); listLogicalRoutersParser.init(); listLogicalRoutersParser.configurableParse(new ByteArrayInputStream(message.getBytes())); // put new LR in the model for (String key : listLogicalRoutersParser.getMapElements().keySet()) { ComputerSystem system = new ComputerSystem(); system.setName((String) listLogicalRoutersParser.getMapElements().get(key)); routerModel.addManagedSystemElement(system); } return routerModel; }
public static ComputerSystem newParamsLRWithInterface(String lrName) { ComputerSystem lrModel = new ComputerSystem(); lrModel.setName(lrName); lrModel.setElementName(lrName); return lrModel; }
public static ComputerSystem getLogicalRouter(String lrName) { ComputerSystem lrModel = new ComputerSystem(); lrModel.setName(lrName); lrModel.setElementName(lrName); return lrModel; }