2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.ovsdb.southbound;
10 import org.opendaylight.ovsdb.lib.MonitorCallBack;
11 import org.opendaylight.ovsdb.lib.message.TableUpdates;
12 import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
13 import org.opendaylight.ovsdb.southbound.transactions.md.OvsdbOperationalCommandAggregator;
14 import org.opendaylight.ovsdb.southbound.transactions.md.TransactionInvoker;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class OvsdbMonitorCallback implements MonitorCallBack {
20 private static final Logger LOG = LoggerFactory.getLogger(OvsdbMonitorCallback.class);
21 private TransactionInvoker txInvoker;
22 private OvsdbConnectionInstance key;
24 OvsdbMonitorCallback(OvsdbConnectionInstance key,TransactionInvoker txInvoker) {
25 this.txInvoker = txInvoker;
30 public void update(TableUpdates result, DatabaseSchema dbSchema) {
31 LOG.debug("result: {} dbSchema: {}",result,dbSchema);
32 txInvoker.invoke(new OvsdbOperationalCommandAggregator(key, result, dbSchema));
33 LOG.trace("update exit");
37 public void exception(Throwable exception) {
38 LOG.warn("exception {}", exception);