use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project netvirt by opendaylight.
the class OpenflowRenderer method renderPath.
@Override
// FindBugs reports "Useless object stored in variable flows" however it doesn't recognize the usage of forEach.
@SuppressFBWarnings("UC_USELESS_OBJECT")
public void renderPath(NodeId nodeId, Long nsp, short nsi, short nsl, String firstHopIp) {
List<Flow> flows = new ArrayList<>();
if (firstHopIp != null) {
Long port = geniusProvider.getEgressVxlanPortForNode(OpenFlow13Provider.getDpnIdFromNodeId(nodeId)).orElse(null);
if (port == null) {
LOG.error("OpenflowRenderer: cant get egressPort for nodeId [{}]", nodeId.getValue());
return;
}
Flow flow;
flow = openFlow13Provider.createEgressClassifierTransportEgressRemoteFlow(nodeId, nsp, port, firstHopIp);
flows.add(flow);
} else {
Flow flow;
flow = openFlow13Provider.createEgressClassifierTransportEgressLocalFlow(nodeId, nsp);
flows.add(flow);
}
short egressNsi = (short) (nsi - nsl);
flows.add(openFlow13Provider.createIngressClassifierFilterChainEgressFlow(nodeId, nsp, egressNsi));
ListenableFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> flows.forEach(flow -> this.openFlow13Provider.appendFlowForCreate(nodeId, flow, tx))), LOG, "Error rendering a path");
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class AbstractNotificationSupplierBase method getNodeII.
/**
* Method returns a keyed {@link InstanceIdentifier} for {@link Node} from inventory
* because this path is a base for every OF paths.
*
* @param ii - key for keyed {@link Node} {@link InstanceIdentifier}
* @return Keyed InstanceIdentifier for Node
*/
protected static KeyedInstanceIdentifier<Node, NodeKey> getNodeII(final InstanceIdentifier<?> ii) {
final NodeKey key = ii.firstKeyOf(Node.class, NodeKey.class);
Preconditions.checkArgument(key != null);
return InstanceIdentifier.create(Nodes.class).child(Node.class, key);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class NodeConnectorNotificationSupplierImpl method createNotification.
@Override
public NodeConnectorUpdated createNotification(final FlowCapableNodeConnector flowCapableNodeConnector, final InstanceIdentifier<FlowCapableNodeConnector> path) {
Preconditions.checkArgument(flowCapableNodeConnector != null);
Preconditions.checkArgument(path != null);
final NodeConnectorUpdatedBuilder notifBuilder = new NodeConnectorUpdatedBuilder();
final FlowCapableNodeConnectorUpdatedBuilder connNotifBuilder = new FlowCapableNodeConnectorUpdatedBuilder(flowCapableNodeConnector);
notifBuilder.setId(path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId());
notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path));
notifBuilder.addAugmentation(FlowCapableNodeConnectorUpdated.class, connNotifBuilder.build());
return notifBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class NodeConnectorNotificationSupplierImpl method deleteNotification.
@Override
public NodeConnectorRemoved deleteNotification(final InstanceIdentifier<FlowCapableNodeConnector> path) {
Preconditions.checkArgument(path != null);
final NodeConnectorRemovedBuilder notifBuilder = new NodeConnectorRemovedBuilder();
notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path));
return notifBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.pcep.client.attributes.path.computation.client.reported.lsp.Path in project openflowplugin by opendaylight.
the class MeterStatNotificationSupplierImpl method createNotification.
@Override
public MeterStatisticsUpdated createNotification(final MeterStatistics meterStatistics, final InstanceIdentifier<MeterStatistics> path) {
Preconditions.checkArgument(meterStatistics != null);
Preconditions.checkArgument(path != null);
final MeterStatisticsUpdatedBuilder builder = new MeterStatisticsUpdatedBuilder();
builder.setId(getNodeId(path));
builder.setMoreReplies(Boolean.FALSE);
// TODO : fix if it needs, but we have to ask DataStore for the NodeConnector list
builder.setNodeConnector(Collections.<NodeConnector>emptyList());
builder.setMeterStats(Collections.singletonList(new MeterStatsBuilder(meterStatistics).build()));
return builder.build();
}
Aggregations