@Override public NodeConnectorUpdated createNotification(final FlowCapableNodeConnector o, final InstanceIdentifier<FlowCapableNodeConnector> path) { Preconditions.checkArgument(o != null); Preconditions.checkArgument(path != null); final NodeConnectorUpdatedBuilder notifBuilder = new NodeConnectorUpdatedBuilder(); final FlowCapableNodeConnectorUpdatedBuilder connNotifBuilder = new FlowCapableNodeConnectorUpdatedBuilder(o); notifBuilder.setId(path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId()); notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path)); notifBuilder.addAugmentation(FlowCapableNodeConnectorUpdated.class, connNotifBuilder.build()); return notifBuilder.build(); }
NodeConnectorUpdatedImpl(NodeConnectorUpdatedBuilder base) { this._id = base.getId(); this._nodeConnectorRef = base.getNodeConnectorRef(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
public static NodeConnectorUpdatedBuilder nodeConnectorUpdatedBuilderFromDatapathIdPortNo(final BigInteger datapathId, final Long portNo, final OpenflowVersion ofVersion) { NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder(); builder.setId(InventoryDataServiceUtil.nodeConnectorIdfromDatapathPortNo(datapathId, portNo, ofVersion)); builder.setNodeConnectorRef(InventoryDataServiceUtil.nodeConnectorRefFromDatapathIdPortno(datapathId, portNo, ofVersion)); return builder; }
public static NodeConnectorUpdated translatePort(final Short version, final BigInteger datapathId, final Long portNumber, final PortGrouping port) { OpenflowVersion ofVersion = OpenflowVersion.get(version); NodeConnectorUpdatedBuilder builder = InventoryDataServiceUtil .nodeConnectorUpdatedBuilderFromDatapathIdPortNo(datapathId, port.getPortNo(), ofVersion); FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder(); if (ofVersion == OpenflowVersion.OF13) { fcncub.setAdvertisedFeatures(PortTranslatorUtil.translatePortFeatures(port.getAdvertisedFeatures())); fcncub.setConfiguration(PortTranslatorUtil.translatePortConfig(port.getConfig())); fcncub.setCurrentFeature(PortTranslatorUtil.translatePortFeatures(port.getCurrentFeatures())); fcncub.setPeerFeatures(PortTranslatorUtil.translatePortFeatures(port.getPeerFeatures())); fcncub.setState(PortTranslatorUtil.translatePortState(port.getState())); fcncub.setSupported(PortTranslatorUtil.translatePortFeatures(port.getSupportedFeatures())); } else if (ofVersion == OpenflowVersion.OF10) { fcncub.setAdvertisedFeatures(PortTranslatorUtil.translatePortFeatures(port.getAdvertisedFeaturesV10())); fcncub.setConfiguration(PortTranslatorUtil.translatePortConfig(port.getConfigV10())); fcncub.setCurrentFeature(PortTranslatorUtil.translatePortFeatures(port.getCurrentFeaturesV10())); fcncub.setPeerFeatures(PortTranslatorUtil.translatePortFeatures(port.getPeerFeaturesV10())); fcncub.setState(PortTranslatorUtil.translatePortState(port.getStateV10())); fcncub.setSupported(PortTranslatorUtil.translatePortFeatures(port.getSupportedFeaturesV10())); } fcncub.setCurrentSpeed(port.getCurrSpeed()); fcncub.setHardwareAddress(port.getHwAddr()); fcncub.setMaximumSpeed(port.getMaxSpeed()); fcncub.setName(port.getName()); fcncub.setPortNumber(OpenflowPortsUtil.getProtocolAgnosticPort(ofVersion, portNumber)); builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build()); return builder.build(); }
@Override protected void add(InstanceIdentifier<NodeConnector> createKeyIdent, NodeConnector node) { FlowCapableNodeConnector fcnc = node.getAugmentation(FlowCapableNodeConnector.class); if(fcnc != null) { FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder(fcnc); NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder(); builder.setId(node.getId()); builder.setNodeConnectorRef(new NodeConnectorRef(createKeyIdent)); builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build()); adapter.onNodeConnectorUpdatedInternal(builder.build()); } }
.setState(new StateBuilder().setLinkDown(false).setBlocked(false).setLive(false).build()); NodeConnectorUpdatedBuilder builder = new NodeConnectorUpdatedBuilder() .setId(portId) .setNodeConnectorRef(ncRef) .addAugmentation(FlowCapableNodeConnectorUpdated.class, flowCap.build()); notify.publish(builder.build()); LOG.info ("Notified logical port {} created for aggregator {}", id, lacpBond.getBondInstanceId());