import org.opendaylight.ovsdb.plugin.impl.InventoryServiceImpl;
import org.osgi.framework.BundleContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* OVSDB protocol plugin Activator
*
*/
public class Activator extends DependencyActivatorBase {
- protected static final Logger logger = LoggerFactory
- .getLogger(Activator.class);
@Override
public void init(BundleContext context, DependencyManager manager) throws Exception {
public void init() {
if ( this.callback == null) {
- txInvoker.invoke(new OvsdbNodeCreateCommand(key, null,null));
- this.callback = new OvsdbMonitorCallback(connectionInfo,txInvoker);
try {
List<String> databases = getDatabases().get();
if (databases != null) {
DatabaseSchema dbSchema = getSchema(database).get();
if (dbSchema != null) {
transactInvokers.put(dbSchema, new TransactInvokerImpl(this,dbSchema));
+ }
+ }
+ txInvoker.invoke(new OvsdbNodeCreateCommand(key, null,null));
+ this.callback = new OvsdbMonitorCallback(connectionInfo,txInvoker);
+ for (String database : databases) {
+ DatabaseSchema dbSchema = getSchema(database).get();
+ if (dbSchema != null) {
monitorAllTables(database, dbSchema);
} else {
LOG.warn("No schema reported for database {} for key {}",database,connectionInfo);