<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <relativePath>../../opendaylight/config/config-parent/pom.xml</relativePath>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ <relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>ntfbenchmark</artifactId>
<version>1.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>benchmark-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-core-api</artifactId>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-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
--->
-<snapshot>
- <required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:ntfbenchmark:impl?module=ntfbenchmark-impl&revision=2014-12-10</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
- </required-capabilities>
- <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:ntfbenchmark:impl">prefix:ntfbenchmark</type>
- <name>ntfbenchmark-default</name>
- <broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
- <name>binding-osgi-broker</name>
- </broker>
- <publish-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-publish-service</type>
- <name>binding-notification-publish-adapter</name>
- </publish-service>
- <listen-service>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
- <name>binding-notification-adapter</name>
- </listen-service>
- </module>
- </modules>
- </data>
- </configuration>
-</snapshot>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>ntfbenchmark</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <localCopy>true</localCopy>
- </snapshot>
- <lastUpdated>20151113053911</lastUpdated>
- <snapshotVersions>
- <snapshotVersion>
- <classifier>config</classifier>
- <extension>xml</extension>
- <value>1.1.0-SNAPSHOT</value>
- <updated>20151113053911</updated>
- </snapshotVersion>
- </snapshotVersions>
- </versioning>
-</metadata>
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
-
import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.NtfbenchmarkService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput.ProducerType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class NtfbenchmarkProvider implements BindingAwareProvider, AutoCloseable, NtfbenchmarkService {
+public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService {
private static final Logger LOG = LoggerFactory.getLogger(NtfbenchmarkProvider.class);
- private NotificationService listenService;
- private NotificationPublishService publishService;
+ private final NotificationService listenService;
+ private final NotificationPublishService publishService;
private static final int testTimeout = 5;
public NtfbenchmarkProvider(final NotificationService listenServiceDependency,
publishService = publishServiceDependency;
}
- @Override
- public void onSessionInitiated(final ProviderContext session) {
- LOG.debug("NtfbenchmarkProvider Session Initiated");
- session.addRpcImplementation(NtfbenchmarkService.class, this);
+ public void init() {
+ LOG.info("NtfbenchmarkProvider initiated");
}
@Override
public void close() throws Exception {
- LOG.debug("NtfbenchmarkProvider Closed");
+ LOG.info("NtfbenchmarkProvider closed");
}
@Override
.setListenerOk(allListeners)
.setProducerOk(allProducersOk)
.setProducerError(allProducersError)
- .setProducerRate(((allProducersOk + allProducersError) * 1000000000) / producerElapsedTime)
- .setListenerRate((allListeners * 1000000000) / listenerElapsedTime)
+ .setProducerRate((allProducersOk + allProducersError) * 1000000000 / producerElapsedTime)
+ .setListenerRate(allListeners * 1000000000 / listenerElapsedTime)
.build();
return RpcResultBuilder.success(output).buildFuture();
} finally {
+++ /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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210;
-
-import ntfbenchmark.impl.NtfbenchmarkProvider;
-
-public class NtfbenchmarkModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210.AbstractNtfbenchmarkModule {
- public NtfbenchmarkModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
- super(identifier, dependencyResolver);
- }
-
- public NtfbenchmarkModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210.NtfbenchmarkModule oldModule, final 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() {
- NtfbenchmarkProvider provider = new NtfbenchmarkProvider(getListenServiceDependency(), getPublishServiceDependency());
- getBrokerDependency().registerProvider(provider);
- return provider;
- }
-
-}
+++ /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
- */
-/*
-* Generated file
-*
-* Generated from: yang module name: ntfbenchmark yang module local name: ntfbenchmark
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Fri Jan 02 13:49:24 CST 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.ntfbenchmark.impl.rev141210;
-public class NtfbenchmarkModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210.AbstractNtfbenchmarkModuleFactory {
-
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2017 Inocybe Technologies 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
+-->
+<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="publishService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService"/>
+ <reference id="listenerService" interface="org.opendaylight.controller.md.sal.binding.api.NotificationService"/>
+
+ <bean id="provider" class="ntfbenchmark.impl.NtfbenchmarkProvider"
+ init-method="init" destroy-method="close">
+ <argument ref="publishService"/>
+ <argument ref="listenerService"/>
+ </bean>
+
+ <odl:rpc-implementation ref="provider"/>
+</blueprint>
+++ /dev/null
-module ntfbenchmark-impl {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:ntfbenchmark:impl";
- prefix "ntfbenchmark-impl";
-
- import config { prefix config; revision-date 2013-04-05; }
- import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
- import opendaylight-sal-binding-broker-impl {prefix binding-impl; revision-date 2013-10-28;}
-
- description
- "Service definition for ntfbenchmark project";
-
- revision "2014-12-10" {
- description
- "Initial revision";
- }
-
- identity ntfbenchmark {
- base config:module-type;
- config:java-name-prefix Ntfbenchmark;
- }
-
- augment "/config:modules/config:module/config:configuration" {
- case ntfbenchmark {
- when "/config:modules/config:module/config:type = 'ntfbenchmark'";
- container broker {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity md-sal-binding:binding-broker-osgi-registry;
- }
- }
- }
- container publish-service {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity binding-impl:binding-new-notification-publish-service;
- }
- }
- }
- container listen-service {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity binding-impl:binding-new-notification-service;
- }
- }
- }
-
- }
- }
-}
<artifactId>ntfbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>ntfbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>rpcbenchmark</artifactId>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-benchmark-api</feature>
<bundle>mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}</bundle>
- <configfile finalname="ntfbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config</configfile>
</feature>
<feature name='odl-mdsal-benchmark' version='${project.version}' description='OpenDaylight :: dsbenchmark :: '>
<feature version='${project.version}'>odl-dsbenchmark</feature>
<artifactId>rpcbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <!-- finalname="ntfbenchmark-impl-default-config.xml" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>ntfbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<!-- finalname="rpcbenchmark-impl-default-config.xml" -->
<groupId>${project.groupId}</groupId>
-->
<features name="odl-dsbenchmark-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
<feature name="odl-mdsal-benchmark" version="${project.version}">
- <configfile finalname="ntfbenchmark-impl-default-config.xml">
- mvn:org.opendaylight.controller/ntfbenchmark/${project.version}/xml/config
- </configfile>
<configfile finalname="rpcbenchmark-impl-default-config.xml">
mvn:org.opendaylight.controller/rpcbenchmark/${project.version}/xml/config
</configfile>
<artifactId>ntfbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <!-- finalname="ntfbenchmark-impl-default-config.xml" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>ntfbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2016, 2017 Red Hat, Inc. and others.
-
- 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
- -->
-<features name="odl-dsbenchmark-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
- <feature name="odl-ntfbenchmark" version="${project.version}">
- <configfile finalname="ntfbenchmark-impl-default-config.xml">
- mvn:org.opendaylight.controller/ntfbenchmark/${project.version}/xml/config
- </configfile>
- </feature>
-</features>