<groupId>org.opendaylight.openflowplugin.model</groupId>
<artifactId>model-flow-base</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-api</artifactId>
- </dependency>
-
<dependency>
<groupId>org.opendaylight.openflowplugin</groupId>
<artifactId>openflowplugin-common</artifactId>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-maven-plugin</artifactId>
</plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/classes/initial/73-notification-supplier.xml</file>
- <type>xml</type>
- <classifier>config</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
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<NotificationSupplierDefinition<?>> supplierList;
+ private NotificationSupplierForItemRoot<FlowCapableNode, NodeUpdated, NodeRemoved> nodeSupp;
+ private NotificationSupplierForItemRoot<FlowCapableNodeConnector, NodeConnectorUpdated, NodeConnectorRemoved> connectorSupp;
+ private NotificationSupplierForItem<Flow, FlowAdded, FlowUpdated, FlowRemoved> flowSupp;
+ private NotificationSupplierForItem<Meter, MeterAdded, MeterUpdated, MeterRemoved> meterSupp;
+ private NotificationSupplierForItem<Group, GroupAdded, GroupUpdated, GroupRemoved> groupSupp;
+ private NotificationSupplierForItemStat<FlowCapableNodeConnectorStatistics, NodeConnectorStatisticsUpdate> connectorStatSupp;
+ private NotificationSupplierForItemStat<FlowStatistics, FlowsStatisticsUpdate> flowStatSupp;
+ private NotificationSupplierForItemStat<FlowTableStatistics, FlowTableStatisticsUpdate> flowTableStatSupp;
+ private NotificationSupplierForItemStat<MeterStatistics, MeterStatisticsUpdated> meterStatSupp;
+ private NotificationSupplierForItemStat<GroupStatistics, GroupStatisticsUpdated> groupStatSupp;
+ private NotificationSupplierForItemStat<FlowCapableNodeConnectorQueueStatisticsData, QueueStatisticsUpdate> 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<NotificationSupplierDefinition<?>> getSupplierList() {
+ return supplierList;
+ }
}
+++ /dev/null
-/*
- * 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<NotificationSupplierDefinition<?>> supplierList;
- private NotificationSupplierForItemRoot<FlowCapableNode, NodeUpdated, NodeRemoved> nodeSupp;
- private NotificationSupplierForItemRoot<FlowCapableNodeConnector, NodeConnectorUpdated, NodeConnectorRemoved> connectorSupp;
- private NotificationSupplierForItem<Flow, FlowAdded, FlowUpdated, FlowRemoved> flowSupp;
- private NotificationSupplierForItem<Meter, MeterAdded, MeterUpdated, MeterRemoved> meterSupp;
- private NotificationSupplierForItem<Group, GroupAdded, GroupUpdated, GroupRemoved> groupSupp;
- private NotificationSupplierForItemStat<FlowCapableNodeConnectorStatistics, NodeConnectorStatisticsUpdate> connectorStatSupp;
- private NotificationSupplierForItemStat<FlowStatistics, FlowsStatisticsUpdate> flowStatSupp;
- private NotificationSupplierForItemStat<FlowTableStatistics, FlowTableStatisticsUpdate> flowTableStatSupp;
- private NotificationSupplierForItemStat<MeterStatistics, MeterStatisticsUpdated> meterStatSupp;
- private NotificationSupplierForItemStat<GroupStatistics, GroupStatisticsUpdated> groupStatSupp;
- private NotificationSupplierForItemStat<FlowCapableNodeConnectorQueueStatisticsData, QueueStatisticsUpdate> 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<NotificationSupplierDefinition<?>> getSupplierList() {
- return supplierList;
- }
-}
-
+++ /dev/null
-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();
- }
-
-}
+++ /dev/null
-/*
-* 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 {
-
-}
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2014 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
--->
-
-<snapshot>
- <configuration>
- <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
- <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflow:applications:notification-supplier">prefix:notification-supplier</type>
- <name>notification-supplier</name>
- <data-broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <name>binding-data-broker</name>
- </data-broker>
- <notification-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
- binding:binding-notification-service
- </type>
- <name>binding-notification-broker</name>
- </notification-service>
-
- <notification-supplier-settings>
- <!--<port-support>true</port-support>-->
- <!--<flow-support>true</flow-support>-->
- <meter-support>true</meter-support>
- <group-support>true</group-support>
- <node-connector-stat-support>false</node-connector-stat-support>
- <flow-table-stat-support>false</flow-table-stat-support>
- <group-stat-support>false</group-stat-support>
- <meter-stat-support>false</meter-stat-support>
- <queue-stat-support>false</queue-stat-support>
- <flow-stat-support>false</flow-stat-support>
- </notification-supplier-settings>
-
- </module>
-
- </modules>
- </data>
- </configuration>
-
- <required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:openflow:applications:notification-supplier?module=notification-supplier&revision=2015-08-20</capability>
- <capability>urn:opendaylight:flow:inventory?module=flow-node-inventory&revision=2013-08-19</capability>
- <capability>urn:opendaylight:inventory?module=opendaylight-inventory&revision=2013-08-19</capability>
- <capability>urn:opendaylight:flow:types?module=opendaylight-flow-types&revision=2013-10-26</capability>
- </required-capabilities>
-</snapshot>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
+
+ <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+
+ <reference id="NotificationProviderService" interface="org.opendaylight.controller.sal.binding.api.NotificationProviderService"/>
+
+ <bean id="NotificationProvider" class="org.opendaylight.openflowplugin.applications.notification.supplier.NotificationProvider"
+ init-method="start" destroy-method="close">
+ <argument ref="NotificationProviderService"/>
+ <argument ref="dataBroker"/>
+ <!-- Flow Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Meter Support Flag, default is true -->
+ <argument value="true"/>
+ <!-- Group Support Flag, default is true -->
+ <argument value="true"/>
+ <!-- Connector Stat Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Flow Stat Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Flow Table Stat Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Meter Stat Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Group Stat Support Flag, default is false -->
+ <argument value="false"/>
+ <!-- Queue Stat Support Flag, default is false -->
+ <argument value="false"/>
+
+ </bean>
+</blueprint>
\ No newline at end of file
+++ /dev/null
-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;
- }
- }
- }
- }
-}
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;
@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<NotificationSupplierDefinition<?>> listSuppliers = provider.getSupplierList();
int nrOfSuppliers = 0;
@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<NotificationSupplierDefinition<?>> listSuppliers = provider.getSupplierList();
int nrOfSuppliers = 0;
<groupId>org.opendaylight.openflowplugin.applications</groupId>
<artifactId>bulk-o-matic</artifactId>
</dependency>
- <dependency>
- <groupId>org.opendaylight.openflowplugin.applications</groupId>
- <artifactId>notification-supplier</artifactId>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<groupId>org.opendaylight.openflowplugin.applications</groupId>
<artifactId>notification-supplier</artifactId>
<feature name='odl-openflowplugin-app-notifications' description="OpenDaylight :: Openflow Plugin :: Application - notifications supplier" version='${project.version}'>
<feature version="${project.version}">odl-openflowplugin-southbound</feature>
<bundle>mvn:org.opendaylight.openflowplugin.applications/notification-supplier/{{VERSION}}</bundle>
- <configfile finalname="etc/opendaylight/karaf/73-notification-supplier.xml">mvn:org.opendaylight.openflowplugin.applications/notification-supplier/{{VERSION}}/xml/config</configfile>
</feature>
<feature name='odl-openflowplugin-app-forwardingrules-manager' description="OpenDaylight :: Openflow Plugin :: Application - FRM" version='${project.version}'>