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) { 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); } } }
@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); } });
= ncUpdated.<FlowCapableNodeConnectorUpdated>getAugmentation(FlowCapableNodeConnectorUpdated.class); long portNum = flowConnector.getPortNumber().getUint32(); if (portNum > LacpUtil.getLogPortNum())