@Override public RpcResult<RemoveFlowOutput> apply(RpcResult<UpdateFlowOutput> input) { UpdateFlowOutput updateFlowOutput = input.getResult(); RemoveFlowOutputBuilder removeFlowOutput = new RemoveFlowOutputBuilder(); removeFlowOutput.setTransactionId(updateFlowOutput.getTransactionId()); RemoveFlowOutput result = removeFlowOutput.build(); RpcResult<RemoveFlowOutput> rpcResult = assembleRpcResult(input, result); LOG.debug("Returning the Remove Flow RPC result to MD-SAL"); return rpcResult; }
private RemoveFlowOutputImpl(RemoveFlowOutputBuilder base) { this._transactionId = base.getTransactionId(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public RemoveFlowOutputBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
/** * Return the value to be retuned by the task on successful completion. * * @return The output of the remove-flow RPC request. */ @Override protected final RpcResult<RemoveFlowOutput> getResult() { RemoveFlowOutput output = new RemoveFlowOutputBuilder(). setTransactionId(targetNode.createTransactionId()).build(); return RpcResultBuilder.success(output).build(); }
@Override public ListenableFuture<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) { Flow flow = ToSalConversionsUtils.toFlow(input, null); @SuppressWarnings("unchecked") org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input .getNode().getValue()); Status status = delegate.removeFlowAsync(node, flow); RemoveFlowOutputBuilder builder = new RemoveFlowOutputBuilder(); builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId()))); RemoveFlowOutput rpcResultType = builder.build(); return Futures.immediateFuture(RpcResultBuilder.<RemoveFlowOutput>status(status.isSuccess()) .withResult(rpcResultType).build()); }