@Test public void testUpdateConfig1() throws Exception { ospfProcess = new OspfProcessImpl(); ospfArea = new OspfAreaImpl(); ospfInterface = new OspfInterfaceImpl(); ospfInterfaces = new ArrayList(); ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.5")); ospfInterfaces.add(ospfInterface); ospfArea.setAreaId(Ip4Address.valueOf("2.2.2.2")); ospfArea.setOspfInterfaceList(ospfInterfaces); ospfProcess.setProcessId("10.10.10.10"); ospfAreas = new ArrayList(); ospfAreas.add(ospfArea); ospfProcess.setAreas(ospfAreas); ospfProcesses = new ArrayList(); ospfProcesses.add(ospfProcess); controller.updateConfig(ospfProcesses); assertThat(controller, is(notNullValue())); }
public void updateConfig(List<OspfProcess> ospfProcesses) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[OspfUtil.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; for (OspfProcess ospfProcess : ospfProcesses) { log.debug("OspfProcessDetails : " + ospfProcess); for (OspfArea ospfArea : ospfProcess.areas()) { for (OspfInterface ospfInterface : ospfArea.ospfInterfaceList()) { log.debug("OspfInterfaceDetails : " + ospfInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) ospfInterface.interfaceIndex(); configPacket[(2 * numberOfInterface) + 1] = (byte) 4; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (ospfProcesses.size() > 0) { processes = ospfProcesses; connectPeer(); } } else { ospfChannelHandler.updateInterfaceMap(ospfProcesses); ospfChannelHandler.sentConfigPacket(configPacket); } }
Controller { public void updateConfig(List<OspfProcess> ospfProcesses) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[OspfUtil.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; for (OspfProcess ospfProcess : ospfProcesses) { log.debug("OspfProcessDetails : " + ospfProcess); for (OspfArea ospfArea : ospfProcess.areas()) { for (OspfInterface ospfInterface : ospfArea.ospfInterfaceList()) { log.debug("OspfInterfaceDetails : " + ospfInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) ospfInterface.interfaceIndex(); configPacket[(2 * numberOfInterface) + 1] = (byte) 4; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (ospfProcesses.size() > 0) { processes = ospfProcesses; connectPeer(); } } else { ospfChannelHandler.updateInterfaceMap(ospfProcesses); ospfChannelHandler.sentConfigPacket(configPacket); } } }
Controller { public void updateConfig(List<OspfProcess> ospfProcesses) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[OspfUtil.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; for (OspfProcess ospfProcess : ospfProcesses) { log.debug("OspfProcessDetails : " + ospfProcess); for (OspfArea ospfArea : ospfProcess.areas()) { for (OspfInterface ospfInterface : ospfArea.ospfInterfaceList()) { log.debug("OspfInterfaceDetails : " + ospfInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) ospfInterface.interfaceIndex(); configPacket[(2 * numberOfInterface) + 1] = (byte) 4; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (ospfProcesses.size() > 0) { processes = ospfProcesses; connectPeer(); } } else { ospfChannelHandler.updateInterfaceMap(ospfProcesses); ospfChannelHandler.sentConfigPacket(configPacket); } }  }
Controller { public void updateConfig(List<OspfProcess> ospfProcesses) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[OspfUtil.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; for (OspfProcess ospfProcess : ospfProcesses) { log.debug("OspfProcessDetails : " + ospfProcess); for (OspfArea ospfArea : ospfProcess.areas()) { for (OspfInterface ospfInterface : ospfArea.ospfInterfaceList()) { log.debug("OspfInterfaceDetails : " + ospfInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) ospfInterface.interfaceIndex(); configPacket[(2 * numberOfInterface) + 1] = (byte) 4; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (ospfProcesses.size() > 0) { processes = ospfProcesses; connectPeer(); } } else { ospfChannelHandler.updateInterfaceMap(ospfProcesses); ospfChannelHandler.sentConfigPacket(configPacket); } }  void isisDeactivate(); void updateConfig(List<OspfProcess> ospfProcesses); List<OspfProcess> getAllConfiguredProcesses(); void addDeviceDetails(OspfRouter ospfRouter); void removeDeviceDetails(OspfRouter ospfRouter); void addLinkDetails(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed); void removeLinkDetails(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed); void init(); void start(OspfAgent ag, DriverService driverService); void stop(); void disconnectExecutor(); void connectPeer(); }
Controller { public void updateConfig(List<OspfProcess> ospfProcesses) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[OspfUtil.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; for (OspfProcess ospfProcess : ospfProcesses) { log.debug("OspfProcessDetails : " + ospfProcess); for (OspfArea ospfArea : ospfProcess.areas()) { for (OspfInterface ospfInterface : ospfArea.ospfInterfaceList()) { log.debug("OspfInterfaceDetails : " + ospfInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) ospfInterface.interfaceIndex(); configPacket[(2 * numberOfInterface) + 1] = (byte) 4; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (ospfProcesses.size() > 0) { processes = ospfProcesses; connectPeer(); } } else { ospfChannelHandler.updateInterfaceMap(ospfProcesses); ospfChannelHandler.sentConfigPacket(configPacket); } }  void isisDeactivate(); void updateConfig(List<OspfProcess> ospfProcesses); List<OspfProcess> getAllConfiguredProcesses(); void addDeviceDetails(OspfRouter ospfRouter); void removeDeviceDetails(OspfRouter ospfRouter); void addLinkDetails(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed); void removeLinkDetails(OspfRouter ospfRouter, OspfLinkTed ospfLinkTed); void init(); void start(OspfAgent ag, DriverService driverService); void stop(); void disconnectExecutor(); void connectPeer();  }