Explictly cleanup all the bridges managed by the node
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / OvsdbMonitorCallback.java
index 1a0b8a9d93266242d46ab80e6b0d4de9a406303e..28a35f7cdcf4240500437fd07fa25251b3d96eba 100644 (file)
@@ -1,23 +1,41 @@
+/*
+ * Copyright (c) 2015 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.ovsdb.southbound;
 
 import org.opendaylight.ovsdb.lib.MonitorCallBack;
 import org.opendaylight.ovsdb.lib.message.TableUpdates;
 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
+import org.opendaylight.ovsdb.southbound.transactions.md.OvsdbOperationalCommandAggregator;
+import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvoker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class OvsdbMonitorCallback implements MonitorCallBack {
 
     private static final Logger LOG = LoggerFactory.getLogger(OvsdbMonitorCallback.class);
+    private TransactionInvoker txInvoker;
+    private OvsdbConnectionInstance key;
+
+    OvsdbMonitorCallback(OvsdbConnectionInstance key,TransactionInvoker txInvoker) {
+        this.txInvoker = txInvoker;
+        this.key = key;
+    }
+
     @Override
     public void update(TableUpdates result, DatabaseSchema dbSchema) {
         LOG.debug("result: {} dbSchema: {}",result,dbSchema);
-
+        txInvoker.invoke(new OvsdbOperationalCommandAggregator(key, result, dbSchema));
+        LOG.trace("update exit");
     }
 
     @Override
-    public void exception(Throwable t) {
-        LOG.warn("exception {}",t);
+    public void exception(Throwable exception) {
+        LOG.warn("exception {}", exception);
     }
 
 }