X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fforwardingrules-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Ffrm%2Fflow%2FFlowTransaction.xtend;h=26846ad493c15b032026d4c66d1fcad5cf64ab9f;hb=8e654401ca264098b4bcfb25fe1411caed10ebe2;hp=5203d3c1a8165932e78fbe4fbe0f739b45926f0d;hpb=43b37a609662f705d2dd701cb8b7c479144d2ef1;p=controller.git diff --git a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/flow/FlowTransaction.xtend b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/flow/FlowTransaction.xtend index 5203d3c1a8..26846ad493 100644 --- a/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/flow/FlowTransaction.xtend +++ b/opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/frm/flow/FlowTransaction.xtend @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.frm.flow import org.opendaylight.controller.frm.AbstractTransaction @@ -15,14 +22,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N import org.opendaylight.yangtools.yang.binding.DataObject import org.opendaylight.yangtools.yang.binding.InstanceIdentifier import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri class FlowTransaction extends AbstractTransaction { @Property - val SalFlowService salFlowService; + val SalFlowService salFlowService; + new(DataModification, DataObject> modification,SalFlowService salFlowService) { - super(modification) + super(modification) _salFlowService = salFlowService; } @@ -32,8 +42,10 @@ class FlowTransaction extends AbstractTransaction { val tableInstanceId = instanceId.firstIdentifierOf(Table); val nodeInstanceId = instanceId.firstIdentifierOf(Node); val builder = new RemoveFlowInputBuilder(flow); + builder.setFlowRef(new FlowRef(instanceId)); builder.setNode(new NodeRef(nodeInstanceId)); builder.setFlowTable(new FlowTableRef(tableInstanceId)); + builder.setTransactionUri(new Uri(modification.getIdentifier() as String)); _salFlowService.removeFlow(builder.build()); } } @@ -45,8 +57,10 @@ class FlowTransaction extends AbstractTransaction { val nodeInstanceId = instanceId.firstIdentifierOf(Node); val builder = new UpdateFlowInputBuilder(); builder.setNode(new NodeRef(nodeInstanceId)); + builder.setFlowRef(new FlowRef(instanceId)); val ufb = new UpdatedFlowBuilder(updatedFlow); builder.setUpdatedFlow((ufb.build())); + builder.setTransactionUri(new Uri(modification.getIdentifier() as String)); val ofb = new OriginalFlowBuilder(originalFlow); builder.setOriginalFlow(ofb.build()); _salFlowService.updateFlow(builder.build()); @@ -61,6 +75,8 @@ class FlowTransaction extends AbstractTransaction { val nodeInstanceId = instanceId.firstIdentifierOf(Node); val builder = new AddFlowInputBuilder(flow); builder.setNode(new NodeRef(nodeInstanceId)); + builder.setTransactionUri(new Uri(modification.getIdentifier() as String)); + builder.setFlowRef(new FlowRef(instanceId)); builder.setFlowTable(new FlowTableRef(tableInstanceId)); _salFlowService.addFlow(builder.build()); } @@ -69,4 +85,4 @@ class FlowTransaction extends AbstractTransaction { override validate() throws IllegalStateException { FlowTransactionValidator.validate(this) } -} \ No newline at end of file +}