X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=southbound%2Fsouthbound-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fovsdb%2Fsouthbound%2FOvsdbMonitorCallback.java;h=28a35f7cdcf4240500437fd07fa25251b3d96eba;hb=582e717190867d42b473896c0544bae580989301;hp=ea50e9e73f587c7307bbcb0ce70f5da7115c020b;hpb=cbc195ca49f01ba99fa0b28f8e06ef868e665613;p=ovsdb.git diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbMonitorCallback.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbMonitorCallback.java index ea50e9e73..28a35f7cd 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbMonitorCallback.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbMonitorCallback.java @@ -8,37 +8,34 @@ package org.opendaylight.ovsdb.southbound; import org.opendaylight.ovsdb.lib.MonitorCallBack; -import org.opendaylight.ovsdb.lib.message.TableUpdate; import org.opendaylight.ovsdb.lib.message.TableUpdates; -import org.opendaylight.ovsdb.lib.notation.Row; -import org.opendaylight.ovsdb.lib.notation.UUID; -import org.opendaylight.ovsdb.lib.schema.ColumnSchema; import org.opendaylight.ovsdb.lib.schema.DatabaseSchema; -import org.opendaylight.ovsdb.lib.schema.GenericTableSchema; +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); - GenericTableSchema bridge = dbSchema.table("Bridge", GenericTableSchema.class); - ColumnSchema name = bridge.column("name", String.class); - TableUpdate update = result.getUpdate(bridge); - if (update != null) { - for (UUID uuid : update.getRows().keySet()) { - Row schemaRow = update.getNew(uuid); - String bridgeName = schemaRow.getColumn(name).getData(); - LOG.trace("Bridge name: {}", bridgeName); - } - } + 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); } }