@Test public void testUpdateConfig() throws Exception { jsonNode.path("interface"); controller.updateConfig(jsonNode); assertThat(controller, is(notNullValue())); controller.updateConfig(jsonNode1); assertThat(controller, is(notNullValue())); }
public void updateConfig(JsonNode jsonNode) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[IsisConstants.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; List<IsisProcess> isisProcesses = getConfig(jsonNode); for (IsisProcess isisProcess : isisProcesses) { log.debug("IsisProcessDetails : " + isisProcess); for (IsisInterface isisInterface : isisProcess.isisInterfaceList()) { DefaultIsisInterface isisInterfaceImpl = (DefaultIsisInterface) isisInterface; log.debug("IsisInterfaceDetails : " + isisInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) isisInterfaceImpl.interfaceIndex(); if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 0; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 1; } else if (isisInterface.networkType() == IsisNetworkType.P2P) { configPacket[(2 * numberOfInterface) + 1] = (byte) 2; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 3; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (isisProcesses.size() > 0) { processes = isisProcesses; connectPeer(); } } else { isisChannelHandler.updateInterfaceMap(isisProcesses); isisChannelHandler.sentConfigPacket(configPacket); } }
Controller { public void updateConfig(JsonNode jsonNode) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[IsisConstants.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; List<IsisProcess> isisProcesses = getConfig(jsonNode); for (IsisProcess isisProcess : isisProcesses) { log.debug("IsisProcessDetails : " + isisProcess); for (IsisInterface isisInterface : isisProcess.isisInterfaceList()) { DefaultIsisInterface isisInterfaceImpl = (DefaultIsisInterface) isisInterface; log.debug("IsisInterfaceDetails : " + isisInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) isisInterfaceImpl.interfaceIndex(); if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 0; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 1; } else if (isisInterface.networkType() == IsisNetworkType.P2P) { configPacket[(2 * numberOfInterface) + 1] = (byte) 2; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 3; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (isisProcesses.size() > 0) { processes = isisProcesses; connectPeer(); } } else { isisChannelHandler.updateInterfaceMap(isisProcesses); isisChannelHandler.sentConfigPacket(configPacket); } } }
Controller { public void updateConfig(JsonNode jsonNode) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[IsisConstants.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; List<IsisProcess> isisProcesses = getConfig(jsonNode); for (IsisProcess isisProcess : isisProcesses) { log.debug("IsisProcessDetails : " + isisProcess); for (IsisInterface isisInterface : isisProcess.isisInterfaceList()) { DefaultIsisInterface isisInterfaceImpl = (DefaultIsisInterface) isisInterface; log.debug("IsisInterfaceDetails : " + isisInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) isisInterfaceImpl.interfaceIndex(); if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 0; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 1; } else if (isisInterface.networkType() == IsisNetworkType.P2P) { configPacket[(2 * numberOfInterface) + 1] = (byte) 2; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 3; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (isisProcesses.size() > 0) { processes = isisProcesses; connectPeer(); } } else { isisChannelHandler.updateInterfaceMap(isisProcesses); isisChannelHandler.sentConfigPacket(configPacket); } }  }
Controller { public void updateConfig(JsonNode jsonNode) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[IsisConstants.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; List<IsisProcess> isisProcesses = getConfig(jsonNode); for (IsisProcess isisProcess : isisProcesses) { log.debug("IsisProcessDetails : " + isisProcess); for (IsisInterface isisInterface : isisProcess.isisInterfaceList()) { DefaultIsisInterface isisInterfaceImpl = (DefaultIsisInterface) isisInterface; log.debug("IsisInterfaceDetails : " + isisInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) isisInterfaceImpl.interfaceIndex(); if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 0; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 1; } else if (isisInterface.networkType() == IsisNetworkType.P2P) { configPacket[(2 * numberOfInterface) + 1] = (byte) 2; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 3; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (isisProcesses.size() > 0) { processes = isisProcesses; connectPeer(); } } else { isisChannelHandler.updateInterfaceMap(isisProcesses); isisChannelHandler.sentConfigPacket(configPacket); } }  void isisDeactivate(); void setAgent(IsisAgent agent); void updateConfig(JsonNode jsonNode); List<IsisProcess> getAllConfiguredProcesses(); void disconnectExecutor(); void connectPeer(); void addDeviceDetails(IsisRouter isisRouter); void removeDeviceDetails(IsisRouter isisRouter); void addLinkDetails(IsisLink isisLink); void removeLinkDetails(IsisLink isisLink); IsisAgent agent(); }
Controller { public void updateConfig(JsonNode jsonNode) throws Exception { log.debug("Controller::UpdateConfig called"); configPacket = new byte[IsisConstants.CONFIG_LENGTH]; byte numberOfInterface = 0; configPacket[0] = (byte) 0xFF; List<IsisProcess> isisProcesses = getConfig(jsonNode); for (IsisProcess isisProcess : isisProcesses) { log.debug("IsisProcessDetails : " + isisProcess); for (IsisInterface isisInterface : isisProcess.isisInterfaceList()) { DefaultIsisInterface isisInterfaceImpl = (DefaultIsisInterface) isisInterface; log.debug("IsisInterfaceDetails : " + isisInterface); numberOfInterface++; configPacket[2 * numberOfInterface] = (byte) isisInterfaceImpl.interfaceIndex(); if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 0; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 1; } else if (isisInterface.networkType() == IsisNetworkType.P2P) { configPacket[(2 * numberOfInterface) + 1] = (byte) 2; } else if (isisInterface.networkType() == IsisNetworkType.BROADCAST && isisInterfaceImpl.reservedPacketCircuitType() == IsisRouterType.L1L2.value()) { configPacket[(2 * numberOfInterface) + 1] = (byte) 3; } } } configPacket[1] = numberOfInterface; if (processes == null) { if (isisProcesses.size() > 0) { processes = isisProcesses; connectPeer(); } } else { isisChannelHandler.updateInterfaceMap(isisProcesses); isisChannelHandler.sentConfigPacket(configPacket); } }  void isisDeactivate(); void setAgent(IsisAgent agent); void updateConfig(JsonNode jsonNode); List<IsisProcess> getAllConfiguredProcesses(); void disconnectExecutor(); void connectPeer(); void addDeviceDetails(IsisRouter isisRouter); void removeDeviceDetails(IsisRouter isisRouter); void addLinkDetails(IsisLink isisLink); void removeLinkDetails(IsisLink isisLink); IsisAgent agent();  }