@Override public synchronized void onNodeUpdated(final NodeUpdated node) { final FlowCapableNodeUpdated flowNode = node.getAugmentation(FlowCapableNodeUpdated.class); if (flowNode == null) { return;
public static HashSet<Property> toADNodeProperties(final NodeUpdated nu) { final FlowCapableNodeUpdated fcnu = nu.getAugmentation(FlowCapableNodeUpdated.class); if (fcnu != null) { HashSet<Property> adNodeProperties = toADNodeProperties(fcnu, nu.getId()); adNodeProperties.add(toADDescription(nu.getNodeRef())); return adNodeProperties; } return new HashSet<org.opendaylight.controller.sal.core.Property>(); }
@Override public void onNodeUpdated(NodeUpdated nodeUpdated) { LOG.debug("Node updated {}", nodeUpdated); NodeId nodeId = nodeUpdated.getId(); FlowCapableNodeUpdated switchDesc = nodeUpdated.getAugmentation(FlowCapableNodeUpdated.class); if (switchDesc != null) { LOG.info("Node {}, OpenFlow description {}", nodeId, switchDesc); } //Remove all flows using RPC call to MD-SAL Flow Service RemoveFlowInputBuilder flowBuilder = new RemoveFlowInputBuilder() .setBarrier(true) .setNode(InventoryUtils.getNodeRef(nodeId)); salFlowService.removeFlow(flowBuilder.build()); }
@Override public void onNodeUpdated(final NodeUpdated notification) { Preconditions.checkNotNull(notification); final FlowCapableNodeUpdated newFlowNode = notification.getAugmentation(FlowCapableNodeUpdated.class); if (newFlowNode != null && newFlowNode.getSwitchFeatures() != null) { final NodeRef nodeRef = notification.getNodeRef(); final InstanceIdentifier<?> nodeRefIdent = nodeRef.getValue(); final InstanceIdentifier<Node> nodeIdent = nodeRefIdent.firstIdentifierOf(Node.class); final InstanceIdentifier<SwitchFeatures> swichFeaturesIdent = nodeIdent.augmentation(FlowCapableNode.class).child(SwitchFeatures.class); final SwitchFeatures switchFeatures = newFlowNode.getSwitchFeatures(); connectFlowCapableNode(swichFeaturesIdent, switchFeatures, nodeIdent); } }
@Override public void onNodeUpdated(final NodeUpdated notification) { Preconditions.checkNotNull(notification); final FlowCapableNodeUpdated newFlowNode = notification.getAugmentation(FlowCapableNodeUpdated.class); LOG.info("Received onNodeUpdated for node {} ", newFlowNode); if (newFlowNode != null && newFlowNode.getSwitchFeatures() != null) { final NodeRef nodeRef = notification.getNodeRef(); final InstanceIdentifier<?> nodeRefIdent = nodeRef.getValue(); final InstanceIdentifier<Node> nodeIdent = nodeRefIdent.firstIdentifierOf(Node.class); final InstanceIdentifier<SwitchFeatures> swichFeaturesIdent = nodeIdent.augmentation(FlowCapableNode.class).child(SwitchFeatures.class); final SwitchFeatures switchFeatures = newFlowNode.getSwitchFeatures(); connectFlowCapableNode(swichFeaturesIdent, switchFeatures, nodeIdent); //Send group/meter request to get addition details not present in switch feature response. NodeId nodeId = InstanceIdentifier.keyOf(nodeIdent).getId(); boolean ownershipState = preConfigurationCheck(nodeId); setNodeOwnership(nodeId, ownershipState); LOG.info("onNodeUpdated: Send group/meter feature request to the device {}",nodeIdent); manager.getRpcMsgManager().getGroupFeaturesStat(nodeRef); manager.getRpcMsgManager().getMeterFeaturesStat(nodeRef); } }