@SuppressWarnings("unchecked") @Test public void updateSwitchNodeConnectorConfigTestRemoveDisconectedNull() throws Exception { Field field = SwitchState.class.getDeclaredField("fcncByNcIid"); field.setAccessible(true); Map<InstanceIdentifier<NodeConnector>, FlowCapableNodeConnector> fcncByNcIid = (Map<InstanceIdentifier<NodeConnector>, FlowCapableNodeConnector>) field.get(switchState); fcncByNcIid.put(ncIid, fcncOld); switchManager.updateSwitchNodeConnectorConfig(ncIid, null); Assert.assertFalse(fcncByNcIid.containsKey(ncIid)); verifyZeroInteractions(listener); }
synchronized void updateSwitchNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, @Nullable FlowCapableNodeConnector fcnc) { NodeId nodeId = ncIid.firstKeyOf(Node.class, NodeKey.class).getId(); SwitchState state = getSwitchState(nodeId); SwitchStatus oldStatus = state.status; state.setNodeConnectorConfig(ncIid, fcnc); handleSwitchState(state, oldStatus); }
SwitchManager implements AutoCloseable { synchronized void updateSwitchNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, @Nullable FlowCapableNodeConnector fcnc) { NodeId nodeId = ncIid.firstKeyOf(Node.class, NodeKey.class).getId(); SwitchState state = getSwitchState(nodeId); SwitchStatus oldStatus = state.status; state.setNodeConnectorConfig(ncIid, fcnc); handleSwitchState(state, oldStatus); } }
SwitchManager implements AutoCloseable { synchronized void updateSwitchNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, @Nullable FlowCapableNodeConnector fcnc) { NodeId nodeId = ncIid.firstKeyOf(Node.class, NodeKey.class).getId(); SwitchState state = getSwitchState(nodeId); SwitchStatus oldStatus = state.status; state.setNodeConnectorConfig(ncIid, fcnc); handleSwitchState(state, oldStatus); } SwitchManager(DataBroker dataProvider); }
SwitchManager implements AutoCloseable { synchronized void updateSwitchNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, @Nullable FlowCapableNodeConnector fcnc) { NodeId nodeId = ncIid.firstKeyOf(Node.class, NodeKey.class).getId(); SwitchState state = getSwitchState(nodeId); SwitchStatus oldStatus = state.status; state.setNodeConnectorConfig(ncIid, fcnc); handleSwitchState(state, oldStatus); } SwitchManager(DataBroker dataProvider); static void activatingSwitch(NodeId nodeId); static void deactivatingSwitch(NodeId nodeId); synchronized InstanceIdentifier<NodeConnector> getNodeConnectorIidForPortName(Name portName); synchronized Collection<NodeId> getReadySwitches(); synchronized Set<NodeConnectorId> getExternalPorts(NodeId nodeId); Set<Long> getExternalPortNumbers(NodeId nodeId); synchronized Collection<NodeConnectorId> getTunnelPorts(NodeId nodeId); synchronized NodeConnectorId getTunnelPort(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); synchronized IpAddress getTunnelIP(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); void registerListener(SwitchListener listener); void setEncapsulationFormat(EncapsulationFormat format); @Override void close(); }
SwitchManager implements AutoCloseable { synchronized void updateSwitchNodeConnectorConfig(InstanceIdentifier<NodeConnector> ncIid, @Nullable FlowCapableNodeConnector fcnc) { NodeId nodeId = ncIid.firstKeyOf(Node.class, NodeKey.class).getId(); SwitchState state = getSwitchState(nodeId); SwitchStatus oldStatus = state.status; state.setNodeConnectorConfig(ncIid, fcnc); handleSwitchState(state, oldStatus); } SwitchManager(DataBroker dataProvider); static void activatingSwitch(NodeId nodeId); static void deactivatingSwitch(NodeId nodeId); synchronized InstanceIdentifier<NodeConnector> getNodeConnectorIidForPortName(Name portName); synchronized Collection<NodeId> getReadySwitches(); synchronized Set<NodeConnectorId> getExternalPorts(NodeId nodeId); Set<Long> getExternalPortNumbers(NodeId nodeId); synchronized Collection<NodeConnectorId> getTunnelPorts(NodeId nodeId); synchronized NodeConnectorId getTunnelPort(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); synchronized IpAddress getTunnelIP(NodeId nodeId, Class<? extends TunnelTypeBase> tunnelType); void registerListener(SwitchListener listener); void setEncapsulationFormat(EncapsulationFormat format); @Override void close();  }