+
+
+ private def writeFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, NodeKey nodeKey) {
+ val modification = this._dataBrokerService.beginTransaction();
+ val flowPath = InstanceIdentifier.builder(Nodes)
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node, nodeKey)
+ .augmentation(FlowCapableNode)
+ .child(Table, new TableKey(flow.getTableId()))
+ .child(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow, new FlowKey(flow.id))
+ .build;
+ modification.putConfigurationData(flowPath, flow);
+ val commitFuture = modification.commit();
+ try {
+ val result = commitFuture.get();
+ val status = result.getResult();
+ } catch (InterruptedException e) {
+ LOG.error(e.getMessage(), e);
+ } catch (ExecutionException e) {
+ LOG.error(e.getMessage(), e);
+ }
+ }
+
+ public static def toStatus(RpcResult<?> result) {
+ return toStatus(result.isSuccessful());
+ }