/** * Issue an remove-flow RPC request. * * @param w The node RPC watcher. * @param sfs MD-SAL flow service. * @param in The RPC input. */ public RemoveFlowRpc(NodeRpcWatcher w, SalFlowService sfs, RemoveFlowInput in) { super(w, in, in.getNode(), sfs.removeFlow(in), false); }
private ArpResolverMetadata resetFlowToRemove( final Ipv4Address gatewayIp, ArpResolverMetadata gatewayArpMetadata) { checkNotNull(gatewayIp); // If gatewayArpMetadata was not provided, look it up if (gatewayArpMetadata == null) { gatewayArpMetadata = gatewayToArpMetadataMap.get(gatewayIp); } if (gatewayArpMetadata != null && gatewayArpMetadata.getFlowToRemove() != null) { LOG.debug("Flow to route ARP Reply to Controller from {} being removed from node {}", gatewayIp, gatewayArpMetadata.getFlowToRemove().getNode()); flowService.removeFlow(gatewayArpMetadata.getFlowToRemove()); gatewayArpMetadata.setFlowToRemove(null); } return gatewayArpMetadata; }
@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()); }
/** * This utility method deletes the flows as per the match. * @param flowService reference of SalFlowService. * @param flows Collection of flows to be deleted. * @param node Flows to be deleted from the node. */ public static void deleteFlows(SalFlowService flowService, Collection<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow> flows, InstanceIdentifier<Node> node) { for(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow : flows) { RemoveFlowInputBuilder inputBuilder = new RemoveFlowInputBuilder() .setMatch(flow.getMatch()) .setTableId(flow.getTableId()) .setNode(new NodeRef(node)); flowService.removeFlow(inputBuilder.build()); } }
List<Pair<RemoveFlowInput, EndpointL3Key>> removeFlowInputsAndL3EpKeys = requestInfoByKey.get(createKey(nodeKey.getId(), spa)); for (Pair<RemoveFlowInput, EndpointL3Key> removeFlowInputAndL3EpKey : removeFlowInputsAndL3EpKeys) { flowService.removeFlow(removeFlowInputAndL3EpKey.getLeft());
builder.setFlowTable(new FlowTableRef(tableId)); builder.setTransactionUri(new Uri(lacpFlow.getId().getValue())); Future<RpcResult<RemoveFlowOutput>> result = salFlow.removeFlow(builder.build()); try
@Override public Future<RpcResult<RemoveFlowOutput>> removeWithResult(final InstanceIdentifier<Flow> identifier, final Flow removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) { Future<RpcResult<RemoveFlowOutput>> resultFuture = SettableFuture.create(); final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class); if (tableIdValidationPrecondition(tableKey, removeDataObj)) { final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj); builder.setFlowRef(new FlowRef(identifier)); builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey))); // This method is called only when a given flow object has been // removed from datastore. So FRM always needs to set strict flag // into remove-flow input so that only a flow entry associated with // a given flow object is removed. builder.setTransactionUri(new Uri(provider.getNewTransactionId())). setStrict(Boolean.TRUE); resultFuture = provider.getSalFlowService().removeFlow(builder.build()); } return resultFuture; }
@Override public void remove(final InstanceIdentifier<Flow> identifier, final Flow removeDataObj, final InstanceIdentifier<FlowCapableNode> nodeIdent) { final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class); if (tableIdValidationPrecondition(tableKey, removeDataObj)) { final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj); builder.setFlowRef(new FlowRef(identifier)); builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey))); // This method is called only when a given flow object has been // removed from datastore. So FRM always needs to set strict flag // into remove-flow input so that only a flow entry associated with // a given flow object is removed. builder.setTransactionUri(new Uri(provider.getNewTransactionId())). setStrict(Boolean.TRUE); provider.getSalFlowService().removeFlow(builder.build()); } }