/** * {@inheritDoc} */ @Override public void transactionCanceled() { LOG.warn("Failed to read VTN flows: {}", targetNode); if (!rpcFuture.isDone()) { LOG.warn("All flow entries in {} will be removed.", targetNode); Short tid = Short.valueOf(FlowUtils.TABLE_ID); FlowTableRef tref = new FlowTableRef(targetNode.getFlowTableIdentifier(tid)); StringBuilder sb = new StringBuilder("clean-up:"). append(targetNode); RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(). setNode(targetNode.getNodeRef()). setFlowTable(tref). setTransactionUri(new Uri(sb.toString())). setTableId(tid). setMatch(EMPTY_MATCH). setStrict(false); rpcList.invoke(builder); completeRpc(); } } }
setCookie(COOKIE_VTN). setCookieMask(COOKIE_MASK_VTN). setStrict(false);
setTransactionUri(uri). setCookieMask(COOKIE_MASK_ALL). setStrict(true);
@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()); } }