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>(); }
if (!Objects.equals(_id, other.getId())) { return false; if (!Objects.equals(_nodeConnector, other.getNodeConnector())) { return false; if (!Objects.equals(_nodeRef, other.getNodeRef())) { return false; if (!e.getValue().equals(other.augmentation(e.getKey()))) { return false;
public NodeUpdatedBuilder(NodeUpdated base) { this._id = base.getId(); this._nodeConnector = base.getNodeConnector(); this._nodeRef = base.getNodeRef(); if (base instanceof NodeUpdatedImpl) { NodeUpdatedImpl impl = (NodeUpdatedImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") Map<Class<? extends Augmentation<NodeUpdated>>, Augmentation<NodeUpdated>> aug =((AugmentationHolder<NodeUpdated>) base).augmentations(); if (!aug.isEmpty()) { this.augmentation = new HashMap<>(aug); } } }
@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); } }
public void onNodeUpdatedInternal(final NodeUpdated notification) { final NodeRef ref = notification.getNodeRef(); final InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeRef = InstanceIdentifier.builder(Nodes.class) .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node.class, new NodeKey(notification.getId())) .toInstance(); try {
@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(NodeUpdated notification) { LOG.debug("NodeUpdated Notification ..................."); LOG.debug("NodeRef " + notification.getNodeRef()); LOG.debug("----------------------------------------------------------------------"); nodeUpdated.add(notification); } }
@Override public synchronized void onNodeUpdated(final NodeUpdated node) { final FlowCapableNodeUpdated flowNode = node.getAugmentation(FlowCapableNodeUpdated.class); if (flowNode == null) { return;
@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); } }
@Override public void applyOperation(ReadWriteTransaction tx) { final NodeRef ref = node.getNodeRef(); @SuppressWarnings("unchecked") InstanceIdentifierBuilder<Node> builder = ((InstanceIdentifier<Node>) ref.getValue()).builder(); InstanceIdentifierBuilder<FlowCapableNode> augmentation = builder.augmentation(FlowCapableNode.class); final InstanceIdentifier<FlowCapableNode> path = augmentation.build(); CheckedFuture readFuture = tx.read(LogicalDatastoreType.OPERATIONAL, path); Futures.addCallback(readFuture, new FutureCallback<Optional<? extends DataObject>>() { @Override public void onSuccess(Optional<? extends DataObject> optional) { enqueueWriteNodeDataTx(node, flowNode, path); if (!optional.isPresent()) { enqueuePutTable0Tx(ref); } } @Override public void onFailure(Throwable throwable) { LOG.debug(String.format("Can't retrieve node data for node %s. Writing node data with table0.", node)); enqueueWriteNodeDataTx(node, flowNode, path); enqueuePutTable0Tx(ref); } }); } });