Add alto-provider, rename api to northbound 44/17344/1
authorY. Richard Yang <yry@cs.yale.edu>
Mon, 30 Mar 2015 13:28:29 +0000 (09:28 -0400)
committerY. Richard Yang <yry@cs.yale.edu>
Mon, 30 Mar 2015 13:28:29 +0000 (09:28 -0400)
Change-Id: If5909134e8db2ba017c2c41b71c4c921626e45b5
Signed-off-by: Y. Richard Yang <yry@cs.yale.edu>
12 files changed:
alto-impl/pom.xml [deleted file]
alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModule.java [deleted file]
alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModuleFactory.java [deleted file]
alto-impl/src/main/yang/alto-impl.yang [deleted file]
alto-model/pom.xml
alto-northbound/pom.xml [moved from alto-api/pom.xml with 95% similarity]
alto-northbound/src/main/yang/alto.yang [moved from alto-api/src/main/yang/alto.yang with 100% similarity]
alto-provider/pom.xml [new file with mode: 0644]
alto-provider/src/main/config/default-config.xml [moved from alto-impl/src/main/config/default-config.xml with 100% similarity]
alto-provider/src/main/java/org/opendaylight/alto/AltoProvider.java [moved from alto-impl/src/main/java/org/opendaylight/alto/AltoProvider.java with 100% similarity]
alto-provider/src/main/yang/alto-provider-impl.yang [new file with mode: 0644]
pom.xml

