BUG-4117: initial commit for new App Old-Notification-Supplier 38/31538/3
authorMartin Bobak <mbobak@cisco.com>
Thu, 20 Aug 2015 21:45:07 +0000 (23:45 +0200)
committerMichal Rehak <mirehak@cisco.com>
Fri, 18 Dec 2015 11:52:32 +0000 (12:52 +0100)
 - we wish to keep backward compatibilility for all old Openflow notification

Note: Original commit https://git.opendaylight.org/gerrit/#/c/25965/
      has to be broken to a chain of smaller commits

(fixed version to Be, adapt changed deps, add copyright)

Change-Id: I6a63329611a04299d09ba265077de1e12e29b4e8
Signed-off-by: Martin Bobak <mbobak@cisco.com>
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
(cherry picked from commit 9c94939ff57c2f816b2978c9b763dd971ba932d2)

14 files changed:
applications/old-notification-supplier/pom.xml [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifProvider.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifSupplierDefinition.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/package-info.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/OldNotifProviderConfig.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/package-info.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModule.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModuleFactory.java [new file with mode: 0644]
applications/old-notification-supplier/src/main/resources/initial/73-old-notification-supplier.xml [new file with mode: 0644]
applications/old-notification-supplier/src/main/yang/old-notification-supplier.yang [new file with mode: 0644]
applications/pom.xml
artifacts/pom.xml
features-li/pom.xml
features-li/src/main/features/features.xml

diff --git a/applications/old-notification-supplier/pom.xml b/applications/old-notification-supplier/pom.xml
new file mode 100644 (file)
index 0000000..a8e6c7a
--- /dev/null
@@ -0,0 +1,88 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.openflowplugin</groupId>
+        <artifactId>applications</artifactId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+    <groupId>org.opendaylight.openflowplugin.applications</groupId>
+    <artifactId>old-notification-supplier</artifactId>
+    <packaging>bundle</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin</groupId>
+            <artifactId>openflowplugin-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-broker-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller.model</groupId>
+            <artifactId>model-inventory</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin.model</groupId>
+            <artifactId>model-flow-base</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>config-api</artifactId>
+        </dependency>
+
+        <!-- Test dependencies -->
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <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-old-notification-supplier.xml</file>
+                                    <type>xml</type>
+                                    <classifier>config</classifier>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifProvider.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifProvider.java
new file mode 100644 (file)
index 0000000..5de7035
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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.old.notification.supplier;
+
+/**
+ * Project module provider interface representation
+ */
+public interface OldNotifProvider extends AutoCloseable {
+
+    /**
+     * Method is responsible for initialization and registration all Old Notification Suppliers
+     * followed by settings from ConfigSubsystem
+     */
+    void start();
+
+}
+
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifSupplierDefinition.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/OldNotifSupplierDefinition.java
new file mode 100644 (file)
index 0000000..c5b0b20
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.old.notification.supplier;
+
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Default definition for every Old Notification Supplier. Migration from old notification
+ * to {@link org.opendaylight.controller.md.sal.binding.api.DataChangeListener} has one
+ * keyed component - WildCarded Path which represent a changes checker in DataStoreTreeNode
+ *
+ * @param <O> - {@link DataObject} represent Data Tree Item from DataStore
+ */
+public interface OldNotifSupplierDefinition<O extends DataObject> extends AutoCloseable, DataChangeListener {
+
+    /**
+     * Method return wildCardPath for Listener registration and for identify
+     * the correct KeyInstanceIdentifier from Data Tree Item in DataStore;
+     *
+     * @return {@link InstanceIdentifier}
+     */
+    InstanceIdentifier<O> getWildCardPath();
+}
+
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/package-info.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/package-info.java
new file mode 100644 (file)
index 0000000..ed7b41e
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * 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
+ */
+
+/**
+ * Base project package for a module Provider and base notification listener/supplier interface
+ */
+package org.opendaylight.openflowplugin.applications.old.notification.supplier;
\ No newline at end of file
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/OldNotifProviderConfig.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/OldNotifProviderConfig.java
new file mode 100644 (file)
index 0000000..b08bccc
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * 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.old.notification.supplier.tools;
+
+/**
+ * Class is designed as ConfigSubsitem settings holder
+ */
+public class OldNotifProviderConfig {
+
+    private final boolean flowSupport;
+    private final boolean meterSupport;
+    private final boolean groupSupport;
+    private final boolean nodeConnectorStatSupport;
+    private final boolean flowTableStatSupport;
+    private final boolean groupStatSupport;
+    private final boolean meterStatSupport;
+    private final boolean queueStatSupport;
+    private final boolean flowStatSupport;
+
+    private OldNotifProviderConfig(final OldNotifProviderConfigBuilder builder) {
+        this.flowSupport = builder.isFlowSupport();
+        this.meterSupport = builder.isMeterSupport();
+        this.groupSupport = builder.isGroupSupport();
+        this.nodeConnectorStatSupport = builder.isNodeConnectorStatSupport();
+        this.flowTableStatSupport = builder.isFlowTableStatSupport();
+        this.groupStatSupport = builder.isGroupStatSupport();
+        this.meterStatSupport = builder.isMeterStatSupport();
+        this.queueStatSupport = builder.isQueueStatSupport();
+        this.flowStatSupport = builder.isFlowStatSupport();
+    }
+
+    public boolean isFlowSupport() {
+        return flowSupport;
+    }
+
+    public boolean isMeterSupport() {
+        return meterSupport;
+    }
+
+    public boolean isGroupSupport() {
+        return groupSupport;
+    }
+
+    public boolean isNodeConnectorStatSupport() {
+        return nodeConnectorStatSupport;
+    }
+
+    public boolean isFlowTableStatSupport() {
+        return flowTableStatSupport;
+    }
+
+    public boolean isGroupStatSupport() {
+        return groupStatSupport;
+    }
+
+    public boolean isMeterStatSupport() {
+        return meterStatSupport;
+    }
+
+    public boolean isQueueStatSupport() {
+        return queueStatSupport;
+    }
+
+    public boolean isFlowStatSupport() {
+        return flowStatSupport;
+    }
+
+    public static OldNotifProviderConfigBuilder builder() {
+        return new OldNotifProviderConfigBuilder();
+    }
+
+    public static class OldNotifProviderConfigBuilder {
+        private boolean flowSupport;
+        private boolean meterSupport;
+        private boolean groupSupport;
+        private boolean nodeConnectorStatSupport;
+        private boolean flowTableStatSupport;
+        private boolean groupStatSupport;
+        private boolean meterStatSupport;
+        private boolean queueStatSupport;
+        private boolean flowStatSupport;
+
+        public boolean isFlowSupport() {
+            return flowSupport;
+        }
+
+        public void setFlowSupport(final boolean flowSupport) {
+            this.flowSupport = flowSupport;
+        }
+
+        public boolean isMeterSupport() {
+            return meterSupport;
+        }
+
+        public void setMeterSupport(final boolean meterSupport) {
+            this.meterSupport = meterSupport;
+        }
+
+        public boolean isGroupSupport() {
+            return groupSupport;
+        }
+
+        public void setGroupSupport(final boolean groupSupport) {
+            this.groupSupport = groupSupport;
+        }
+
+        public boolean isNodeConnectorStatSupport() {
+            return nodeConnectorStatSupport;
+        }
+
+        public void setNodeConnectorStatSupport(final boolean nodeConnectorStatSupport) {
+            this.nodeConnectorStatSupport = nodeConnectorStatSupport;
+        }
+
+        public boolean isFlowTableStatSupport() {
+            return flowTableStatSupport;
+        }
+
+        public void setFlowTableStatSupport(final boolean flowTableStatSupport) {
+            this.flowTableStatSupport = flowTableStatSupport;
+        }
+
+        public boolean isGroupStatSupport() {
+            return groupStatSupport;
+        }
+
+        public void setGroupStatSupport(final boolean groupStatSupport) {
+            this.groupStatSupport = groupStatSupport;
+        }
+
+        public boolean isMeterStatSupport() {
+            return meterStatSupport;
+        }
+
+        public void setMeterStatSupport(final boolean meterStatSupport) {
+            this.meterStatSupport = meterStatSupport;
+        }
+
+        public boolean isQueueStatSupport() {
+            return queueStatSupport;
+        }
+
+        public void setQueueStatSupport(final boolean queueStatSupport) {
+            this.queueStatSupport = queueStatSupport;
+        }
+
+        public boolean isFlowStatSupport() {
+            return flowStatSupport;
+        }
+
+        public void setFlowStatSupport(final boolean flowStatSupport) {
+            this.flowStatSupport = flowStatSupport;
+        }
+
+        public OldNotifProviderConfig build() {
+            return new OldNotifProviderConfig(this);
+        }
+    }
+}
+
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/package-info.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/openflowplugin/applications/old/notification/supplier/tools/package-info.java
new file mode 100644 (file)
index 0000000..36515d7
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * 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 for all internal helper classes.
+ */
+package org.opendaylight.openflowplugin.applications.old.notification.supplier.tools;
\ No newline at end of file
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModule.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModule.java
new file mode 100644 (file)
index 0000000..d892283
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.old.notification.supplier.rev150820;
+
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.openflowplugin.applications.old.notification.supplier.tools.OldNotifProviderConfig;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Generated module introducer for OldNotificationSupplier Module class.
+ */
+public class OldNotifModule extends AbstractOldNotifModule {
+
+    static final Logger LOG = LoggerFactory.getLogger(OldNotifModule.class);
+
+    private static final String LOAD_SETTINGS_XML_FAIL = "Load the xml ConfigSubsystem input value fail!";
+    private static final boolean DEFAULT_ITEM_NOTIF_ALLOWED = true;
+    private static final boolean DEFAULT_STAT_NOTIF_ALLOWED = false;
+
+    /**
+     * Module constructor
+     *
+     * @param identifier - {@link ModuleIdentifier}
+     * @param dependencyResolver - {@link DependencyResolver}
+     */
+    public OldNotifModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    /**
+     * Module constructor
+     *
+     * @param identifier - {@link ModuleIdentifier}
+     * @param dependencyResolver - {@link DependencyResolver}
+     * @param oldModule - {@link OldNotifModule}
+     * @param oldInstance - {@link AutoCloseable}
+     */
+    public OldNotifModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver,
+                          final OldNotifModule oldModule, final AutoCloseable oldInstance) {
+        super(identifier, dependencyResolver, oldModule, oldInstance);
+    }
+
+    @Override
+    public void customValidation() {
+        // add custom validation form module attributes here.
+    }
+
+    @Override
+    public java.lang.AutoCloseable createInstance() {
+        LOG.info("OldNotificationSupplier module initialization.");
+        LOG.warn("OldNotificationSupplier module is marked like DEPRECATED. Modul could supplie old notification only for lithium release.");
+        final OldNotifProviderConfig config = createConfig();
+        return null;
+    }
+
+    /*
+     * Help method for populating all ConfigSubsystem values to OldNotifProviderConfig immutable value holder.
+     */
+    private OldNotifProviderConfig createConfig() {
+        final OldNotificationSupplierSettings settings = Preconditions.checkNotNull(getOldNotificationSupplierSettings());
+        final OldNotifProviderConfig.OldNotifProviderConfigBuilder builder = OldNotifProviderConfig.builder();
+        if (settings.getFlowSupport() != null) {
+            builder.setFlowSupport(settings.getFlowSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " FlowSupport value is set to {} ", DEFAULT_ITEM_NOTIF_ALLOWED);
+            builder.setFlowSupport(DEFAULT_ITEM_NOTIF_ALLOWED);
+        }
+
+        if (settings.getMeterSupport() != null) {
+            builder.setMeterSupport(settings.getMeterSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " MeterSupport value is set to {} ", DEFAULT_ITEM_NOTIF_ALLOWED);
+            builder.setMeterSupport(DEFAULT_ITEM_NOTIF_ALLOWED);
+        }
+        if (settings.getGroupSupport() != null) {
+            builder.setGroupSupport(settings.getGroupSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " GroupSupport value is set to {} ", DEFAULT_ITEM_NOTIF_ALLOWED);
+            builder.setGroupSupport(DEFAULT_ITEM_NOTIF_ALLOWED);
+        }
+        if (settings.getNodeConnectorStatSupport() != null) {
+            builder.setNodeConnectorStatSupport(settings.getNodeConnectorStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " NodeConnectorStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setNodeConnectorStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        if (settings.getFlowTableStatSupport() != null) {
+            builder.setFlowTableStatSupport(settings.getFlowTableStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " FlowTableStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setFlowTableStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        if (settings.getGroupStatSupport() != null) {
+            builder.setGroupStatSupport(settings.getGroupStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " GroupStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setGroupStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        if (settings.getMeterStatSupport() != null) {
+            builder.setMeterStatSupport(settings.getMeterStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " MeterStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setMeterStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        if (settings.getQueueStatSupport() != null) {
+            builder.setQueueStatSupport(settings.getQueueStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " QueueStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setQueueStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        if (settings.getFlowStatSupport() != null) {
+            builder.setFlowStatSupport(settings.getFlowStatSupport());
+        } else {
+            LOG.warn(LOAD_SETTINGS_XML_FAIL + " QueueStatSupport value is set to {} ", DEFAULT_STAT_NOTIF_ALLOWED);
+            builder.setFlowStatSupport(DEFAULT_STAT_NOTIF_ALLOWED);
+        }
+        return builder.build();
+    }
+}
diff --git a/applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModuleFactory.java b/applications/old-notification-supplier/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/openflow/applications/old/notification/supplier/rev150820/OldNotifModuleFactory.java
new file mode 100644 (file)
index 0000000..961ca9b
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: old-notification-supplier yang module local name: old-notification-supplier
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Fri Aug 21 00:31:49 CEST 2015
+*
+* 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.old.notification.supplier.rev150820;
+
+public class OldNotifModuleFactory
+        extends
+        org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.applications.old.notification.supplier.rev150820.AbstractOldNotifModuleFactory {
+
+}
diff --git a/applications/old-notification-supplier/src/main/resources/initial/73-old-notification-supplier.xml b/applications/old-notification-supplier/src/main/resources/initial/73-old-notification-supplier.xml
new file mode 100644 (file)
index 0000000..663bd10
--- /dev/null
@@ -0,0 +1,54 @@
+<?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:old-notification-supplier">prefix:old-notification-supplier</type>
+                    <name>old-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>
+
+                    <old-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>
+                    </old-notification-supplier-settings>
+
+                </module>
+
+            </modules>
+        </data>
+    </configuration>
+
+    <required-capabilities>
+        <capability>urn:opendaylight:params:xml:ns:yang:openflow:applications:old-notification-supplier?module=old-notification-supplier&amp;revision=2015-08-20</capability>
+        <capability>urn:opendaylight:flow:inventory?module=flow-node-inventory&amp;revision=2013-08-19</capability>
+        <capability>urn:opendaylight:inventory?module=opendaylight-inventory&amp;revision=2013-08-19</capability>
+        <capability>urn:opendaylight:flow:types?module=opendaylight-flow-types&amp;revision=2013-10-26</capability>
+    </required-capabilities>
+</snapshot>
diff --git a/applications/old-notification-supplier/src/main/yang/old-notification-supplier.yang b/applications/old-notification-supplier/src/main/yang/old-notification-supplier.yang
new file mode 100644 (file)
index 0000000..76a4584
--- /dev/null
@@ -0,0 +1,83 @@
+module old-notification-supplier {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:openflow:applications:old-notification-supplier";
+    prefix "old-notif";
+    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 DataChangeEvent to Old Notifications.";
+
+    revision "2015-08-20" {
+        description
+            "Initial revision";
+    }
+
+    identity old-notification-supplier {
+        base "config:module-type";
+        config:java-name-prefix OldNotif;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case old-notification-supplier {
+            when "/config:modules/config:module/config:type = 'old-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 old-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;
+                }
+            }
+        }
+    }
+}
index d95aaaa3be21ba07913f99d96373b0636c249fc4..5604340f8c7b63bf1b633a75dfe3b85c03aaa1bb 100644 (file)
@@ -87,6 +87,8 @@
         <module>table-miss-enforcer</module>
         <module>of-switch-config-pusher</module>
         <module>lldp-speaker</module>
+        <!-- deprecated apps -->
+        <module>old-notification-supplier</module>
         <!-- nsf apps -->
         <module>inventory-manager</module>
         <module>statistics-manager</module>
index f390cd8ab0af65b9487818c77fb321d1ce5b1c03..4c509c91221d1af02fc585e212e5f2d1248582de 100644 (file)
                 <type>xml</type>
                 <classifier>config</classifier>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}.applications</groupId>
+                <artifactId>old-notification-supplier</artifactId>
+                <version>${project.version}</version>
+                <type>xml</type>
+                <classifier>config</classifier>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}.applications</groupId>
+                <artifactId>old-notification-supplier</artifactId>
+                <version>${project.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
 </project>
index e4c864cd90d8b265af5e49a03c036a0f5a3562c9..5991abfee24c808d425c4509e55f218a1b98c838 100644 (file)
             <type>xml</type>
             <classifier>config</classifier>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin.applications</groupId>
+            <artifactId>old-notification-supplier</artifactId>
+            <type>xml</type>
+            <classifier>config</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.openflowplugin.applications</groupId>
+            <artifactId>old-notification-supplier</artifactId>
+        </dependency>
     </dependencies>
 </project>
index 613c91b3239e513dd34875cd10d6248576335ee8..6a3bde96c33ea5e79e3c282b91b9ca5f96498f27 100644 (file)
         <configfile finalname="etc/opendaylight/karaf/71-bulk-o-matic.xml">mvn:org.opendaylight.openflowplugin.applications/bulk-o-matic/${project.version}/xml/config</configfile>
     </feature>
 
+    <feature name='odl-openflowplugin-old-notifications-li' description="OpenDaylight :: Openflow Plugin :: app old notifications supplier" version='${project.version}'>
+        <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+        <feature version="${project.version}">odl-openflowplugin-nsf-model-li</feature>
+        <bundle>mvn:org.opendaylight.openflowplugin.applications/old-notification-supplier/{{VERSION}}</bundle>
+        <configfile finalname="etc/opendaylight/karaf/73-old-notification-supplier.xml">mvn:org.opendaylight.openflowplugin.applications/old-notification-supplier/{{VERSION}}/xml/config</configfile>
+    </feature>
+
 </features>