@Override public void onNodeConnectorUpdated(NodeConnectorUpdated nodeConnectorUpdated) { LOG.debug("NodeConnector updated {}", nodeConnectorUpdated); NodeId nodeId = InventoryUtils.getNodeId(nodeConnectorUpdated.getNodeConnectorRef()); FlowCapableNodeConnectorUpdated portDesc = nodeConnectorUpdated.getAugmentation(FlowCapableNodeConnectorUpdated.class); if (portDesc != null) { LOG.info("Node {}, OpenFlow Port description {}", nodeId, portDesc); } } }
if (!Objects.equals(_id, other.getId())) { return false; if (!Objects.equals(_nodeConnectorRef, other.getNodeConnectorRef())) { return false; if (!e.getValue().equals(other.augmentation(e.getKey()))) { return false;
public NodeConnectorUpdatedBuilder(NodeConnectorUpdated base) { this._id = base.getId(); this._nodeConnectorRef = base.getNodeConnectorRef(); if (base instanceof NodeConnectorUpdatedImpl) { NodeConnectorUpdatedImpl impl = (NodeConnectorUpdatedImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") Map<Class<? extends Augmentation<NodeConnectorUpdated>>, Augmentation<NodeConnectorUpdated>> aug =((AugmentationHolder<NodeConnectorUpdated>) base).augmentations(); if (!aug.isEmpty()) { this.augmentation = new HashMap<>(aug); } } }
@Override public void applyOperation(final ReadWriteTransaction tx) { final NodeConnectorRef ref = connector.getNodeConnectorRef(); final NodeConnectorBuilder data = new NodeConnectorBuilder(connector); data.setKey(new NodeConnectorKey(connector.getId())); final FlowCapableNodeConnectorUpdated flowConnector = connector .getAugmentation(FlowCapableNodeConnectorUpdated.class); if (flowConnector != null) { final FlowCapableNodeConnector augment = InventoryMapping.toInventoryAugment(flowConnector); data.addAugmentation(FlowCapableNodeConnector.class, augment); } InstanceIdentifier<NodeConnector> value = (InstanceIdentifier<NodeConnector>) ref.getValue(); LOG.debug("updating node connector : {}.", value); NodeConnector build = data.build(); tx.merge(LogicalDatastoreType.OPERATIONAL, value, build, true); } });
@Override public void onNodeConnectorUpdated(NodeConnectorUpdated notification) { LOG.debug("NodeConnectorUpdated Notification..................."); LOG.debug("NodeConnectorRef " + notification.getNodeConnectorRef()); LOG.debug("----------------------------------------------------------------------"); nodeConnectorUpdated.add(notification); }
public static HashSet<Property> toADNodeConnectorProperties(final NodeConnectorUpdated nc) { final FlowCapableNodeConnectorUpdated fcncu = nc.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class); if (!Objects.equal(fcncu, null)) { HashSet<Property> adNodeConnectorProperties = NodeMapping.toADNodeConnectorProperties(fcncu); return adNodeConnectorProperties; } return new HashSet<Property>(); }
@Override public void onNodeConnectorUpdated (NodeConnectorUpdated nodeConnectorUpdated) { if (nodeConnectorUpdated == null) { return; } LOG.debug("got a node connec Updated from inventory listener {} in lacp ", nodeConnectorUpdated); InstanceIdentifier<NodeConnector> instanceId = (InstanceIdentifier<NodeConnector>)nodeConnectorUpdated.getNodeConnectorRef().getValue(); lacpServiceNodeConnector.submit(new LacpNodeConnectorUpdate(EventType.STATUS_UPDATE, instanceId, nodeConnectorUpdated)); } @Override
= ncUpdated.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class); long portNum = flowConnector.getPortNumber().getUint32(); if (portNum > LacpUtil.getLogPortNum())
public void onNodeConnectorUpdatedInternal(final NodeConnectorUpdated update) { final NodeConnectorRef ref = update.getNodeConnectorRef(); final UpdateType updateType; if (!this.isKnownNodeConnector(ref.getValue())) { this.recordNodeConnector(ref.getValue()); updateType = UpdateType.ADDED; } else { updateType = UpdateType.CHANGED; } try { final NodeConnector nodeConnector; nodeConnector = NodeMapping.toADNodeConnector(ref); this.publishNodeConnectorUpdate(nodeConnector, updateType, NodeMapping.toADNodeConnectorProperties(update)); } catch (ConstructionException e) { LOG.warn("Failed to construct node connector for {}, not reporting the update", ref, e); } }