@Test(expected = Exception.class) public void testUpdateInterfaceMap() throws Exception { IsisInterface isisInterface = new DefaultIsisInterface(); IsisInterface isisInterface1 = new DefaultIsisInterface(); isisInterface.setInterfaceIpAddress(ip4Address); isisInterface.setInterfaceIndex(1); isisInterfaceList.add(isisInterface); IsisProcess isisProcess = new DefaultIsisProcess(); isisProcess.setIsisInterfaceList(isisInterfaceList); isisProcessList.add(isisProcess); isisChannelHandler.updateInterfaceMap(isisProcessList); assertThat(isisChannelHandler, is(notNullValue())); isisProcessList = new ArrayList<>(); isisInterface1.setInterfaceIpAddress(ip4Address); isisInterface1.setInterfaceIndex(1); isisInterface1.setInterfaceIpAddress(ip4Address); isisInterface1.setInterfaceIndex(1); isisInterface1.setSystemId("9999.9999.9999"); isisInterface1.setIntermediateSystemName("router"); isisInterface1.setReservedPacketCircuitType(3); isisInterface1.setCircuitId("10"); isisInterface1.setNetworkType(IsisNetworkType.BROADCAST); isisInterface1.setAreaAddress("490001"); isisInterface1.setHoldingTime(50); isisInterface1.setHelloInterval(10); isisInterfaceList.add(isisInterface1); isisProcess.setIsisInterfaceList(isisInterfaceList); isisProcessList.add(isisProcess); isisChannelHandler.updateInterfaceMap(isisProcessList); assertThat(isisChannelHandler, is(notNullValue())); }
public void updateInterfaceMap(List<IsisProcess> isisProcesses) { for (IsisProcess isisUpdatedProcess : isisProcesses) { for (IsisInterface isisUpdatedInterface : isisUpdatedProcess.isisInterfaceList()) { IsisInterface isisInterface = isisInterfaceMap.get(isisUpdatedInterface.interfaceIndex()); if (isisInterface == null) { isisInterfaceMap.put(isisUpdatedInterface.interfaceIndex(), isisUpdatedInterface); interfaceIps.add(isisUpdatedInterface.interfaceIpAddress()); } else { if (isisInterface.intermediateSystemName() != isisUpdatedInterface.intermediateSystemName()) { isisInterface.setIntermediateSystemName(isisUpdatedInterface.intermediateSystemName()); } if (isisInterface.reservedPacketCircuitType() != isisUpdatedInterface.reservedPacketCircuitType()) { isisInterface.setReservedPacketCircuitType(isisUpdatedInterface.reservedPacketCircuitType()); isisInterface.removeNeighbors(); } if (isisInterface.circuitId() != isisUpdatedInterface.circuitId()) { isisInterface.setCircuitId(isisUpdatedInterface.circuitId()); } if (isisInterface.networkType() != isisUpdatedInterface.networkType()) { isisInterface.setNetworkType(isisUpdatedInterface.networkType()); isisInterface.removeNeighbors(); } if (isisInterface.areaAddress() != isisUpdatedInterface.areaAddress()) { isisInterface.setAreaAddress(isisUpdatedInterface.areaAddress()); } if (isisInterface.holdingTime() != isisUpdatedInterface.holdingTime()) { isisInterface.setHoldingTime(isisUpdatedInterface.holdingTime()); } if (isisInterface.helloInterval() != isisUpdatedInterface.helloInterval()) { isisInterface.setHelloInterval(isisUpdatedInterface.helloInterval()); isisInterface.stopHelloSender(); isisInterface.startHelloSender(channel); } isisInterfaceMap.put(isisInterface.interfaceIndex(), isisInterface); } } } }
IsisChannelHandler extends IdleStateAwareChannelHandler { public void updateInterfaceMap(List<IsisProcess> isisProcesses) { for (IsisProcess isisUpdatedProcess : isisProcesses) { for (IsisInterface isisUpdatedInterface : isisUpdatedProcess.isisInterfaceList()) { IsisInterface isisInterface = isisInterfaceMap.get(isisUpdatedInterface.interfaceIndex()); if (isisInterface == null) { isisInterfaceMap.put(isisUpdatedInterface.interfaceIndex(), isisUpdatedInterface); interfaceIps.add(isisUpdatedInterface.interfaceIpAddress()); } else { if (isisInterface.intermediateSystemName() != isisUpdatedInterface.intermediateSystemName()) { isisInterface.setIntermediateSystemName(isisUpdatedInterface.intermediateSystemName()); } if (isisInterface.reservedPacketCircuitType() != isisUpdatedInterface.reservedPacketCircuitType()) { isisInterface.setReservedPacketCircuitType(isisUpdatedInterface.reservedPacketCircuitType()); isisInterface.removeNeighbors(); } if (isisInterface.circuitId() != isisUpdatedInterface.circuitId()) { isisInterface.setCircuitId(isisUpdatedInterface.circuitId()); } if (isisInterface.networkType() != isisUpdatedInterface.networkType()) { isisInterface.setNetworkType(isisUpdatedInterface.networkType()); isisInterface.removeNeighbors(); } if (isisInterface.areaAddress() != isisUpdatedInterface.areaAddress()) { isisInterface.setAreaAddress(isisUpdatedInterface.areaAddress()); } if (isisInterface.holdingTime() != isisUpdatedInterface.holdingTime()) { isisInterface.setHoldingTime(isisUpdatedInterface.holdingTime()); } if (isisInterface.helloInterval() != isisUpdatedInterface.helloInterval()) { isisInterface.setHelloInterval(isisUpdatedInterface.helloInterval()); isisInterface.stopHelloSender(); isisInterface.startHelloSender(channel); } isisInterfaceMap.put(isisInterface.interfaceIndex(), isisInterface); } } } } }
IsisChannelHandler extends IdleStateAwareChannelHandler { public void updateInterfaceMap(List<IsisProcess> isisProcesses) { for (IsisProcess isisUpdatedProcess : isisProcesses) { for (IsisInterface isisUpdatedInterface : isisUpdatedProcess.isisInterfaceList()) { IsisInterface isisInterface = isisInterfaceMap.get(isisUpdatedInterface.interfaceIndex()); if (isisInterface == null) { isisInterfaceMap.put(isisUpdatedInterface.interfaceIndex(), isisUpdatedInterface); interfaceIps.add(isisUpdatedInterface.interfaceIpAddress()); } else { if (isisInterface.intermediateSystemName() != isisUpdatedInterface.intermediateSystemName()) { isisInterface.setIntermediateSystemName(isisUpdatedInterface.intermediateSystemName()); } if (isisInterface.reservedPacketCircuitType() != isisUpdatedInterface.reservedPacketCircuitType()) { isisInterface.setReservedPacketCircuitType(isisUpdatedInterface.reservedPacketCircuitType()); isisInterface.removeNeighbors(); } if (isisInterface.circuitId() != isisUpdatedInterface.circuitId()) { isisInterface.setCircuitId(isisUpdatedInterface.circuitId()); } if (isisInterface.networkType() != isisUpdatedInterface.networkType()) { isisInterface.setNetworkType(isisUpdatedInterface.networkType()); isisInterface.removeNeighbors(); } if (isisInterface.areaAddress() != isisUpdatedInterface.areaAddress()) { isisInterface.setAreaAddress(isisUpdatedInterface.areaAddress()); } if (isisInterface.holdingTime() != isisUpdatedInterface.holdingTime()) { isisInterface.setHoldingTime(isisUpdatedInterface.holdingTime()); } if (isisInterface.helloInterval() != isisUpdatedInterface.helloInterval()) { isisInterface.setHelloInterval(isisUpdatedInterface.helloInterval()); isisInterface.stopHelloSender(); isisInterface.startHelloSender(channel); } isisInterfaceMap.put(isisInterface.interfaceIndex(), isisInterface); } } } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); }
IsisChannelHandler extends IdleStateAwareChannelHandler { public void updateInterfaceMap(List<IsisProcess> isisProcesses) { for (IsisProcess isisUpdatedProcess : isisProcesses) { for (IsisInterface isisUpdatedInterface : isisUpdatedProcess.isisInterfaceList()) { IsisInterface isisInterface = isisInterfaceMap.get(isisUpdatedInterface.interfaceIndex()); if (isisInterface == null) { isisInterfaceMap.put(isisUpdatedInterface.interfaceIndex(), isisUpdatedInterface); interfaceIps.add(isisUpdatedInterface.interfaceIpAddress()); } else { if (isisInterface.intermediateSystemName() != isisUpdatedInterface.intermediateSystemName()) { isisInterface.setIntermediateSystemName(isisUpdatedInterface.intermediateSystemName()); } if (isisInterface.reservedPacketCircuitType() != isisUpdatedInterface.reservedPacketCircuitType()) { isisInterface.setReservedPacketCircuitType(isisUpdatedInterface.reservedPacketCircuitType()); isisInterface.removeNeighbors(); } if (isisInterface.circuitId() != isisUpdatedInterface.circuitId()) { isisInterface.setCircuitId(isisUpdatedInterface.circuitId()); } if (isisInterface.networkType() != isisUpdatedInterface.networkType()) { isisInterface.setNetworkType(isisUpdatedInterface.networkType()); isisInterface.removeNeighbors(); } if (isisInterface.areaAddress() != isisUpdatedInterface.areaAddress()) { isisInterface.setAreaAddress(isisUpdatedInterface.areaAddress()); } if (isisInterface.holdingTime() != isisUpdatedInterface.holdingTime()) { isisInterface.setHoldingTime(isisUpdatedInterface.holdingTime()); } if (isisInterface.helloInterval() != isisUpdatedInterface.helloInterval()) { isisInterface.setHelloInterval(isisUpdatedInterface.helloInterval()); isisInterface.stopHelloSender(); isisInterface.startHelloSender(channel); } isisInterfaceMap.put(isisInterface.interfaceIndex(), isisInterface); } } } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); void initializeInterfaceMap(); void updateInterfaceMap(List<IsisProcess> isisProcesses); void initializeInterfaceIpList(); @Override void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e); @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e); void processIsisMessage(IsisMessage isisMessage, ChannelHandlerContext ctx); void startHelloSender(); void stopHelloSender(); void sentConfigPacket(byte[] configPacket); }
IsisChannelHandler extends IdleStateAwareChannelHandler { public void updateInterfaceMap(List<IsisProcess> isisProcesses) { for (IsisProcess isisUpdatedProcess : isisProcesses) { for (IsisInterface isisUpdatedInterface : isisUpdatedProcess.isisInterfaceList()) { IsisInterface isisInterface = isisInterfaceMap.get(isisUpdatedInterface.interfaceIndex()); if (isisInterface == null) { isisInterfaceMap.put(isisUpdatedInterface.interfaceIndex(), isisUpdatedInterface); interfaceIps.add(isisUpdatedInterface.interfaceIpAddress()); } else { if (isisInterface.intermediateSystemName() != isisUpdatedInterface.intermediateSystemName()) { isisInterface.setIntermediateSystemName(isisUpdatedInterface.intermediateSystemName()); } if (isisInterface.reservedPacketCircuitType() != isisUpdatedInterface.reservedPacketCircuitType()) { isisInterface.setReservedPacketCircuitType(isisUpdatedInterface.reservedPacketCircuitType()); isisInterface.removeNeighbors(); } if (isisInterface.circuitId() != isisUpdatedInterface.circuitId()) { isisInterface.setCircuitId(isisUpdatedInterface.circuitId()); } if (isisInterface.networkType() != isisUpdatedInterface.networkType()) { isisInterface.setNetworkType(isisUpdatedInterface.networkType()); isisInterface.removeNeighbors(); } if (isisInterface.areaAddress() != isisUpdatedInterface.areaAddress()) { isisInterface.setAreaAddress(isisUpdatedInterface.areaAddress()); } if (isisInterface.holdingTime() != isisUpdatedInterface.holdingTime()) { isisInterface.setHoldingTime(isisUpdatedInterface.holdingTime()); } if (isisInterface.helloInterval() != isisUpdatedInterface.helloInterval()) { isisInterface.setHelloInterval(isisUpdatedInterface.helloInterval()); isisInterface.stopHelloSender(); isisInterface.startHelloSender(channel); } isisInterfaceMap.put(isisInterface.interfaceIndex(), isisInterface); } } } } IsisChannelHandler(Controller controller, List<IsisProcess> processes); void initializeInterfaceMap(); void updateInterfaceMap(List<IsisProcess> isisProcesses); void initializeInterfaceIpList(); @Override void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent evt); @Override void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e); @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e); void processIsisMessage(IsisMessage isisMessage, ChannelHandlerContext ctx); void startHelloSender(); void stopHelloSender(); void sentConfigPacket(byte[] configPacket);  }