--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2017 Ericsson India Global Services Pvt Ltd. 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>
+
+ <parent>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <relativePath>../../commons/binding-parent</relativePath>
+ </parent>
+
+ <artifactId>coe-api</artifactId>
+ <name>ODL :: netvirt :: ${project.artifactId}</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2017 Ericsson India Global Services Pvt Ltd. 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>
+
+ <parent>
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.6.0-SNAPSHOT</version>
+ <relativePath>../../commons/binding-parent</relativePath>
+ </parent>
+
+ <artifactId>coe-impl</artifactId>
+ <name>ODL :: netvirt :: ${project.artifactId}</name>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>coe-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.coe</groupId>
+ <artifactId>coe-northbound-api</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.xtend</groupId>
+ <artifactId>xtend-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+/*
+ * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. 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.netvirt.coe;
+
+import java.util.Collection;
+import javax.annotation.Nonnull;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.coe.northbound.pod.rev170611.Coe;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.coe.northbound.pod.rev170611.coe.Pods;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Singleton
+public class PodListener implements DataTreeChangeListener<Pods> {
+
+ private static final Logger LOG = LoggerFactory.getLogger(PodListener.class);
+ private ListenerRegistration<PodListener> listenerRegistration;
+ private final DataBroker dataBroker;
+
+ @Inject
+ public PodListener(final DataBroker dataBroker) {
+ registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
+ this.dataBroker = dataBroker;
+ }
+
+ protected InstanceIdentifier<Pods> getWildCardPath() {
+ return InstanceIdentifier.create(Coe.class).child(Pods.class);
+ }
+
+ public void registerListener(LogicalDatastoreType dsType, final DataBroker db) {
+ final DataTreeIdentifier<Pods> treeId = new DataTreeIdentifier<>(dsType, getWildCardPath());
+ listenerRegistration = db.registerDataTreeChangeListener(treeId, PodListener.this);
+ }
+
+ @PreDestroy
+ public void close() {
+ if (listenerRegistration != null) {
+ try {
+ listenerRegistration.close();
+ } finally {
+ listenerRegistration = null;
+ }
+ }
+ }
+
+ @Override
+ public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Pods>> changes) {
+ for (DataTreeModification<Pods> change : changes) {
+ final InstanceIdentifier<Pods> key = change.getRootPath().getRootIdentifier();
+ final DataObjectModification<Pods> mod = change.getRootNode();
+
+ switch (mod.getModificationType()) {
+ case DELETE:
+ LOG.info("Pod deleted {}", mod.getDataBefore());
+ break;
+ case SUBTREE_MODIFIED:
+ LOG.info("Pod updated old : {}, new : {}", mod.getDataBefore(), mod.getDataAfter());
+ break;
+ case WRITE:
+ if (mod.getDataBefore() == null) {
+ LOG.info("Pod added {}", mod.getDataAfter());
+ } else {
+ LOG.info("Pod updated old : {}, new : {}", mod.getDataBefore(), mod.getDataAfter());
+ }
+ break;
+ default:
+ // FIXME: May be not a good idea to throw.
+ throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. 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.netvirt.coe;
+
+import java.util.Collection;
+import javax.annotation.Nonnull;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.coe.northbound.service.rev170611.ServiceInformation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.coe.northbound.service.rev170611.service.information.Services;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Singleton
+public class ServiceListener implements DataTreeChangeListener<Services> {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ServiceListener.class);
+ private ListenerRegistration<ServiceListener> listenerRegistration;
+ private final DataBroker dataBroker;
+
+ @Inject
+ public ServiceListener(final DataBroker dataBroker) {
+ registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
+ this.dataBroker = dataBroker;
+ }
+
+ protected InstanceIdentifier<Services> getWildCardPath() {
+ return InstanceIdentifier.create(ServiceInformation.class).child(Services.class);
+ }
+
+ public void registerListener(LogicalDatastoreType dsType, final DataBroker db) {
+ final DataTreeIdentifier<Services> treeId = new DataTreeIdentifier<>(dsType, getWildCardPath());
+ listenerRegistration = db.registerDataTreeChangeListener(treeId, ServiceListener.this);
+ }
+
+ @PreDestroy
+ public void close() {
+ if (listenerRegistration != null) {
+ try {
+ listenerRegistration.close();
+ } finally {
+ listenerRegistration = null;
+ }
+ }
+ }
+
+ @Override
+ public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Services>> changes) {
+ for (DataTreeModification<Services> change : changes) {
+ final InstanceIdentifier<Services> key = change.getRootPath().getRootIdentifier();
+ final DataObjectModification<Services> mod = change.getRootNode();
+
+ switch (mod.getModificationType()) {
+ case DELETE:
+ LOG.info("Service deleted {}", mod.getDataBefore());
+ break;
+ case SUBTREE_MODIFIED:
+ LOG.info("Service updated old : {}, new : {}", mod.getDataBefore(), mod.getDataAfter());
+ break;
+ case WRITE:
+ if (mod.getDataBefore() == null) {
+ LOG.info("Service added {}", mod.getDataAfter());
+ } else {
+ LOG.info("Service updated old : {}, new : {}", mod.getDataBefore(), mod.getDataAfter());
+ }
+ break;
+ default:
+ // FIXME: May be not a good idea to throw.
+ throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
+ }
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2017 Ericsson India Global Services Pvt Ltd. 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" />
+
+</blueprint>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2017 Ericsson India Global Services Pvt Ltd. 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">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent-lite</artifactId>
+ <version>2.0.4</version>
+ <relativePath/>
+ </parent>
+
+ <artifactId>coe-aggregator</artifactId>
+ <name>ODL :: netvirt :: ${project.artifactId}</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ </modules>
+
+ <!-- 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>
+</project>
<artifactId>cloud-servicechain-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>coe-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 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
+-->
+<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>single-feature-parent</artifactId>
+ <version>2.0.4</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.opendaylight.netvirt</groupId>
+ <artifactId>odl-netvirt-coe</artifactId>
+ <name>OpenDaylight :: NetVirt :: Coe</name>
+ <version>0.6.0-SNAPSHOT</version>
+ <packaging>feature</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.coe</groupId>
+ <artifactId>odl-coe-api</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>odl-netvirt-impl</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
+ </dependencies>
+</project>
<artifactId>statistics-impl</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>coe-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<!-- finalname="etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml" -->
<groupId>${project.groupId}</groupId>
<modules>
<module>vpnservice-features</module>
<module>odl-netvirt-api</module>
+ <module>odl-netvirt-coe</module>
<module>odl-netvirt-impl</module>
<module>odl-netvirt-openstack</module>
- <module>odl-netvirt-ui</module>
<module>odl-netvirt-sfc</module>
+ <module>odl-netvirt-ui</module>
</modules>
<!-- Maven Site Configuration The following configuration is necessary
<type>xml</type>
<classifier>features</classifier>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>odl-netvirt-coe</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>odl-netvirt-impl</artifactId>
<classifier>features</classifier>
</dependency>
</dependencies>
-
</project>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<modules>
+ <module>coe</module>
<module>commons</module>
<module>model-bgp</module>
<module>vpnmanager</module>