/** * Update the specified flow entry. * * @param input An input of this RPC. * @return A {@link Future} instance associated with the RPC task. */ @Override public Future<RpcResult<UpdateFlowOutput>> updateFlow( UpdateFlowInput input) { // Do nothing. UpdateFlowOutput output = new UpdateFlowOutputBuilder(). setTransactionId(createTransactionId()).build(); return createRpcResult(output); }
private UpdateFlowOutputImpl(UpdateFlowOutputBuilder 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.UpdateFlowOutput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
public UpdateFlowOutputBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
@Override public RpcResult<UpdateFlowOutput> apply(final RpcResult<Void> inputArg) { UpdateFlowOutputBuilder flowModOutput = new UpdateFlowOutputBuilder(); BigInteger bigIntXid = BigInteger.valueOf(input.getXid()); flowModOutput.setTransactionId(new TransactionId(bigIntXid)); UpdateFlowOutput result = flowModOutput.build(); RpcResult<UpdateFlowOutput> rpcResult = RpcResultBuilder .<UpdateFlowOutput>status(inputArg.isSuccessful()) .withResult(result).withRpcErrors(inputArg.getErrors()) .build(); return rpcResult; } });
@Override public ListenableFuture<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) { @SuppressWarnings("unchecked") org.opendaylight.controller.sal.core.Node node = InventoryMapping.toAdNode((InstanceIdentifier<Node>) input .getNode().getValue()); Flow originalFlow = ToSalConversionsUtils.toFlow(input.getOriginalFlow(), null); Flow updatedFlow = ToSalConversionsUtils.toFlow(input.getUpdatedFlow(), null); Status status = delegate.modifyFlowAsync(node, originalFlow, updatedFlow); UpdateFlowOutputBuilder builder = new UpdateFlowOutputBuilder(); builder.setTransactionId(new TransactionId(BigInteger.valueOf(status.getRequestId()))); UpdateFlowOutput rpcResultType = builder.build(); throw new UnsupportedOperationException("Need to translate AD-SAL status to MD-SAL UpdateFlowOuptut - eaw@cisco.com"); // return Futures.immediateFuture(Rpcs.getRpcResult(status.isSuccess(), rpcResultType, null)); } }