<maven>3.1.1</maven>
</prerequisites>
<modules>
- <module>simple-ird</module>
<module>manual-maps</module>
<module>simple-ecs</module>
<module>auto-maps</module>
+ <module>simple-ird</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<build>
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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
-->
-<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">
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
<relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-api</artifactId>
<version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
<packaging>bundle</packaging>
<groupId>org.opendaylight.mdsal.model</groupId>
<artifactId>ietf-yang-types-20130715</artifactId>
</dependency>
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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
-->
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
-<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.alto</groupId>
- <artifactId>alto-parent</artifactId>
- <version>0.4.0-SNAPSHOT</version>
- <relativePath>../../../</relativePath>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-artifacts</artifactId>
+ <version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
<packaging>pom</packaging>
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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 INTERNAL
-->
-<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">
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>features-parent</artifactId>
<version>1.8.0-SNAPSHOT</version>
<relativePath/>
</parent>
+
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-features</artifactId>
<version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
- <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.1.1</maven>
- </prerequisites>
+
<properties>
<mdsal.model.version>0.10.0-SNAPSHOT</mdsal.model.version>
<mdsal.version>1.5.0-SNAPSHOT</mdsal.version>
<dluxapps.version>0.5.0-SNAPSHOT</dluxapps.version>
<configfile.directory>etc/opendaylight/karaf</configfile.directory>
</properties>
+
<dependencyManagement>
<dependencies>
<!-- project specific dependencies -->
<type>pom</type>
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yangtools-artifacts</artifactId>
+ <version>${yangtools.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>features-yangtools</artifactId>
<classifier>features</classifier>
- <version>${yangtools.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-mdsal</artifactId>
<classifier>features</classifier>
- <version>${mdsal.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<groupId>org.opendaylight.netconf</groupId>
<artifactId>features-restconf</artifactId>
<classifier>features</classifier>
- <version>${restconf.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<type>xml</type>
<scope>runtime</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-northbound-features</artifactId>
- <version>${project.version}</version>
- <classifier>features</classifier>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-resourcepool-features</artifactId>
- <classifier>features</classifier>
- <version>${project.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-service-model-networkmap-features</artifactId>
- <classifier>features</classifier>
- <version>${project.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-service-model-costmap-features</artifactId>
- <classifier>features</classifier>
- <version>${project.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-service-model-endpointcost-features</artifactId>
- <classifier>features</classifier>
- <version>${project.version}</version>
- <type>xml</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-service-model-base-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.alto.core</groupId>
- <artifactId>alto-service-model-ird-api</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>alto-simple-ird-impl</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>alto-simple-ird-impl</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>alto-simple-ird-api</artifactId>
<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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,
<features name="odl-alto-simple-ird-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
- <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.dluxapps/features-dluxapps/${dluxapps.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.alto.core/alto-resourcepool-features/${project.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.alto.core/alto-northbound-features/${project.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.alto.core/alto-service-model-networkmap-features/${project.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.alto.core/alto-service-model-endpointcost-features/${project.version}/xml/features</repository>
- <repository>mvn:org.opendaylight.alto.core/alto-service-model-costmap-features/${project.version}/xml/features</repository>
-
+ <repository>mvn:org.opendaylight.yangtools/features-yangtools/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.controller/features-mdsal/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netconf/features-restconf/{{VERSION}}/xml/features</repository>
+ <repository>mvn:org.opendaylight.dluxapps/features-dluxapps/{{VERSION}}/xml/features</repository>
<feature name='odl-alto-simple-ird-api' version='${project.version}' description='OpenDaylight :: alto-simple-ird :: api'>
<feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
- <feature version='${project.version}'>odl-alto-resourcepool-api</feature>
- <bundle>mvn:org.opendaylight.alto.core/alto-service-model-base-api/${project.version}</bundle>
- <bundle>mvn:org.opendaylight.alto.core/alto-service-model-ird-api/${project.version}</bundle>
- <bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-api/${project.version}</bundle>
+ <bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-api/{{VERSION}}</bundle>
</feature>
<feature name='odl-alto-simple-ird' version='${project.version}' description='OpenDaylight :: alto-simple-ird'>
<feature version='${mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-alto-simple-ird-api</feature>
- <feature version='${project.version}'>odl-alto-northbound</feature>
- <feature version='${project.version}'>odl-alto-resourcepool</feature>
- <feature version='${project.version}'>odl-alto-service-model-networkmap</feature>
- <feature version='${project.version}'>odl-alto-service-model-endpointcost</feature>
- <feature version='${project.version}'>odl-alto-service-model-costmap</feature>
- <bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/${project.version}</bundle>
- <configfile finalname="${configfile.directory}/alto-simple-ird.xml">mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/${project.version}/xml/config</configfile>
+ <bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/{{VERSION}}</bundle>
</feature>
<feature name='odl-alto-simple-ird-rest' version='${project.version}' description='OpenDaylight :: alto-simple-ird :: REST'>
<feature version="${project.version}">odl-alto-simple-ird</feature>
<feature name='odl-alto-simple-ird-ui' version='${project.version}' description='OpenDaylight :: alto-simple-ird :: UI'>
<feature version="${project.version}">odl-alto-simple-ird-rest</feature>
<feature version="${restconf.version}">odl-mdsal-apidocs</feature>
+ <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
<feature version="${dluxapps.version}">odl-dluxapps-yangman</feature>
</feature>
+<!-- <feature name='odl-alto-simple-ird-cli' version='${project.version}' description='OpenDaylight :: alto-simple-ird :: CLI'>
+ <feature version="${project.version}">odl-alto-simple-ird</feature>
+ <bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-cli/{{VERSION}}</bundle>
+ </feature>-->
</features>
<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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
-->
-<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">
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.controller</groupId>
<relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-impl</artifactId>
<version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
<packaging>bundle</packaging>
+
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<scope>test</scope>
</dependency>
</dependencies>
-
</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-Copyright © 2015 Yale University 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:alto:simple:ird:impl?module=alto-simple-ird-impl&revision=2015-10-21</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
- <capability>urn:alto:northbound?module=alto-northbound&revision=2015-10-21</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:alto:simple:ird:impl">prefix:alto-simple-ird</type>
- <name>alto-simple-ird-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>
- <alto-northbound-router>
- <type xmlns:alto-northbound-router="urn:alto:northbound">alto-northbound-router:alto-northbound-router</type>
- <name>alto-northbound-router</name>
- </alto-northbound-router>
- </module>
- </modules>
- </data>
- </configuration>
-</snapshot>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
- <groupId>org.opendaylight.alto.basic</groupId>
- <artifactId>alto-simple-ird-impl</artifactId>
- <version>0.2.1-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <localCopy>true</localCopy>
- </snapshot>
- <lastUpdated>20151112013601</lastUpdated>
- <snapshotVersions>
- <snapshotVersion>
- <classifier>config</classifier>
- <extension>xml</extension>
- <value>0.2.1-SNAPSHOT</value>
- <updated>20151112013601</updated>
- </snapshotVersion>
- </snapshotVersions>
- </versioning>
-</metadata>
/*
- * Copyright © 2015 Yale University and others. All rights reserved.
+ * Copyright © 2017 SNLab 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,
import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.alto.simple.ird.rev151021.Information;
import org.opendaylight.yang.gen.v1.urn.alto.simple.ird.rev151021.InformationBuilder;
import org.opendaylight.yang.gen.v1.urn.alto.simple.ird.rev151021.IrdInstance;
import org.opendaylight.yang.gen.v1.urn.alto.simple.ird.rev151021.IrdInstanceConfiguration;
import org.opendaylight.yang.gen.v1.urn.alto.simple.ird.rev151021.IrdInstanceConfigurationBuilder;
import org.opendaylight.yang.gen.v1.urn.alto.types.rev150921.ResourceId;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.ExecutionException;
-public class AltoSimpleIrdProvider implements BindingAwareProvider, AutoCloseable {
+public class AltoSimpleIrdProvider {
public static final String ROOT_INSTANCE = "root";
public static final String SIMPLE_IRD_ROUTE_NAME = "simpleird";
private static final Logger LOG = LoggerFactory.getLogger(AltoSimpleIrdProvider.class);
- private DataBroker m_dataBroker = null;
+ private final DataBroker m_dataBroker;
InstanceIdentifier<IrdInstanceConfiguration> m_iid = null;
InstanceIdentifier<IrdInstance> m_rootIID = null;
.setInstanceId(new ResourceId(SimpleIrdUtils.DEFAULT_IRD_RESOURCE));
InstanceIdentifier<IrdInstanceConfiguration> iicIID =
- SimpleIrdUtils.getInstanceConfigurationIID(new ResourceId(SimpleIrdUtils.DEFAULT_IRD_RESOURCE));
+ SimpleIrdUtils.getInstanceConfigurationIID(new ResourceId(SimpleIrdUtils.DEFAULT_IRD_RESOURCE));
wx.put(LogicalDatastoreType.CONFIGURATION, iicIID, builder.build());
wx.submit().get();
}
}
- @Override
- public void onSessionInitiated(ProviderContext session) {
- LOG.info("AltoSimpleIrdProvider Session Initiated");
+ public AltoSimpleIrdProvider(final DataBroker dataBroker) {
+ this.m_dataBroker = dataBroker;
+ }
- m_dataBroker = session.getSALService(DataBroker.class);
+ /**
+ * Method called when the blueprint container is created.
+ */
+ public void init() {
m_iid = SimpleIrdUtils.getInstanceConfigurationListIID();
m_rootIID = SimpleIrdUtils.getInstanceIID(ROOT_INSTANCE);
LOG.error("Failed to create top-level containers");
e.printStackTrace();
}
+ LOG.info("AltoSimpleIrdProvider Session Initiated");
}
- @Override
- public void close() throws Exception {
+ /**
+ * Method called when the blueprint container is destroyed.
+ */
+ public void close() {
try {
if (m_router != null) {
m_router.removeRoute(SIMPLE_IRD_ROUTE_NAME);
LOG.error("Failed to reigster route");
}
}
-}
+}
\ No newline at end of file
+++ /dev/null
-package org.opendaylight.yang.gen.v1.urn.alto.simple.ird.impl.rev151021;
-
-import org.opendaylight.alto.basic.impl.AltoSimpleIrdProvider;
-
-public class AltoSimpleIrdModule extends org.opendaylight.yang.gen.v1.urn.alto.simple.ird.impl.rev151021.AbstractAltoSimpleIrdModule {
- public AltoSimpleIrdModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
- super(identifier, dependencyResolver);
- }
-
- public AltoSimpleIrdModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.alto.simple.ird.impl.rev151021.AltoSimpleIrdModule 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() {
- final AltoSimpleIrdProvider provider = new AltoSimpleIrdProvider();
-
- try {
- getBrokerDependency().registerProvider(provider);
- provider.setupRoute(getAltoNorthboundRouterDependency());
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- return provider;
- }
-
-}
+++ /dev/null
-/*
-* Generated file
-*
-* Generated from: yang module name: alto-simple-ird-impl yang module local name: alto-simple-ird
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Nov 11 21:58:28 CST 2015
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.yang.gen.v1.urn.alto.simple.ird.impl.rev151021;
-public class AltoSimpleIrdModuleFactory extends org.opendaylight.yang.gen.v1.urn.alto.simple.ird.impl.rev151021.AbstractAltoSimpleIrdModuleFactory {
-
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2017 SNLab 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="dataBroker"
+ interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
+ odl:type="default" />
+
+ <bean id="altoSimpleIrdProvider"
+ class="org.opendaylight.alto.basic.impl.AltoSimpleIrdProvider"
+ init-method="init" destroy-method="close">
+ <argument ref="dataBroker" />
+ </bean>
+
+</blueprint>
+++ /dev/null
-module alto-simple-ird-impl {
- yang-version 1;
- namespace "urn:alto:simple:ird:impl";
- prefix "alto-simple-ird-impl";
-
- import alto-northbound { prefix alto-northbound; revision-date 2015-10-21; }
- import config { prefix config; revision-date 2013-04-05; }
- import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
-
- description
- "Service definition for alto-simple-ird project";
-
- revision "2015-10-21" {
- description
- "Initial revision";
- }
-
- identity alto-simple-ird {
- base config:module-type;
- config:java-name-prefix AltoSimpleIrd;
- }
-
- augment "/config:modules/config:module/config:configuration" {
- case alto-simple-ird {
- when "/config:modules/config:module/config:type = 'alto-simple-ird'";
- container broker {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity md-sal-binding:binding-broker-osgi-registry;
- }
- }
- }
-
- container alto-northbound-router {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity alto-northbound:alto-northbound-router;
- }
- }
- }
- }
- }
-}
public void isValidResource() throws Exception {
ResourceBuilder rb = new ResourceBuilder()
.setKey(new ResourceKey(new ResourceId("test")))
- .setType(null);
+ .setType(null);
assertEquals(simpleIrdEntryListener.isValidResource(rb.build()), false);
}
.setEntryId(new ResourceId("THE_FIRST_ENTRY_ID"))
.setInstance(instanceIID)
.setLocation(new FixedUrlBuilder()
- .setUri(new Uri("http://alto.example.com/first_instance"))
- .build());
+ .setUri(new Uri("http://alto.example.com/first_instance")).build());
configs.add(configBuilder.build());
Map<IrdConfigurationEntry, Resource> result = simpleIrdEntryListener.readEntries(configs, rwx);
assertEquals(result, null);
.setEntryId(new ResourceId("THE_FIRST_ENTRY_ID"))
.setInstance(instanceIID)
.setLocation(new FixedUrlBuilder()
- .setUri(new Uri("http://alto.example.com/first_instance"))
- .build());
+ .setUri(new Uri("http://alto.example.com/first_instance")).build());
configs.add(configBuilder.build());
IrdInstanceConfigurationBuilder iicb = new IrdInstanceConfigurationBuilder()
.setIrdConfigurationEntry(configs);
+++ /dev/null
-/*
- * Copyright © 2015 Yale University 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.alto.simple.ird.impl.rev151021;
-
-import org.junit.Test;
-
-public class AltoSimpleIrdModuleFactoryTest {
- @Test
- public void testFactoryConstructor() {
- // ensure no exceptions on construction
- new AltoSimpleIrdModuleFactory();
- }
-}
+++ /dev/null
-/*
- * Copyright © 2015 Yale University 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.alto.simple.ird.impl.rev151021;
-
-import org.junit.Test;
-import org.opendaylight.alto.basic.impl.AltoSimpleIrdProvider;
-import org.opendaylight.alto.core.northbound.api.AltoNorthboundRouter;
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.JmxAttribute;
-import org.opendaylight.controller.config.api.ModuleIdentifier;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-
-import javax.management.ObjectName;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class AltoSimpleIrdModuleTest {
- @Test
- public void testCustomValidation() {
- AltoSimpleIrdModule module = new AltoSimpleIrdModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
-
- // ensure no exceptions on validation
- // currently this method is empty
- module.customValidation();
- }
-
- @Test
- public void testCreateInstance() throws Exception {
- // configure mocks
- DependencyResolver dependencyResolver = mock(DependencyResolver.class);
- BindingAwareBroker broker = mock(BindingAwareBroker.class);
- AltoNorthboundRouter router = mock(AltoNorthboundRouter.class);
-
- when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
- when(dependencyResolver.resolveInstance(eq(AltoNorthboundRouter.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(router);
-
- // create instance of module with injected mocks
- AltoSimpleIrdModule module = new AltoSimpleIrdModule(mock(ModuleIdentifier.class), dependencyResolver);
-
- // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
- AutoCloseable closeable = module.getInstance();
-
- // verify that the module registered the returned provider with the broker
- verify(broker).registerProvider((AltoSimpleIrdProvider)closeable);
-
- // ensure no exceptions on close
- closeable.close();
- }
-}
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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
-->
+<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">
-<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">
+ <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.controller</groupId>
<relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-it</artifactId>
<version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
<packaging>bundle</packaging>
<skipITs>false</skipITs>
<karaf.distro.groupId>org.opendaylight.alto.basic</karaf.distro.groupId>
<karaf.distro.artifactId>alto-simple-ird-karaf</karaf.distro.artifactId>
- <karaf.distro.version>0.4.0-SNAPSHOT</karaf.distro.version>
+ <karaf.distro.version>0.1.0-SNAPSHOT</karaf.distro.version>
<karaf.distro.type>zip</karaf.distro.type>
</properties>
<version>${project.version}</version>
</dependency>
</dependencies>
-
</project>
/*
- * Copyright © 2015 Yale University and others. All rights reserved.
+ * Copyright © 2017 SNLab 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,
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
-public class AltoSimpleIRDIT extends AbstractMdsalTestBase {
- private static final Logger LOG = LoggerFactory.getLogger(AltoSimpleIRDIT.class);
-
- @Override
- public String getModuleName() {
- return "alto-simple-ird";
- }
-
- @Override
- public String getInstanceName() {
- return "alto-simple-ird-default";
- }
+public class AltoSimpleIrdIT extends AbstractMdsalTestBase {
+ private static final Logger LOG = LoggerFactory.getLogger(AltoSimpleIrdIT.class);
@Override
public MavenUrlReference getFeatureRepo() {
@Override
public Option getLoggingOption() {
Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
- logConfiguration(AltoSimpleIRDIT.class),
+ logConfiguration(AltoSimpleIrdIT.class),
LogLevel.INFO.name());
option = composite(option, super.getLoggingOption());
return option;
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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 INTERNAL
-->
-<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">
+<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">
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf-parent</artifactId>
<version>1.8.0-SNAPSHOT</version>
- <relativePath/>
</parent>
- <modelVersion>4.0.0</modelVersion>
+
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-karaf</artifactId>
<version>0.4.0-SNAPSHOT</version>
+ <!-- <name> formatting is used by autorelease to parse and notify projects on
+ build failure. Please do not modify this unless you have a good reason. -->
<name>ODL :: alto :: ${project.artifactId}</name>
- <prerequisites>
- <maven>3.1.1</maven>
- </prerequisites>
+
<properties>
<karaf.localFeature>odl-alto-simple-ird-ui</karaf.localFeature>
</properties>
+
<dependencyManagement>
<dependencies>
<dependency>
</dependency>
</dependencies>
</dependencyManagement>
+
<dependencies>
<dependency>
<!-- scope is compile so all features (there is only one) are installed
<scope>runtime</scope>
</dependency>
</dependencies>
- <!-- DO NOT install or deploy the karaf artifact -->
+
<build>
<plugins>
+ <!-- DO NOT deploy the karaf artifact -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<?xml version="1.0" encoding="UTF-8"?>
<!--
-Copyright © 2015 Yale University and others. All rights reserved.
+Copyright © 2017 SNLab 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 INTERNAL
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-aggregator</artifactId>
<version>0.4.0-SNAPSHOT</version>
- <name>ODL :: alto :: ${project.artifactId}</name>
+ <name>ODL :: alto :: ${project.artifactId}</name> <!-- DO NOT CHANGE - Used by Sonar to set project name -->
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.1.1</maven>
- </prerequisites>
+ <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
<profiles>
<profile>
<id>minimal</id>
<module>it</module>
</modules>
</profile>
+ <profile>
+ <!--
+ This profile is to ensure we only build javadocs reports
+ when we plan to deploy Maven site for our project.
+ -->
+ <id>maven-site</id>
+ <activation>
+ <file>
+ <exists>${user.dir}/deploy-site.xml</exists>
+ </file>
+ </activation>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>aggregate</id>
+ <goals>
+ <goal>aggregate</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <failsOnError>true</failsOnError>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
- <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-install-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <!--
+ Maven Site Configuration
+
+ The following configuration is necessary for maven-site-plugin to
+ correctly identify the correct deployment path for OpenDaylight Maven
+ sites.
+ -->
+ <url>${odl.site.url}/${project.groupId}/${stream}/</url>
+
+ <distributionManagement>
+ <site>
+ <id>opendaylight-site</id>
+ <url>${nexus.site.url}/</url>
+ </site>
+ </distributionManagement>
</project>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.opendaylight.alto.basic</groupId>
- <artifactId>alto-simple-ird-impl</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
-
<dependency>
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-api</artifactId>
<bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-api/${project.version}</bundle>
<bundle>mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/${project.version}</bundle>
- <configfile finalname="${configfile.directory}/alto-simple-ird.xml">
- mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/${project.version}/xml/config
- </configfile>
</feature>
<feature name='odl-alto-manual-maps' version='${project.version}'
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<features name="odl-alto-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
- <feature name="odl-alto-simpleird" version="${project.version}">
- <configfile finalname="${configfile.directory}/alto-simple-ird.xml"> mvn:org.opendaylight.alto.basic/alto-simple-ird-impl/${project.version}/xml/config </configfile>
- </feature>
-</features>