Merge "Add unit test for JsonRpcDecoder" into topic/schema
authorMadhu Venugopal <mavenugo@gmail.com>
Wed, 4 Jun 2014 05:08:00 +0000 (05:08 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 4 Jun 2014 05:08:00 +0000 (05:08 +0000)
23 files changed:
library/src/main/java/org/opendaylight/ovsdb/lib/OvsDBClient.java
library/src/main/java/org/opendaylight/ovsdb/lib/OvsDBClientImpl.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/OvsdbRPC.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdates.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/UpdateNotification.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/temp/TableUpdates.java [new file with mode: 0644]
library/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsDBSet.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/json/Converter.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Assert.java [new file with mode: 0644]
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Comment.java [new file with mode: 0644]
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Insert.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Mutate.java [new file with mode: 0644]
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Operations.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnType.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/TableSchema.java
library/src/test/java/org/opendaylight/ovsdb/lib/OvsDBClientTestIT.java
library/src/test/java/org/opendaylight/ovsdb/lib/OvsDBClientTestITTyped.java
library/src/test/java/org/opendaylight/ovsdb/lib/OvsdbTestBase.java
library/src/test/java/org/opendaylight/ovsdb/lib/message/MonitorResponseTest.java
library/src/test/java/org/opendaylight/ovsdb/lib/schema/temp/SchemaObjs.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/ConnectionService.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/InventoryService.java
plugin/src/main/java/org/opendaylight/ovsdb/plugin/InventoryServiceInternal.java

index 404f5e6b6f253832b1042b78e5c5f0887168ec81..1ae226184afcb97911f90829f1633cf203bcd8eb 100644 (file)
@@ -12,7 +12,8 @@
 
 package org.opendaylight.ovsdb.lib;
 
-import com.google.common.util.concurrent.ListenableFuture;
+import java.util.List;
+
 import org.opendaylight.ovsdb.lib.message.MonitorRequest;
 import org.opendaylight.ovsdb.lib.operations.Operation;
 import org.opendaylight.ovsdb.lib.operations.OperationResult;
@@ -20,7 +21,7 @@ import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
 
-import java.util.List;
+import com.google.common.util.concurrent.ListenableFuture;
 
 /**
  * The main interface to interact with a device speaking ovsdb protocol in an asynchronous fashion and hence most
@@ -28,11 +29,6 @@ import java.util.List;
  */
 public interface OvsDBClient {
 
-    /**
-     * Represents the Open Vswitch Schema
-     */
-    String OPEN_VSWITCH_SCHEMA = "Open_vSwitch";
-
     /**
      * Gets the list of database names exposed by this ovsdb capable device
      * @return list of database names
index 5bbfab4d58aae70d455d936686563c3c6998e11c..0fbb390a50fcc85186afda2ab7de39dfafe5e565 100644 (file)
@@ -21,6 +21,7 @@ import com.google.common.util.concurrent.SettableFuture;
 import org.opendaylight.ovsdb.lib.jsonrpc.Params;
 import org.opendaylight.ovsdb.lib.message.MonitorRequest;
 import org.opendaylight.ovsdb.lib.message.OvsdbRPC;
+import org.opendaylight.ovsdb.lib.message.TableUpdate;
 import org.opendaylight.ovsdb.lib.message.TableUpdates;
 import org.opendaylight.ovsdb.lib.message.TransactBuilder;
 import org.opendaylight.ovsdb.lib.message.UpdateNotification;
@@ -29,6 +30,7 @@ import org.opendaylight.ovsdb.lib.operations.OperationResult;
 import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
+import org.opendaylight.ovsdb.lib.table.Table;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,7 +72,7 @@ public class OvsDBClientImpl implements OvsDBClient {
                         logger.info("callback received with context {}, but no known handler. Ignoring!", key);
                         return;
                     }
-                    monitorCallBack.update(upadateNotification.getUpdate());
+                    _transformingCallback(upadateNotification.getUpdate(), monitorCallBack);
                 }
 
                 @Override
@@ -88,6 +90,16 @@ public class OvsDBClientImpl implements OvsDBClient {
         }
     }
 
+    protected void _transformingCallback( org.opendaylight.ovsdb.lib.message.temp.TableUpdates oldUpdate, MonitorCallBack monitorCallBack) {
+        //todo(ashwin) : temp kludge to get stuff working while deprecating old stuff
+        Map<String, TableUpdate> updateMap = Maps.newHashMap();
+        for (Map.Entry<Table.Name, TableUpdate> temp : oldUpdate.map.entrySet()) {
+            updateMap.put(temp.getKey().getName(), temp.getValue());
+        }
+
+        monitorCallBack.update(new TableUpdates(updateMap));
+    }
+
     @Override
     public ListenableFuture<List<OperationResult>> transact(List<Operation> operations) {
 
@@ -116,16 +128,16 @@ public class OvsDBClientImpl implements OvsDBClient {
         final MonitorHandle monitorHandle = new MonitorHandle(UUID.randomUUID().toString());
         registerCallback(monitorHandle, callback);
 
-        ListenableFuture<TableUpdates> monitor = rpc.monitor(new Params() {
+        ListenableFuture<org.opendaylight.ovsdb.lib.message.temp.TableUpdates> monitor = rpc.monitor(new Params() {
             @Override
             public List<Object> params() {
                 return Lists.<Object>newArrayList(dbSchema.getName(), monitorHandle.getId(), reqMap);
             }
         });
-        Futures.addCallback(monitor, new FutureCallback<TableUpdates>() {
+        Futures.addCallback(monitor, new FutureCallback<org.opendaylight.ovsdb.lib.message.temp.TableUpdates>() {
             @Override
-            public void onSuccess(TableUpdates result) {
-                callback.update(result);
+            public void onSuccess(org.opendaylight.ovsdb.lib.message.temp.TableUpdates result) {
+                _transformingCallback(result, callback);
             }
 
             @Override
index e979737767107b5b5f0ba995986c02bab49cc978..1d0c096b54d6b5d21878ce5e51f7335139c5a3e5 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.ovsdb.lib.message;
 
 import java.util.List;
 
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.operations.OperationResult;
 
 import com.fasterxml.jackson.databind.JsonNode;
index 86a09625c99a11ace04a48cfbbae501d53533d3a..6b2f488b322f5b910f20f1b62b3957fac3e6949f 100644 (file)
 /*
- * Copyright (C) 2013 EBay Software Foundation
  *
- * 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
+ *  * Copyright (C) 2014 EBay Software Foundation
+ *  *
+ *  * 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
+ *  *
+ *  * Authors : Ashwin Raveendran
  *
- * Authors : Ashwin Raveendran, Madhu Venugopal
  */
 package org.opendaylight.ovsdb.lib.message;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.collect.Maps;
-
 import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
-import org.opendaylight.ovsdb.lib.table.Bridge;
-import org.opendaylight.ovsdb.lib.table.Capability;
-import org.opendaylight.ovsdb.lib.table.Interface;
-import org.opendaylight.ovsdb.lib.table.Port;
-import org.opendaylight.ovsdb.lib.table.Controller;
-import org.opendaylight.ovsdb.lib.table.Manager;
-import org.opendaylight.ovsdb.lib.table.Mirror;
-import org.opendaylight.ovsdb.lib.table.NetFlow;
-import org.opendaylight.ovsdb.lib.table.Open_vSwitch;
-import org.opendaylight.ovsdb.lib.table.Qos;
-import org.opendaylight.ovsdb.lib.table.Queue;
-import org.opendaylight.ovsdb.lib.table.SFlow;
-import org.opendaylight.ovsdb.lib.table.SSL;
-import org.opendaylight.ovsdb.lib.table.Flow_Sample_Collector_Set;
-import org.opendaylight.ovsdb.lib.table.Flow_Table;
-import org.opendaylight.ovsdb.lib.table.IPFIX;
-import org.opendaylight.ovsdb.lib.table.Table;
 
 import java.util.Map;
-import java.util.Set;
 
 
 public class TableUpdates extends Response {
 
-    Map<Table.Name, TableUpdate> map = Maps.newHashMap();
-
-    public Set<Table.Name> availableUpdates() {
-        return map.keySet();
-    }
-
-    @SuppressWarnings("unchecked")
-    public <T extends Table> TableUpdate<T> getUpdate(Table.Name<T> name) {
-        return map.get(name);
-    }
-
-    private <T extends Table> void put(Table.Name<T> name, TableUpdate<T> update) {
-        map.put(name, update);
-    }
-
-    @JsonProperty("Interface")
-    public TableUpdate<Interface> getInterfaceUpdate() {
-        return getUpdate(Interface.NAME);
-    }
-
-    public void setInterfaceUpdate(TableUpdate<Interface> interfaceUpdate) {
-        put(Interface.NAME, interfaceUpdate);
-    }
-
-    @JsonProperty("Bridge")
-    TableUpdate<Bridge> getBridgeUpdate() {
-        return getUpdate(Bridge.NAME);
-    }
-
-    public void setBridgeUpdate(TableUpdate<Bridge> bridgeUpdate) {
-        put(Bridge.NAME, bridgeUpdate);
-    }
-
-    @JsonProperty("Port")
-    TableUpdate<Port> getPortUpdate() {
-        return getUpdate(Port.NAME);
-    }
-
-    void setPortUpdate(TableUpdate<Port> portUpdate) {
-        put(Port.NAME, portUpdate);
-    }
-
-    @JsonProperty("Capability")
-    public TableUpdate<Capability> getCapabilityUpdate() {
-        return getUpdate(Capability.NAME);
-    }
-
-    public void setCapabilityUpdate(TableUpdate<Capability> capabilityUpdate) {
-        put(Capability.NAME, capabilityUpdate);
-    }
-
-    @JsonProperty("Controller")
-    public TableUpdate<Controller> getControllerUpdate() {
-        return getUpdate(Controller.NAME);
-    }
-
-    public void setControllerUpdate(TableUpdate<Controller> controllerUpdate) {
-        put(Controller.NAME, controllerUpdate);
-    }
-
-    @JsonProperty("Manager")
-    public TableUpdate<Manager> getManagerUpdate() {
-        return getUpdate(Manager.NAME);
-    }
-
-    public void setManagerUpdate(TableUpdate<Manager> managerUpdate) {
-        put(Manager.NAME, managerUpdate);
-    }
-
-    @JsonProperty("Mirror")
-    public TableUpdate<Mirror> getMirrorUpdate() {
-        return getUpdate(Mirror.NAME);
-    }
-
-    public void setMirrorUpdate(TableUpdate<Mirror> mirrorUpdate) {
-        put(Mirror.NAME, mirrorUpdate);
-    }
-
-    @JsonProperty("NetFlow")
-    public TableUpdate<NetFlow> getNetFlowUpdate() {
-        return getUpdate(NetFlow.NAME);
-    }
-
-    public void setNetFlowUpdate(TableUpdate<NetFlow> netFlowUpdate) {
-        put(NetFlow.NAME, netFlowUpdate);
-    }
-
-    @JsonProperty("Open_vSwitch")
-    public TableUpdate<Open_vSwitch> getOpen_vSwitchUpdate() {
-        return getUpdate(Open_vSwitch.NAME);
-    }
-
-    public void setOpen_vSwitchUpdate(TableUpdate<Open_vSwitch> openVSwitchUpdate) {
-        put(Open_vSwitch.NAME, openVSwitchUpdate);
-    }
-
-    @JsonProperty("QoS")
-    public TableUpdate<Qos> getQosUpdate() {
-        return getUpdate(Qos.NAME);
-    }
-
-    public void setQosUpdate(TableUpdate<Qos> qosUpdate) {
-        put(Qos.NAME, qosUpdate);
-    }
-
-    @JsonProperty("Queue")
-    public TableUpdate<Queue> getQueueUpdate() {
-        return getUpdate(Queue.NAME);
-    }
-
-    public void setQueueUpdate(TableUpdate<Queue> queueUpdate) {
-        put(Queue.NAME, queueUpdate);
-    }
-
-    @JsonProperty("sFlow")
-    public TableUpdate<SFlow> getSFlowUpdate() {
-        return getUpdate(SFlow.NAME);
-    }
-
-    public void setSFlowUpdate(TableUpdate<SFlow> sFlowUpdate) {
-        put(SFlow.NAME, sFlowUpdate);
-    }
-
-    @JsonProperty("SSL")
-    public TableUpdate<SSL> getSSLUpdate() {
-        return getUpdate(SSL.NAME);
-    }
-
-    public void setSSLUpdate(TableUpdate<SSL> sslUpdate) {
-        put(SSL.NAME, sslUpdate);
-    }
-
-    @JsonProperty("Flow_Table")
-    public TableUpdate<Flow_Table> getFlow_TableUpdate() {
-        return getUpdate(Flow_Table.NAME);
-    }
-
-    public void setFlow_TableUpdate(TableUpdate<Flow_Table> Flow_TableUpdate) {
-        put(Flow_Table.NAME, Flow_TableUpdate);
-    }
-
-    @JsonProperty("Flow_Sample_Collector_Set")
-    public TableUpdate<Flow_Sample_Collector_Set> getFlow_Sample_Collector_SetUpdate() {
-        return getUpdate(Flow_Sample_Collector_Set.NAME);
-    }
-
-    public void setFlow_Sample_Collector_SetUpdate(TableUpdate<Flow_Sample_Collector_Set> Flow_Sample_Collector_SetUpdate) {
-        put(Flow_Sample_Collector_Set.NAME, Flow_Sample_Collector_SetUpdate);
-    }
+    Map<String, TableUpdate> map = Maps.newHashMap();
 
-    @JsonProperty("IPFIX")
-    public TableUpdate<IPFIX> getIPFIXUpdate() {
-        return getUpdate(IPFIX.NAME);
+    public TableUpdates() {
+        this(Maps.<String, TableUpdate>newHashMap());
     }
 
-    public void setIPFIXUpdate(TableUpdate<IPFIX> IPFIXUpdate) {
-        put(IPFIX.NAME, IPFIXUpdate);
+    public TableUpdates(Map<String, TableUpdate> map) {
+        this.map = map;
     }
 
     public TableUpdate getUpdate(GenericTableSchema table) {
         //todo Horrible just for time being, before this whole thing is refactored.
-        for (Map.Entry<Table.Name, TableUpdate> s : this.map.entrySet()) {
-            if (table.getName().equals(s.getKey().getName())) {
+        for (Map.Entry<String, TableUpdate> s : this.map.entrySet()) {
+            if (table.getName().equals(s.getKey())) {
                 return s.getValue();
             }
         }
index 07390cf0b35c7a1ff18e927aa4abf29636e2f3a6..8fb4ef27433f4d72fdc49aeff2e6e9fd97343143 100644 (file)
@@ -9,6 +9,7 @@
  */
 package org.opendaylight.ovsdb.lib.message;
 
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.notation.json.Converter.UpdateNotificationConverter;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 
diff --git a/library/src/main/java/org/opendaylight/ovsdb/lib/message/temp/TableUpdates.java b/library/src/main/java/org/opendaylight/ovsdb/lib/message/temp/TableUpdates.java
new file mode 100644 (file)
index 0000000..df2b26e
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2013 EBay Software Foundation
+ *
+ * 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
+ *
+ * Authors : Ashwin Raveendran, Madhu Venugopal
+ */
+package org.opendaylight.ovsdb.lib.message.temp;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.collect.Maps;
+
+import org.opendaylight.ovsdb.lib.message.Response;
+import org.opendaylight.ovsdb.lib.message.TableUpdate;
+import org.opendaylight.ovsdb.lib.schema.GenericTableSchema;
+import org.opendaylight.ovsdb.lib.table.Bridge;
+import org.opendaylight.ovsdb.lib.table.Capability;
+import org.opendaylight.ovsdb.lib.table.Interface;
+import org.opendaylight.ovsdb.lib.table.Port;
+import org.opendaylight.ovsdb.lib.table.Controller;
+import org.opendaylight.ovsdb.lib.table.Manager;
+import org.opendaylight.ovsdb.lib.table.Mirror;
+import org.opendaylight.ovsdb.lib.table.NetFlow;
+import org.opendaylight.ovsdb.lib.table.Open_vSwitch;
+import org.opendaylight.ovsdb.lib.table.Qos;
+import org.opendaylight.ovsdb.lib.table.Queue;
+import org.opendaylight.ovsdb.lib.table.SFlow;
+import org.opendaylight.ovsdb.lib.table.SSL;
+import org.opendaylight.ovsdb.lib.table.Flow_Sample_Collector_Set;
+import org.opendaylight.ovsdb.lib.table.Flow_Table;
+import org.opendaylight.ovsdb.lib.table.IPFIX;
+import org.opendaylight.ovsdb.lib.table.Table;
+
+import java.util.Map;
+import java.util.Set;
+
+
+public class TableUpdates extends Response {
+
+    public Map<Table.Name, TableUpdate> map = Maps.newHashMap();
+
+    public Set<Table.Name> availableUpdates() {
+        return map.keySet();
+    }
+
+    @SuppressWarnings("unchecked")
+    public <T extends Table> TableUpdate<T> getUpdate(Table.Name<T> name) {
+        return map.get(name);
+    }
+
+    private <T extends Table> void put(Table.Name<T> name, TableUpdate<T> update) {
+        map.put(name, update);
+    }
+
+    @JsonProperty("Interface")
+    public TableUpdate<Interface> getInterfaceUpdate() {
+        return getUpdate(Interface.NAME);
+    }
+
+    public void setInterfaceUpdate(TableUpdate<Interface> interfaceUpdate) {
+        put(Interface.NAME, interfaceUpdate);
+    }
+
+    @JsonProperty("Bridge")
+    TableUpdate<Bridge> getBridgeUpdate() {
+        return getUpdate(Bridge.NAME);
+    }
+
+    public void setBridgeUpdate(TableUpdate<Bridge> bridgeUpdate) {
+        put(Bridge.NAME, bridgeUpdate);
+    }
+
+    @JsonProperty("Port")
+    TableUpdate<Port> getPortUpdate() {
+        return getUpdate(Port.NAME);
+    }
+
+    void setPortUpdate(TableUpdate<Port> portUpdate) {
+        put(Port.NAME, portUpdate);
+    }
+
+    @JsonProperty("Capability")
+    public TableUpdate<Capability> getCapabilityUpdate() {
+        return getUpdate(Capability.NAME);
+    }
+
+    public void setCapabilityUpdate(TableUpdate<Capability> capabilityUpdate) {
+        put(Capability.NAME, capabilityUpdate);
+    }
+
+    @JsonProperty("Controller")
+    public TableUpdate<Controller> getControllerUpdate() {
+        return getUpdate(Controller.NAME);
+    }
+
+    public void setControllerUpdate(TableUpdate<Controller> controllerUpdate) {
+        put(Controller.NAME, controllerUpdate);
+    }
+
+    @JsonProperty("Manager")
+    public TableUpdate<Manager> getManagerUpdate() {
+        return getUpdate(Manager.NAME);
+    }
+
+    public void setManagerUpdate(TableUpdate<Manager> managerUpdate) {
+        put(Manager.NAME, managerUpdate);
+    }
+
+    @JsonProperty("Mirror")
+    public TableUpdate<Mirror> getMirrorUpdate() {
+        return getUpdate(Mirror.NAME);
+    }
+
+    public void setMirrorUpdate(TableUpdate<Mirror> mirrorUpdate) {
+        put(Mirror.NAME, mirrorUpdate);
+    }
+
+    @JsonProperty("NetFlow")
+    public TableUpdate<NetFlow> getNetFlowUpdate() {
+        return getUpdate(NetFlow.NAME);
+    }
+
+    public void setNetFlowUpdate(TableUpdate<NetFlow> netFlowUpdate) {
+        put(NetFlow.NAME, netFlowUpdate);
+    }
+
+    @JsonProperty("Open_vSwitch")
+    public TableUpdate<Open_vSwitch> getOpen_vSwitchUpdate() {
+        return getUpdate(Open_vSwitch.NAME);
+    }
+
+    public void setOpen_vSwitchUpdate(TableUpdate<Open_vSwitch> openVSwitchUpdate) {
+        put(Open_vSwitch.NAME, openVSwitchUpdate);
+    }
+
+    @JsonProperty("QoS")
+    public TableUpdate<Qos> getQosUpdate() {
+        return getUpdate(Qos.NAME);
+    }
+
+    public void setQosUpdate(TableUpdate<Qos> qosUpdate) {
+        put(Qos.NAME, qosUpdate);
+    }
+
+    @JsonProperty("Queue")
+    public TableUpdate<Queue> getQueueUpdate() {
+        return getUpdate(Queue.NAME);
+    }
+
+    public void setQueueUpdate(TableUpdate<Queue> queueUpdate) {
+        put(Queue.NAME, queueUpdate);
+    }
+
+    @JsonProperty("sFlow")
+    public TableUpdate<SFlow> getSFlowUpdate() {
+        return getUpdate(SFlow.NAME);
+    }
+
+    public void setSFlowUpdate(TableUpdate<SFlow> sFlowUpdate) {
+        put(SFlow.NAME, sFlowUpdate);
+    }
+
+    @JsonProperty("SSL")
+    public TableUpdate<SSL> getSSLUpdate() {
+        return getUpdate(SSL.NAME);
+    }
+
+    public void setSSLUpdate(TableUpdate<SSL> sslUpdate) {
+        put(SSL.NAME, sslUpdate);
+    }
+
+    @JsonProperty("Flow_Table")
+    public TableUpdate<Flow_Table> getFlow_TableUpdate() {
+        return getUpdate(Flow_Table.NAME);
+    }
+
+    public void setFlow_TableUpdate(TableUpdate<Flow_Table> Flow_TableUpdate) {
+        put(Flow_Table.NAME, Flow_TableUpdate);
+    }
+
+    @JsonProperty("Flow_Sample_Collector_Set")
+    public TableUpdate<Flow_Sample_Collector_Set> getFlow_Sample_Collector_SetUpdate() {
+        return getUpdate(Flow_Sample_Collector_Set.NAME);
+    }
+
+    public void setFlow_Sample_Collector_SetUpdate(TableUpdate<Flow_Sample_Collector_Set> Flow_Sample_Collector_SetUpdate) {
+        put(Flow_Sample_Collector_Set.NAME, Flow_Sample_Collector_SetUpdate);
+    }
+
+    @JsonProperty("IPFIX")
+    public TableUpdate<IPFIX> getIPFIXUpdate() {
+        return getUpdate(IPFIX.NAME);
+    }
+
+    public void setIPFIXUpdate(TableUpdate<IPFIX> IPFIXUpdate) {
+        put(IPFIX.NAME, IPFIXUpdate);
+    }
+
+    public TableUpdate getUpdate(GenericTableSchema table) {
+        //todo Horrible just for time being, before this whole thing is refactored.
+        for (Map.Entry<Table.Name, TableUpdate> s : this.map.entrySet()) {
+            if (table.getName().equals(s.getKey().getName())) {
+                return s.getValue();
+            }
+        }
+        return null;
+    }
+}
index 210083a253a838a80fc1de2051481e4030832e07..3a5892a1486ccc50373903d83635060c321fc632 100644 (file)
@@ -23,10 +23,22 @@ import java.util.Set;
 @JsonSerialize(using = OvsDBSetSerializer.class)
 public class OvsDBSet<T> extends ForwardingSet<T> {
 
-    Set<T> target = Sets.newHashSet();
+    Set<T> target = null;
+
+    public OvsDBSet() {
+        this(Sets.<T>newHashSet());
+    }
+
+    public OvsDBSet(Set<T> backing) {
+       this.target = backing;
+    }
 
     @Override
     public Set<T> delegate() {
         return target;
     }
+
+    public static<D> OvsDBSet<D> fromSet(Set<D> value) {
+        return new OvsDBSet<>(value);
+    }
 }
index dcad62bcbe05715bc2662cc925bd8c8bf0b14baf..380819ab030f0f6087c14f3dac7094cd61097961 100644 (file)
@@ -9,7 +9,7 @@
  */
 package org.opendaylight.ovsdb.lib.notation.json;
 
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.message.UpdateNotification;
 import org.opendaylight.ovsdb.lib.notation.OvsDBMap;
 import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
diff --git a/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Assert.java b/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Assert.java
new file mode 100644 (file)
index 0000000..2d3e291
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.ovsdb.lib.operations;
+
+
+public class Assert extends Operation {
+
+    public static final String ASSERT = "assert";
+    String lock;
+
+    public Assert(String lock) {
+        super(null, ASSERT);
+        this.lock = lock;
+    }
+
+    public String getLock() {
+        return lock;
+    }
+}
diff --git a/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Comment.java b/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Comment.java
new file mode 100644 (file)
index 0000000..f2a6ba5
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * 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
+ *
+ * Authors : Madhu Venugopal
+ */
+package org.opendaylight.ovsdb.lib.operations;
+
+
+public class Comment extends Operation {
+
+    public static final String COMMENT = "comment";
+    String comment;
+
+    public Comment(String comment) {
+        super(null, COMMENT);
+        this.comment = comment;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+}
index 8a34a57b14bf4386d197cf46899a6a73e0e32423..fc99e92cb0f3ef80cffbda362e13e2c45edd50ca 100644 (file)
@@ -9,12 +9,16 @@
  */
 package org.opendaylight.ovsdb.lib.operations;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.collect.Maps;
+import java.util.Map;
+import java.util.Set;
+
+import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
 
-import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Maps;
 
 
 public class Insert<E extends TableSchema<E>> extends Operation<E> {
@@ -45,7 +49,14 @@ public class Insert<E extends TableSchema<E>> extends Operation<E> {
     }
 
     public <D, C extends TableSchema<C>> Insert<E> value(ColumnSchema<C, D> columnSchema, D value) {
-        row.put(columnSchema.getName(), value);
+        Object tval = null;
+        if (columnSchema.getType().isMultiValued()) {
+            Preconditions.checkArgument((value instanceof Set),"expected a set for multivalued item") ;
+            tval = OvsDBSet.fromSet((Set) value);
+        } else {
+            tval = value;
+        }
+        row.put(columnSchema.getName(), tval);
         return this;
     }
 
diff --git a/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Mutate.java b/library/src/main/java/org/opendaylight/ovsdb/lib/operations/Mutate.java
new file mode 100644 (file)
index 0000000..18805aa
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2014 Matt Oswalt
+ *
+ * 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
+ *
+ * Authors : Matt Oswalt
+ *
+ */
+package org.opendaylight.ovsdb.lib.operations;
+
+import com.google.common.collect.Lists;
+import org.opendaylight.ovsdb.lib.notation.Condition;
+import org.opendaylight.ovsdb.lib.notation.Mutation;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
+import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
+import org.opendaylight.ovsdb.lib.schema.TableSchema;
+
+import java.util.List;
+
+public class Mutate<E extends TableSchema<E>> extends Operation<E> implements ConditionalOperation {
+
+    public static final String MUTATE = "mutate";
+    List<Condition> where = Lists.newArrayList();
+    private List<Mutation> mutations = Lists.newArrayList();
+
+    public Mutate on(TableSchema schema){
+        this.setTableSchema(schema);
+        return this;
+    }
+
+    public Mutate(TableSchema<E> schema) {
+        super(schema, MUTATE);
+    }
+
+    public <T extends TableSchema<T>, D> Mutate<E> addMutation(ColumnSchema<T, D> columnSchema, Mutator mutator, D value) {
+        columnSchema.validate(value);
+        mutations.add(new Mutation(columnSchema.getName(), mutator, value));
+        return this;
+    }
+
+    public List<Mutation> getMutations() {
+        return mutations;
+    }
+
+    public void setMutations(List<Mutation> mutations) {
+        this.mutations = mutations;
+    }
+
+    @Override
+    public void addCondition(Condition condition) {
+        this.where.add(condition);
+    }
+
+    public Where where(Condition condition) {
+        this.where.add(condition);
+        return new Where(this);
+    }
+
+    public List<Condition> getWhere() {
+        return where;
+    }
+
+    public void setWhere(List<Condition> where) {
+        this.where = where;
+    }
+}
\ No newline at end of file
index e4102aaec81ecb512ac8802e6a9d6334d67f51e1..c88b0adecbdc5649d28bbe234e1ab4381aa5f50c 100644 (file)
@@ -29,6 +29,10 @@ public class Operations {
         return new Delete<>(schema);
     }
 
+    public <E extends TableSchema<E>> Mutate<E> mutate(TableSchema<E> schema) {
+        return new Mutate<>(schema);
+    }
+
     public Commit commit(Boolean durable) {
         return new Commit(durable);
     }
@@ -41,4 +45,15 @@ public class Operations {
         return new Select<>(schema);
     }
 
-}
\ No newline at end of file
+    public Comment comment(String comment) {
+        return new Comment(comment);
+    }
+
+    /*
+     * Could not use Java keyword "assert" which clashes with the ovsdb json-rpc method.
+     * using assertion instead.
+     */
+    public Assert assertion(String lock) {
+        return new Assert(lock);
+    }
+}
index 28606a635ace037d0b0c3017590e729573a6c528..6cb709eefc11ae43eaee6e5a95dca12f5025ca8d 100644 (file)
@@ -15,8 +15,24 @@ import org.opendaylight.ovsdb.lib.jsonrpc.JsonUtils;
 
 public abstract class ColumnType {
     BaseType baseType;
-    int min = 0;
-    int max = 0;
+    long min = 0;
+    long max = 0;
+
+    public long getMin() {
+        return min;
+    }
+
+    void setMin(long min) {
+        this.min = min;
+    }
+
+    public long getMax() {
+        return max;
+    }
+
+    void setMax(long max) {
+        this.max = max;
+    }
 
     private static ColumnType columns[] = new ColumnType[]{
             new AtomicColumnType(),
@@ -75,6 +91,11 @@ public abstract class ColumnType {
      */
     protected abstract ColumnType fromJsonNode(JsonNode json);
 
+    public boolean isMultiValued() {
+        //todo check if this is the right logic
+        return this.min != this.max && this.min != 1;
+    }
+
     public static class AtomicColumnType extends ColumnType {
 
         public AtomicColumnType() {
@@ -90,7 +111,22 @@ public abstract class ColumnType {
             }
             BaseType baseType = BaseType.fromJson(json, "key");
 
-            return baseType != null ? new AtomicColumnType(baseType) : null;
+            if (baseType != null) {
+
+                AtomicColumnType atomicColumnType = new AtomicColumnType(baseType);
+
+                JsonNode node = null;
+                if ((node = json.get("min")) != null) {
+                    atomicColumnType.setMin(node.asLong());
+                }
+                if ((node = json.get("max")) != null) {
+                    atomicColumnType.setMax(node.asLong());
+                }
+
+                return atomicColumnType;
+            }
+
+            return null;
         }
 
     }
index cc3d5aa34dcb3b2df2ea435b2612597b81eafa98..31ffa5f609251ddad6d43b03031de1d545d5ae96 100644 (file)
@@ -67,6 +67,14 @@ public abstract class TableSchema<E extends TableSchema<E>> {
         return new Insert<>(this);
     }
 
+    public <D> ColumnSchema<E, Set<D>> multiValuedColumn(String column, Class<D> type) {
+        //todo exception handling
+
+        ColumnSchema columnSchema = columns.get(column);
+        columnSchema.validateType(type);
+        return columnSchema;
+    }
+
     public <D> ColumnSchema<E, D> column(String column, Class<D> type) {
         //todo exception handling
 
index 66e97563a6631bc5bc1e61597aeef6292ac7f72b..0980493c9b4268043f8db9d7d7f13f744ae96348 100644 (file)
@@ -14,6 +14,7 @@ import static org.opendaylight.ovsdb.lib.operations.Operations.op;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -29,6 +30,7 @@ import org.opendaylight.ovsdb.lib.message.OvsdbRPC;
 import org.opendaylight.ovsdb.lib.message.TableUpdate;
 import org.opendaylight.ovsdb.lib.message.TableUpdates;
 import org.opendaylight.ovsdb.lib.message.UpdateNotification;
+import org.opendaylight.ovsdb.lib.notation.Mutator;
 import org.opendaylight.ovsdb.lib.operations.OperationResult;
 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
@@ -38,6 +40,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 
 
@@ -49,7 +52,7 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
     @Test
     public void testTransact() throws IOException, InterruptedException, ExecutionException {
 
-        ListenableFuture<DatabaseSchema> schema = ovs.getSchema(OvsDBClient.OPEN_VSWITCH_SCHEMA, true);
+        ListenableFuture<DatabaseSchema> schema = ovs.getSchema(OPEN_VSWITCH_SCHEMA, true);
         TableSchema<GenericTableSchema> bridge = schema.get().table("Bridge", GenericTableSchema.class);
 
         for (Map.Entry<String, ColumnSchema> names : bridge.getColumnSchemas().entrySet()) {
@@ -59,19 +62,28 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
 
         ColumnSchema<GenericTableSchema, String> name = bridge.column("name", String.class);
         ColumnSchema<GenericTableSchema, String> fail_mode = bridge.column("fail_mode", String.class);
+        ColumnSchema<GenericTableSchema, Set<Integer>> flood_vlans = bridge.multiValuedColumn("flood_vlans", Integer.class);
 
         ListenableFuture<List<OperationResult>> results = ovs.transactBuilder()
-                .add(op.insert(bridge).value(name, "br-int"))
+                .add(op.insert(bridge)
+                        .value(name, "br-test")
+                        .value(flood_vlans, Sets.newHashSet(100, 101, 4001)))
+                .add(op.comment("Inserting Bridge br-int"))
                 .add(op.update(bridge)
                         .set(fail_mode, "secure")
                         .where(name.opEqual("br-int"))
-                        //.and(name.opEqual("br-int"))
                         .operation())
+                .add(op.comment("Updating fail_mode to secure on Bridge br-int"))
                 .add(op.select(bridge)
                         .column(name)
                         .where(name.opEqual("br-int"))
                         .operation())
+                .add(op.mutate(bridge)
+                        .addMutation(flood_vlans, Mutator.INSERT, Sets.newHashSet(100, 101, 4001))
+                        .where(name.opEqual("br-int"))
+                        .operation())
                 .add(op.commit(true))
+                .add(op.comment("Commiting the operation"))
                 .execute();
 
         List<OperationResult> operationResults = results.get();
@@ -82,7 +94,9 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
                 .add(op.delete(bridge)
                         .where(name.opEqual("br-int"))
                         .operation())
+                .add(op.comment("Deleting Bridge br-int"))
                 .add(op.commit(true))
+                .add(op.comment("Commiting the operation"))
                 .execute();
 
         operationResults = results.get();
@@ -102,14 +116,33 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
 
         operationResults = results.get();
         Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for Abort Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
         System.out.println("Abort operation results = " + operationResults);
 
+        /*
+         * Adding a separate Abort operation in a transaction. Lets not mix this with other
+         * valid transactions as above.
+         */
+        results = ovs.transactBuilder()
+                .add(op.delete(bridge)
+                        .where(name.opEqual("br-int"))
+                        .operation())
+                .add(op.assertion("Assert12345")) // Failing intentionally
+                .execute();
+
+        operationResults = results.get();
+        Assert.assertFalse(operationResults.isEmpty());
+        /* Testing for an Assertion Error */
+        Assert.assertFalse(operationResults.get(1).getError() == null);
+        System.out.println("Assert operation results = " + operationResults);
+
     }
 
     @Test
     public void testMonitorRequest() throws ExecutionException, InterruptedException {
 
-        DatabaseSchema dbSchema = ovs.getSchema(OvsDBClient.OPEN_VSWITCH_SCHEMA, true).get();
+        DatabaseSchema dbSchema = ovs.getSchema(OPEN_VSWITCH_SCHEMA, true).get();
         GenericTableSchema bridge = dbSchema.table("Bridge", GenericTableSchema.class);
 
         List<MonitorRequest<GenericTableSchema>> monitorRequests = Lists.newArrayList();
@@ -117,6 +150,7 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
                 MonitorRequestBuilder.builder(bridge)
                         .addColumn(bridge.column("name"))
                         .addColumn(bridge.column("fail_mode", String.class))
+                        .addColumn(bridge.multiValuedColumn("flood_vlans", Integer.class))
                         .with(new MonitorSelect(true, true, true, true))
                         .build());
 
@@ -136,7 +170,6 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
             }
         });
 
-        //for (int i = 0; i < 5 && results.isEmpty(); i++) { //wait 5 seconds to get a result
         for (int i = 0; i < 5 ; i++) { //wait 5 seconds to get a result
             System.out.println("waiting");
             Thread.sleep(1000);
@@ -149,16 +182,22 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
         Assert.assertNotNull(bridgeUpdate);
     }
 
-    @Test
     public void testGetDBs() throws ExecutionException, InterruptedException {
         ListenableFuture<List<String>> databases = ovs.getDatabases();
         List<String> dbNames = databases.get();
         Assert.assertNotNull(dbNames);
-        Assert.assertTrue(dbNames.size() > 0);
+        boolean hasOpenVswitchSchema = false;
+        for(String dbName : dbNames) {
+           if (dbName.equals(OPEN_VSWITCH_SCHEMA)) {
+                hasOpenVswitchSchema = true;
+                break;
+           }
+        }
+        Assert.assertTrue(OPEN_VSWITCH_SCHEMA+" schema is not supported by the switch", hasOpenVswitchSchema);
     }
 
     @Before
-    public  void initalize() throws IOException {
+    public  void initalize() throws IOException, ExecutionException, InterruptedException {
         if (ovs != null) {
             return;
         }
@@ -168,6 +207,7 @@ public class OvsDBClientTestIT extends OvsdbTestBase {
         }
         ExecutorService executorService = Executors.newFixedThreadPool(3);
         ovs = new OvsDBClientImpl(rpc, executorService);
+        testGetDBs();
     }
 
 
index d52ae593211d2190789462a633812ba0893fd826..d104ea62e9011cffb30cfb5d387bc8111cd01b20 100644 (file)
@@ -65,7 +65,7 @@ public class OvsDBClientTestITTyped extends OvsdbTestBase {
     public void test() throws IOException, InterruptedException, ExecutionException {
         OvsDBClientImpl ovs = getVswitch();
 
-        Bridge bridge = ovs.getSchema(OvsDBClient.OPEN_VSWITCH_SCHEMA, true).get().table("Bridge", Bridge.class);
+        Bridge bridge = ovs.getSchema(OPEN_VSWITCH_SCHEMA, true).get().table("Bridge", Bridge.class);
 
         ListenableFuture<List<OperationResult>> results = ovs.transactBuilder()
                 .add(op.insert(bridge).value(bridge.name(), "br-int"))
index c70f79a0543f35777f4b2f04aaedf80a5ea85e10..7d7ba63900cabdeaa98806d1ee92883fe6b4129b 100644 (file)
@@ -42,6 +42,11 @@ public abstract class OvsdbTestBase implements OvsdbRPC.Callback{
     private final static String SERVER_PORT = "ovsdbserver.port";
     private final static String DEFAULT_SERVER_PORT = "6640";
 
+    /**
+     * Represents the Open Vswitch Schema
+     */
+    public final static String OPEN_VSWITCH_SCHEMA = "Open_vSwitch";
+
     public Properties loadProperties() {
         Properties props = new Properties(System.getProperties());
         return props;
index aecbe9b206d074c029b8da4e72526fc891df55ae..ba5cf7ff0263c00d9de6ef3c9aad5518540c8fe4 100644 (file)
@@ -19,6 +19,7 @@ import com.google.common.io.Resources;
 
 import junit.framework.TestCase;
 
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.notation.OvsDBMap;
 import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
 import org.opendaylight.ovsdb.lib.notation.UUID;
index a93ba0bf3f499ef0d51979f99e4ca05a9ff84f86..7b114f5abb654c3ecb5ee8f73d3546de75628bac 100644 (file)
@@ -9,17 +9,16 @@
  */
 package org.opendaylight.ovsdb.lib.schema.temp;
 
-import org.opendaylight.ovsdb.lib.OvsDBClient;
+import java.util.concurrent.ExecutionException;
+
 import org.opendaylight.ovsdb.lib.OvsDBClientImpl;
-import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.lib.OvsdbTestBase;
 import org.opendaylight.ovsdb.lib.schema.ColumnSchema;
+import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
 
-import java.util.concurrent.ExecutionException;
-
 
 public class SchemaObjs {
-
     public static class Bridge extends TableSchema<Bridge> {
         public static String NAME = "Bridge";
         TableSchema target;
@@ -54,7 +53,7 @@ public class SchemaObjs {
     public static void main(String[] args) throws ExecutionException, InterruptedException {
 
         OvsDBClientImpl ovs = new OvsDBClientImpl(null, null);
-        DatabaseSchema db = ovs.getSchema(OvsDBClient.OPEN_VSWITCH_SCHEMA, true).get();
+        DatabaseSchema db = ovs.getSchema(OvsdbTestBase.OPEN_VSWITCH_SCHEMA, true).get();
         Bridge bridge = db.table(Bridge.NAME, Bridge.class);
         Port port = db.table(Port.NAME, Port.class);
 
index b094f60cfcf85d837da2517c9b657f721a676683..a18592a2f48137ed95e03e5ebabcd4935baff279 100644 (file)
@@ -54,7 +54,7 @@ import org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcEndpoint;
 import org.opendaylight.ovsdb.lib.jsonrpc.JsonRpcServiceBinderHandler;
 import org.opendaylight.ovsdb.lib.message.MonitorRequestBuilder;
 import org.opendaylight.ovsdb.lib.message.OvsdbRPC;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.message.UpdateNotification;
 import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
 import org.opendaylight.ovsdb.lib.table.Bridge;
index 452ff7bad81f84f0330c2ae48f58fb5155c83595..2dd657c521fde145fb59e4f345c0bef693065135 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.ovsdb.lib.database.DatabaseSchema;
 import org.opendaylight.ovsdb.lib.message.TableUpdate;
 import org.opendaylight.ovsdb.lib.message.TableUpdate.Row;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
 import org.opendaylight.ovsdb.lib.table.Bridge;
 import org.opendaylight.ovsdb.lib.table.Table;
index ddb2a9beb59170c626fb19ee7c63cf7af07a270a..c06ac5fad4c049d1356e872d9be5673fb34bdfa7 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.controller.sal.core.Property;
 import org.opendaylight.controller.sal.core.UpdateType;
 import org.opendaylight.controller.sal.inventory.IPluginInInventoryService;
 import org.opendaylight.ovsdb.lib.database.DatabaseSchema;
-import org.opendaylight.ovsdb.lib.message.TableUpdates;
+import org.opendaylight.ovsdb.lib.message.temp.TableUpdates;
 import org.opendaylight.ovsdb.lib.table.Table;
 
 public interface InventoryServiceInternal extends IPluginInInventoryService {