diff --git a/alto-impl/pom.xml b/alto-impl/pom.xml
deleted file mode 100644 (file)
index 9c1337e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: --><!--
-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
--->
-<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.3.0-SNAPSHOT</version>
-    <relativePath/>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.opendaylight.alto</groupId>
-  <artifactId>alto-impl</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-  <dependencies>
-    <dependency>
-      <groupId>${groupId}</groupId>
-      <artifactId>alto-api</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-
-</project>
diff --git a/alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModule.java b/alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModule.java
deleted file mode 100644 (file)
index d3bcc25..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 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.opendaylight.params.xml.ns.yang.alto.impl.rev141210;
-
-import org.opendaylight.alto.AltoProvider;
-
-public class AltoImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alto.impl.rev141210.AbstractAltoImplModule {
-    public AltoImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public AltoImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alto.impl.rev141210.AltoImplModule 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() {
-        AltoProvider provider = new AltoProvider();
-        getBrokerDependency().registerProvider(provider);
-        return provider;
-    }
-
-}
diff --git a/alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModuleFactory.java b/alto-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/alto/impl/rev141210/AltoImplModuleFactory.java
deleted file mode 100644 (file)
index b68053a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 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
- */
-/*
-* Generated file
-*
-* Generated from: yang module name: alto yang module local name: alto
-* 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.alto.impl.rev141210;
-public class AltoImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.alto.impl.rev141210.AbstractAltoImplModuleFactory {
-
-}
diff --git a/alto-impl/src/main/yang/alto-impl.yang b/alto-impl/src/main/yang/alto-impl.yang
deleted file mode 100644 (file)
index 8ae86f1..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-module alto-impl {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:alto:impl";
-    prefix "alto-impl";
-
-    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 project";
-
-    revision "2014-12-10" {
-        description
-            "Initial revision";
-    }
-
-    identity alto-impl {
-        base config:module-type;
-        config:java-name-prefix AltoImpl;
-    }
-
-    augment "/config:modules/config:module/config:configuration" {
-        case alto-impl {
-            when "/config:modules/config:module/config:type = 'alto-impl'";
-            container broker {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-broker-osgi-registry;
-                    }
-                }
-            }
-        }
-    }
-}
index 4e122eade895ed74932f737a6987a44287df6b72..7564ef81973312660c895cc8aaced745c7cb9f71 100644 (file)
     <version>1.2.0-SNAPSHOT</version>
     <relativePath></relativePath>
   </parent>
+
   <modelVersion>4.0.0</modelVersion>
   <artifactId>alto-model</artifactId>
+  <groupId>org.opendaylight.alto</groupId>
   <packaging>bundle</packaging>
  
 
similarity index 95%
rename from alto-api/pom.xml
rename to alto-northbound/pom.xml
index 95fb8caae5ea7a12fea1c991682a378c66f6a42e..06c67d286be53a529a2983a2ea1c1de619ac2967 100644 (file)
@@ -16,7 +16,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.opendaylight.alto</groupId>
-  <artifactId>alto-api</artifactId>
+  <artifactId>alto-northbound</artifactId>
   <version>1.0.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
diff --git a/alto-provider/pom.xml b/alto-provider/pom.xml
new file mode 100644 (file)
index 0000000..85e7d08
--- /dev/null
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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/xsd/maven-4.0.0.xsd">
+
+  <parent>
+    <artifactId>sal-samples</artifactId>
+    <groupId>org.opendaylight.controller.samples</groupId>
+    <version>1.2.0-SNAPSHOT</version>
+    <relativePath></relativePath>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>alto-provider</artifactId>
+  <packaging>bundle</packaging>
+
+  <properties>
+    <checkstyle.skip>true</checkstyle.skip>
+    <sal-binding-api.version>1.2.0-SNAPSHOT</sal-binding-api.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller.model</groupId>
+      <artifactId>alto-model</artifactId>
+      <version>1.2.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-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-common-util</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
+
+    <!-- dependencies to use AbstractDataBrokerTest -->
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-binding-broker-impl</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-binding-broker-impl</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+        <artifactId>junit</artifactId>
+        <groupId>junit</groupId>
+        <scope>test</scope>
+    </dependency>
+    <!-- used to mock up classes -->
+     <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Export-Package>org.opendaylight.controller.config.yang.alto_provider,</Export-Package>
+            <Import-Package>*</Import-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.opendaylight.yangtools</groupId>
+        <artifactId>yang-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>config</id>
+            <goals>
+              <goal>generate-sources</goal>
+            </goals>
+            <configuration>
+              <codeGenerators>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
+                  <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
+                  <additionalConfiguration>
+                    <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
+                  </additionalConfiguration>
+                </generator>
+                <generator>
+                  <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
+                  <outputBaseDir>${salGeneratorPath}</outputBaseDir>
+                </generator>
+              </codeGenerators>
+              <inspectDependencies>true</inspectDependencies>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <scm>
+    <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
+    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
+    <tag>HEAD</tag>
+    <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
+  </scm>
+
+</project>
diff --git a/alto-provider/src/main/yang/alto-provider-impl.yang b/alto-provider/src/main/yang/alto-provider-impl.yang
new file mode 100644 (file)
index 0000000..78aade8
--- /dev/null
@@ -0,0 +1,97 @@
+module alto-provider-impl {
+
+  yang-version 1;
+  
+  namespace "urn:opendaylight:params:xml:ns:yang:controller:config:alto-provider:impl";
+  // TODO: replace with IANA namespace when assigned
+
+  prefix "alto-provider-impl";
+
+  import config {
+    prefix config;
+    revision-date 2013-04-05;
+  }
+  
+  import opendaylight-md-sal-binding {
+    prefix mdsal;
+    revision-date 2013-10-28;
+  }
+
+  import rpc-context { prefix rpcx; revision-date 2013-06-17; }
+
+  organization "ALTO WG";
+  contact "alto@ietf.org";
+
+  description 
+    "This module defines the implementation model for the ALTO services
+     using restconf. Note this is not interop with RFC7285.";
+
+  revision 2014-11-19 {
+    description "Initial version for ODL.";
+  }
+  
+
+
+  // This is the definition of the service implementation as a module identity
+  identity alto-provider-impl {
+    base config:module-type;
+
+    // Specifies the prefix for generated java classes.
+    config:java-name-prefix AltoProvider;
+  }
+
+  // Augments the 'configuration' choice node under modules/module.  
+  augment "/config:modules/config:module/config:configuration" {
+    case alto-provider-impl {
+      when "/config:modules/config:module/config:type = 'alto-provider-impl'";
+
+      container rpc-registry {
+        uses config:service-ref {
+          refine type {
+            mandatory true;
+            config:required-identity mdsal:binding-rpc-registry;
+          }
+        }
+      }
+
+      //wires in the data-broker service 
+      container data-broker {
+        uses config:service-ref {
+          refine type {
+            mandatory false;
+            config:required-identity mdsal:binding-async-data-broker;
+          }
+        }
+      }      
+    }
+  }
+
+  /*dummy*/
+    augment "/config:modules/config:module/config:state" {
+        case alto-provider-impl {
+            when "/config:modules/config:module/config:type = 'alto-provider-impl'";
+            
+            leaf toasts-made {
+                type uint32;
+            }
+            
+            rpcx:rpc-context-instance "clear-toasts-made-rpc";
+        }
+    }
+
+    identity clear-toasts-made-rpc;
+
+    rpc clear-toasts-made  {
+        description
+          "JMX call to clear the toasts-made counter.";
+          
+        input {
+            uses rpcx:rpc-context-ref {
+                refine context-instance {
+                    rpcx:rpc-context-instance clear-toasts-made-rpc;
+                }
+            }
+        }
+    }
+
+}
diff --git a/pom.xml b/pom.xml
index dc04769328917cfe6120447a10e9de8dff4f238e..8bd026206df72531ee48ec4bcb0d77b90da478e9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -16,11 +16,12 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <maven>3.1.1</maven>
   </prerequisites>
   <modules>
-    <module>alto-api</module>
-    <module>alto-impl</module>
-    <module>alto-karaf</module>
+    <module>alto-model</module>
+    <module>alto-provider</module>
+    <module>alto-northbound</module>
     <module>features</module>
     <module>alto-artifacts</module>
+    <module>alto-karaf</module>
   </modules>
 
   <distributionManagement>