private UpdateFlowInputImpl(UpdateFlowInputBuilder base) { this._flowRef = base.getFlowRef(); this._node = base.getNode(); this._originalFlow = base.getOriginalFlow(); this._transactionUri = base.getTransactionUri(); this._updatedFlow = base.getUpdatedFlow(); 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.UpdateFlowInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
@Override public void update(final InstanceIdentifier<Flow> identifier, final Flow original, final Flow update, final InstanceIdentifier<FlowCapableNode> nodeIdent) { final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class); if (tableIdValidationPrecondition(tableKey, update)) { final UpdateFlowInputBuilder builder = new UpdateFlowInputBuilder(); builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class))); builder.setFlowRef(new FlowRef(identifier)); builder.setTransactionUri(new Uri(provider.getNewTransactionId())); // This method is called only when a given flow object in datastore // has been updated. So FRM always needs to set strict flag into // update-flow input so that only a flow entry associated with // a given flow object is updated. builder.setUpdatedFlow((new UpdatedFlowBuilder(update)).setStrict(Boolean.TRUE).build()); builder.setOriginalFlow((new OriginalFlowBuilder(original)).setStrict(Boolean.TRUE).build()); provider.getSalFlowService().updateFlow(builder.build()); } }
public static UpdateFlowInput updateFlowInput(final Node sourceNode, final Flow oldFlow, final Flow newFlow) { return new UpdateFlowInputBuilder() .setOriginalFlow(new OriginalFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build()) .setUpdatedFlow(new UpdatedFlowBuilder(MDFlowMapping.flowAdded(newFlow)).build()) .setNode(NodeMapping.toNodeRef(sourceNode)) .build(); }