From: GauravBhagwani Date: Thu, 13 Oct 2016 08:09:34 +0000 (+0530) Subject: Bug: 6930 Notiifcation-suppliers was broken X-Git-Tag: release/carbon~130 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=1d3428691ff8274b04891527201e4d73da6d847f;p=openflowplugin.git Bug: 6930 Notiifcation-suppliers was broken Review contains changes required for making notification-supplier as per Blueprint Injection method - Removed Config Subsystem parts - Yang, Config XML, Modules/ModuleFactory - Added Blueprint XML for notification-supplier - Removed Config Dependency from features Pom - Removed references to Config XML Change-Id: Ifbdcb21140903a668ad0b8dd6e2df666b7e3e37f Signed-off-by: GauravBhagwani --- diff --git a/applications/notification-supplier/pom.xml b/applications/notification-supplier/pom.xml index bb05f4e414..9f2ece2e9b 100644 --- a/applications/notification-supplier/pom.xml +++ b/applications/notification-supplier/pom.xml @@ -36,11 +36,6 @@ org.opendaylight.openflowplugin.model model-flow-base - - org.opendaylight.controller - config-api - - org.opendaylight.openflowplugin openflowplugin-common @@ -64,29 +59,6 @@ org.opendaylight.yangtools yang-maven-plugin - - - org.codehaus.mojo - build-helper-maven-plugin - - - attach-artifacts - - attach-artifact - - package - - - - ${project.build.directory}/classes/initial/73-notification-supplier.xml - xml - config - - - - - - diff --git a/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java b/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java index 7b650cdaef..9accc250e3 100644 --- a/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java +++ b/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProvider.java @@ -8,16 +8,153 @@ package org.opendaylight.openflowplugin.applications.notification.supplier; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.NodeConnectorNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.NodeNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.FlowNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.GroupNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.MeterNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.FlowStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.FlowTableStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.GroupStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.MeterStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.NodeConnectorStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.QueueStatNotificationSupplierImpl; +import org.opendaylight.openflowplugin.applications.notification.supplier.tools.NotificationProviderConfig; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate; +import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics; +import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded; +import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved; +import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdated; +import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatistics; +import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate; +import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.flow.capable.node.connector.statistics.FlowCapableNodeConnectorStatistics; +import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.FlowCapableNodeConnectorQueueStatisticsData; +import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate; + /** - * Project module provider interface representation + * Provider Implementation */ -public interface NotificationProvider extends AutoCloseable { +public class NotificationProvider implements AutoCloseable { + + private final DataBroker db; + private final NotificationProviderConfig config; + private final NotificationProviderService nps; + + /* Supplier List property help for easy close method implementation and testing */ + private List> supplierList; + private NotificationSupplierForItemRoot nodeSupp; + private NotificationSupplierForItemRoot connectorSupp; + private NotificationSupplierForItem flowSupp; + private NotificationSupplierForItem meterSupp; + private NotificationSupplierForItem groupSupp; + private NotificationSupplierForItemStat connectorStatSupp; + private NotificationSupplierForItemStat flowStatSupp; + private NotificationSupplierForItemStat flowTableStatSupp; + private NotificationSupplierForItemStat meterStatSupp; + private NotificationSupplierForItemStat groupStatSupp; + private NotificationSupplierForItemStat queueStatSupp; /** - * Method is responsible for initialization and registration all Notification Suppliers - * followed by settings from ConfigSubsystem + * Provider constructor set all needed final parameters + * @param nps - notifProviderService + * @param db - dataBroker + * @param flowSupp - Flow Support Flag + * @param meterSupp - Meter Support Flag + * @param groupSupp - Group Support Flag + * @param connectorStatSupp - Connector Stat Support Flag + * @param flowStatSupp - Flow Stat Support Flag + * @param flowTableStatSupp - Flow Table Stat Support Flag + * @param meterStatSupp - Meter Stat Support Flag + * @param groupStatSupp - Group Stat Support Flag + * @param queueStatSupp - Queue Stat Support Flag */ - void start(); + public NotificationProvider(final NotificationProviderService nps, final DataBroker db, + boolean flowSupp, boolean meterSupp, boolean groupSupp, + boolean connectorStatSupp, boolean flowStatSupp, boolean flowTableStatSupp, + boolean meterStatSupp, boolean groupStatSupp, boolean queueStatSupp) { + this.nps = Preconditions.checkNotNull(nps); + this.db = Preconditions.checkNotNull(db); + this.config = initializeNotificationProviderConfig(flowSupp, meterSupp, groupSupp, connectorStatSupp, flowStatSupp, + flowTableStatSupp, meterStatSupp, groupStatSupp, queueStatSupp); + } + + /** + * Method to initialize NotificationProviderConfig + */ + private NotificationProviderConfig initializeNotificationProviderConfig(boolean flowSupp, boolean meterSupp, boolean groupSupp, + boolean connectorStatSupp, boolean flowStatSupp, boolean flowTableStatSupp, + boolean meterStatSupp, boolean groupStatSupp, boolean queueStatSupp){ + NotificationProviderConfig.NotificationProviderConfigBuilder notif = + new NotificationProviderConfig.NotificationProviderConfigBuilder(); + notif.setFlowSupport(flowSupp); + notif.setMeterSupport(meterSupp); + notif.setGroupSupport(groupSupp); + notif.setNodeConnectorStatSupport(connectorStatSupp); + notif.setFlowStatSupport(flowStatSupp); + notif.setFlowTableStatSupport(flowTableStatSupp); + notif.setMeterStatSupport(meterStatSupp); + notif.setGroupStatSupport(groupStatSupp); + notif.setQueueStatSupport(queueStatSupp); + return notif.build(); + } + + public void start() { + nodeSupp = new NodeNotificationSupplierImpl(nps, db); + connectorSupp = new NodeConnectorNotificationSupplierImpl(nps, db); + flowSupp = config.isFlowSupport() ? new FlowNotificationSupplierImpl(nps, db) : null; + meterSupp = config.isMeterSupport() ? new MeterNotificationSupplierImpl(nps, db) : null; + groupSupp = config.isGroupSupport() ? new GroupNotificationSupplierImpl(nps, db) : null; + connectorStatSupp = config.isNodeConnectorStatSupport() ? new NodeConnectorStatNotificationSupplierImpl(nps, db) : null; + flowStatSupp = config.isFlowStatSupport() ? new FlowStatNotificationSupplierImpl(nps, db) : null; + flowTableStatSupp = config.isFlowTableStatSupport() ? new FlowTableStatNotificationSupplierImpl(nps, db) : null; + meterStatSupp = config.isMeterStatSupport() ? new MeterStatNotificationSupplierImpl(nps, db) : null; + groupStatSupp = config.isGroupStatSupport() ? new GroupStatNotificationSupplierImpl(nps, db) : null; + queueStatSupp = config.isQueueStatSupport() ? new QueueStatNotificationSupplierImpl(nps, db) : null; + + supplierList = new ArrayList<>(Arrays.asList(nodeSupp, connectorSupp, flowSupp, meterSupp, groupSupp, + connectorStatSupp, flowStatSupp, flowTableStatSupp, meterStatSupp, groupStatSupp, queueStatSupp)); + } + + @Override + public void close() throws Exception { + for (NotificationSupplierDefinition supplier : supplierList) { + if (supplier != null) { + supplier.close(); + supplier = null; + } + } + } + @VisibleForTesting + List> getSupplierList() { + return supplierList; + } } diff --git a/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImpl.java b/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImpl.java deleted file mode 100644 index de2a34fcf2..0000000000 --- a/applications/notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImpl.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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.openflowplugin.applications.notification.supplier; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import org.opendaylight.controller.md.sal.binding.api.DataBroker; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.NodeConnectorNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.NodeNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.FlowNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.GroupNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.MeterNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.FlowStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.FlowTableStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.GroupStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.MeterStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.NodeConnectorStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.impl.item.stat.QueueStatNotificationSupplierImpl; -import org.opendaylight.openflowplugin.applications.notification.supplier.tools.NotificationProviderConfig; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.FlowsStatisticsUpdate; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.statistics.rev130819.flow.statistics.FlowStatistics; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.FlowTableStatisticsUpdate; -import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev131215.flow.table.statistics.FlowTableStatistics; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupRemoved; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.GroupStatisticsUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics; -import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved; -import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterAdded; -import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved; -import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.MeterStatisticsUpdated; -import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.statistics.rev131111.nodes.node.meter.MeterStatistics; -import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.NodeConnectorStatisticsUpdate; -import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.flow.capable.node.connector.statistics.FlowCapableNodeConnectorStatistics; -import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.FlowCapableNodeConnectorQueueStatisticsData; -import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.QueueStatisticsUpdate; - -/** - * Provider Implementation - */ -public class NotificationProviderImpl implements NotificationProvider { - - private final DataBroker db; - private final NotificationProviderConfig config; - private final NotificationProviderService nps; - - /* Supplier List property help for easy close method implementation and testing */ - private List> supplierList; - private NotificationSupplierForItemRoot nodeSupp; - private NotificationSupplierForItemRoot connectorSupp; - private NotificationSupplierForItem flowSupp; - private NotificationSupplierForItem meterSupp; - private NotificationSupplierForItem groupSupp; - private NotificationSupplierForItemStat connectorStatSupp; - private NotificationSupplierForItemStat flowStatSupp; - private NotificationSupplierForItemStat flowTableStatSupp; - private NotificationSupplierForItemStat meterStatSupp; - private NotificationSupplierForItemStat groupStatSupp; - private NotificationSupplierForItemStat queueStatSupp; - - /** - * Provider constructor set all needed final parameters - * - * @param config - Configuration Object - * @param nps - notifProviderService - * @param db - dataBroker - */ - public NotificationProviderImpl(final NotificationProviderConfig config, - final NotificationProviderService nps, final DataBroker db) { - this.config = Preconditions.checkNotNull(config); - this.db = Preconditions.checkNotNull(db); - this.nps = Preconditions.checkNotNull(nps); - } - - @Override - public void start() { - nodeSupp = new NodeNotificationSupplierImpl(nps, db); - connectorSupp = new NodeConnectorNotificationSupplierImpl(nps, db); - flowSupp = config.isFlowSupport() ? new FlowNotificationSupplierImpl(nps, db) : null; - meterSupp = config.isMeterSupport() ? new MeterNotificationSupplierImpl(nps, db) : null; - groupSupp = config.isGroupSupport() ? new GroupNotificationSupplierImpl(nps, db) : null; - connectorStatSupp = config.isNodeConnectorStatSupport() ? new NodeConnectorStatNotificationSupplierImpl(nps, db) : null; - flowStatSupp = config.isFlowStatSupport() ? new FlowStatNotificationSupplierImpl(nps, db) : null; - flowTableStatSupp = config.isFlowTableStatSupport() ? new FlowTableStatNotificationSupplierImpl(nps, db) : null; - meterStatSupp = config.isMeterStatSupport() ? new MeterStatNotificationSupplierImpl(nps, db) : null; - groupStatSupp = config.isGroupStatSupport() ? new GroupStatNotificationSupplierImpl(nps, db) : null; - queueStatSupp = config.isQueueStatSupport() ? new QueueStatNotificationSupplierImpl(nps, db) : null; - - supplierList = new ArrayList<>(Arrays.asList(nodeSupp, connectorSupp, flowSupp, meterSupp, groupSupp, - connectorStatSupp, flowStatSupp, flowTableStatSupp, meterStatSupp, groupStatSupp, queueStatSupp)); - } - - @Override - public void close() throws Exception { - for (NotificationSupplierDefinition supplier : supplierList) { - if (supplier != null) { - supplier.close(); - supplier = null; - } - } - } - - @VisibleForTesting - List> getSupplierList() { - return supplierList; - } -} - diff --git a/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModule.java b/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModule.java deleted file mode 100644 index 00c774cc16..0000000000 --- a/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModule.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.notification.supplier.rev150820; -public class NotifModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.notification.supplier.rev150820.AbstractNotifModule { - public NotifModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public NotifModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.notification.supplier.rev150820.NotifModule oldModule, java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - // TODO:implement - throw new java.lang.UnsupportedOperationException(); - } - -} diff --git a/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModuleFactory.java b/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModuleFactory.java deleted file mode 100644 index fcb8094d65..0000000000 --- a/applications/notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/notification/supplier/rev150820/NotifModuleFactory.java +++ /dev/null @@ -1,13 +0,0 @@ -/* -* Generated file -* -* Generated from: yang module name: notification-supplier yang module local name: notification-supplier -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Sun May 22 10:45:47 IST 2016 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.notification.supplier.rev150820; -public class NotifModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.notification.supplier.rev150820.AbstractNotifModuleFactory { - -} diff --git a/applications/notification-supplier/src/main/resources/initial/73-notification-supplier.xml b/applications/notification-supplier/src/main/resources/initial/73-notification-supplier.xml deleted file mode 100644 index 5b47dc9381..0000000000 --- a/applications/notification-supplier/src/main/resources/initial/73-notification-supplier.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - prefix:notification-supplier - notification-supplier - - binding:binding-async-data-broker - binding-data-broker - - - - binding:binding-notification-service - - binding-notification-broker - - - - - - true - true - false - false - false - false - false - false - - - - - - - - - - urn:opendaylight:params:xml:ns:yang:openflow:applications:notification-supplier?module=notification-supplier&revision=2015-08-20 - urn:opendaylight:flow:inventory?module=flow-node-inventory&revision=2013-08-19 - urn:opendaylight:inventory?module=opendaylight-inventory&revision=2013-08-19 - urn:opendaylight:flow:types?module=opendaylight-flow-types&revision=2013-10-26 - - diff --git a/applications/notification-supplier/src/main/resources/org/opendaylight/blueprint/notification-supplier.xml b/applications/notification-supplier/src/main/resources/org/opendaylight/blueprint/notification-supplier.xml new file mode 100644 index 0000000000..2cad558103 --- /dev/null +++ b/applications/notification-supplier/src/main/resources/org/opendaylight/blueprint/notification-supplier.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/applications/notification-supplier/src/main/yang/notification-supplier.yang b/applications/notification-supplier/src/main/yang/notification-supplier.yang deleted file mode 100644 index 1508456c36..0000000000 --- a/applications/notification-supplier/src/main/yang/notification-supplier.yang +++ /dev/null @@ -1,83 +0,0 @@ -module notification-supplier { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:openflow:applications:notification-supplier"; - prefix "notification"; - import config {prefix config; revision-date 2013-04-05;} - import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28;} - - description - "Translator tool for relevant wildcard path DataTreeModification to Notifications."; - - revision "2015-08-20" { - description - "Initial revision"; - } - - identity notification-supplier { - base "config:module-type"; - config:java-name-prefix Notif; - } - - augment "/config:modules/config:module/config:configuration" { - case notification-supplier { - when "/config:modules/config:module/config:type = 'notification-supplier'"; - - container notification-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity mdsal:binding-notification-service; - } - } - } - - container data-broker { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity mdsal:binding-async-data-broker; - } - } - } - - container notification-supplier-settings { - leaf flow-support { - type boolean; - default true; - } - leaf meter-support { - type boolean; - default true; - } - leaf group-support { - type boolean; - default true; - } - leaf node-connector-stat-support { - type boolean; - default false; - } - leaf flow-table-stat-support { - type boolean; - default false; - } - leaf group-stat-support { - type boolean; - default false; - } - leaf meter-stat-support { - type boolean; - default false; - } - leaf queue-stat-support { - type boolean; - default false; - } - leaf flow-stat-support { - type boolean; - default false; - } - } - } - } -} diff --git a/applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImplTest.java b/applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderTest.java similarity index 73% rename from applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImplTest.java rename to applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderTest.java index 03251905c4..6592a20304 100644 --- a/applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderImplTest.java +++ b/applications/notification-supplier/src/test/java/org/opendaylight/openflowplugin/applications/notification/supplier/NotificationProviderTest.java @@ -18,7 +18,7 @@ import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.openflowplugin.applications.notification.supplier.tools.NotificationProviderConfig; import org.opendaylight.openflowplugin.applications.notification.supplier.tools.NotificationProviderConfig.NotificationProviderConfigBuilder; -public class NotificationProviderImplTest { +public class NotificationProviderTest { private NotificationProviderService notificationProviderService; private NotificationProviderConfig config; @@ -33,7 +33,10 @@ public class NotificationProviderImplTest { @Test public void testCreateAllSuppliers() { final NotificationProviderConfig config = createAllConfigSupplier(); - final NotificationProviderImpl provider = new NotificationProviderImpl(config, notificationProviderService, dataBroker); + final NotificationProvider provider = new NotificationProvider(notificationProviderService, dataBroker, config.isFlowSupport(), config.isMeterSupport(), + config.isGroupSupport(), config.isNodeConnectorStatSupport(), config.isFlowStatSupport(), + config.isFlowTableStatSupport(), config.isMeterStatSupport(), config.isGroupStatSupport(), + config.isQueueStatSupport()); provider.start(); final List> listSuppliers = provider.getSupplierList(); int nrOfSuppliers = 0; @@ -48,7 +51,10 @@ public class NotificationProviderImplTest { @Test public void testCreateRootSuppliersOnly() { final NotificationProviderConfig config = createNonConfigSupplier(); - final NotificationProviderImpl provider = new NotificationProviderImpl(config, notificationProviderService, dataBroker); + final NotificationProvider provider = new NotificationProvider(notificationProviderService, dataBroker, config.isFlowSupport(), config.isMeterSupport(), + config.isGroupSupport(), config.isNodeConnectorStatSupport(), config.isFlowStatSupport(), + config.isFlowTableStatSupport(), config.isMeterStatSupport(), config.isGroupStatSupport(), + config.isQueueStatSupport()); provider.start(); final List> listSuppliers = provider.getSupplierList(); int nrOfSuppliers = 0; diff --git a/features/pom.xml b/features/pom.xml index 258d360cea..0481b82f24 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -271,12 +271,6 @@ org.opendaylight.openflowplugin.applications bulk-o-matic - - org.opendaylight.openflowplugin.applications - notification-supplier - xml - config - org.opendaylight.openflowplugin.applications notification-supplier diff --git a/features/src/main/features/features.xml b/features/src/main/features/features.xml index 4a17a37b37..759b551dc8 100644 --- a/features/src/main/features/features.xml +++ b/features/src/main/features/features.xml @@ -97,7 +97,6 @@ odl-openflowplugin-southbound mvn:org.opendaylight.openflowplugin.applications/notification-supplier/{{VERSION}} - mvn:org.opendaylight.openflowplugin.applications/notification-supplier/{{VERSION}}/xml/config