Implemented a simple northbound service and add it to the features. 42/17542/1
authorGao Kai <gaok12@mails.tsinghua.edu.cn>
Wed, 1 Apr 2015 14:09:04 +0000 (22:09 +0800)
committerGao Kai <gaok12@mails.tsinghua.edu.cn>
Wed, 1 Apr 2015 14:09:04 +0000 (22:09 +0800)
Can deploy with opendaylight-karaf now.

Change-Id: Id02bb7030af0b17f826047c135a015e701e7db2f
Signed-off-by: Gao Kai <gaok12@mails.tsinghua.edu.cn>
17 files changed:
alto-artifacts/pom.xml
alto-commons/pom.xml [new file with mode: 0644]
alto-commons/src/main/java/org/opendaylight/alto/commons/types/Errors.java [new file with mode: 0644]
alto-commons/src/main/java/org/opendaylight/alto/commons/types/RFC7285MediaType.java [new file with mode: 0644]
alto-commons/src/main/java/org/opendaylight/alto/commons/types/YangModelMediaType.java [new file with mode: 0644]
alto-model/pom.xml
alto-northbound/pom.xml
alto-northbound/src/main/java/org/opendaylight/alto/northbound/AltoNorthbound.java
alto-northbound/src/main/java/org/opendaylight/alto/northbound/FakeAltoService.java [new file with mode: 0644]
alto-northbound/src/main/resources/WEB-INF/web.xml
alto-northbound/src/main/yang/alto.yang [deleted file]
alto-services/pom.xml [new file with mode: 0644]
alto-services/src/main/java/org/opendaylight/alto/services/api/IRDService.java [new file with mode: 0644]
checkstyle.xml [deleted file]
features/pom.xml
features/src/main/resources/features.xml
pom.xml

index 226d8fd98887aa11b0679e36bf212f7c7d1c3ef8..dfc59d10554d83e232364b5b21713d880f3c1452 100644 (file)
@@ -13,13 +13,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <parent>
     <groupId>org.opendaylight.alto</groupId>
-    <artifactId>alto-aggregator</artifactId>
+    <artifactId>alto-parent</artifactId>
     <version>1.0.0-SNAPSHOT</version>
+    <relativePath>../</relativePath>
   </parent>
 
   <groupId>org.opendaylight.alto</groupId>
   <artifactId>alto-artifacts</artifactId>
-  <version>1.0.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <dependencyManagement>
diff --git a/alto-commons/pom.xml b/alto-commons/pom.xml
new file mode 100644 (file)
index 0000000..c4781f9
--- /dev/null
@@ -0,0 +1,82 @@
+<?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">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.opendaylight.alto</groupId>
+    <artifactId>alto-parent</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.alto</groupId>
+  <artifactId>commons</artifactId>
+  <packaging>bundle</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>${checkstyle.version}</version>
+
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+
+        <configuration>
+          <failsOnError>true</failsOnError>
+          <configLocation>controller/checkstyle.xml</configLocation>
+          <consoleOutput>true</consoleOutput>
+          <includeTestSourceDirectory>true</includeTestSourceDirectory>
+          <sourceDirectory>${project.basedir}</sourceDirectory>
+          <excludes>**\/target\/,**\/bin\/,**\/third-party,**\/yang-gen-sal</excludes>
+        </configuration>
+
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>${controller.checkstyle.version}</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>${bundle.plugin.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
+            </Import-Package>
+            <Export-Package>
+              org.opendaylight.alto.commons.*;
+            </Export-Package>
+            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-model</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+  </dependencies>
+</project>
+
diff --git a/alto-commons/src/main/java/org/opendaylight/alto/commons/types/Errors.java b/alto-commons/src/main/java/org/opendaylight/alto/commons/types/Errors.java
new file mode 100644 (file)
index 0000000..94b7e98
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * 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.alto.commons.types;
+
+public class Errors {
+    /** TODO Might need to check [RFC7285] to confirm the error literals
+     * */
+    public static final String SYNTAX_ERROR = "syntax-error";
+    public static final String MISSING_FIELD = "missing-field";
+    public static final String INVALID_FIELD_TYPE = "invalid-type";
+    public static final String INVALID_FIELD_VALUE = "invalid-value";
+
+    /** TODO Determine error code for ALTO Errors
+     * */
+}
diff --git a/alto-commons/src/main/java/org/opendaylight/alto/commons/types/RFC7285MediaType.java b/alto-commons/src/main/java/org/opendaylight/alto/commons/types/RFC7285MediaType.java
new file mode 100644 (file)
index 0000000..76f27a0
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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.alto.commons.types;
+
+public class RFC7285MediaType {
+
+    /** The media types defined in [RFC7285]
+     *
+     *  The media types defined here should be identical to those
+     *  generated by alto-model, the main reason we need this is
+     *  the ones defined here are *STRING LITERALS*.
+     * */
+
+    public static final String ALTO_DIRECTORY
+                            = "application/alto-directory+json";
+    public static final String ALTO_NETWORKMAP
+                            = "application/alto-networkmap+json";
+    public static final String ALTO_NETWORKMAP_FILTER
+                            = "application/alto-networkmapfilter+json";
+    public static final String ALTO_COSTMAP
+                            = "application/alto-costmap+json";
+    public static final String ALTO_COSTMAP_FILTER
+                            = "application/alto-costmapfilter+json";
+    public static final String ALTO_ENDPOINT_PROP
+                            = "application/alto-endpointprop+json";
+    public static final String ALTO_ENDPOINT_PROPPARAMS
+                            = "application/alto-endpointpropparams+json";
+    public static final String ALTO_ENDPOINT_COST
+                            = "application/alto-endpointcost+json";
+    public static final String ALTO_ENDPOINT_COSTPARAMS
+                            = "application/alto-endpointcostparams+json";
+    public static final String ALTO_ERROR
+                            = "application/alto-error+json";
+}
+
diff --git a/alto-commons/src/main/java/org/opendaylight/alto/commons/types/YangModelMediaType.java b/alto-commons/src/main/java/org/opendaylight/alto/commons/types/YangModelMediaType.java
new file mode 100644 (file)
index 0000000..60461a5
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * 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.alto.commons.types;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.MediaType;
+
+class YangModelMediaType {
+
+    /** The media types generated by alto-model
+     * */
+
+    public static final String ALTO_DIRECTORY
+                            = new MediaType(MediaType.Enumeration.AltoDirectory).toString();
+    public static final String ALTO_NETWORKMAP
+                            = new MediaType(MediaType.Enumeration.AltoNetworkmap).toString();
+    public static final String ALTO_NETWORKMAP_FILTER
+                            = new MediaType(MediaType.Enumeration.AltoNetworkmapfilter).toString();
+    public static final String ALTO_COSTMAP
+                            = new MediaType(MediaType.Enumeration.AltoCostmap).toString();
+    public static final String ALTO_COSTMAP_FILTER
+                            = new MediaType(MediaType.Enumeration.AltoCostmapfilter).toString();
+    public static final String ALTO_ENDPOINT_PROP
+                            = new MediaType(MediaType.Enumeration.AltoEndpointprop).toString();
+    public static final String ALTO_ENDPOINT_PROPPARAMS
+                            = new MediaType(MediaType.Enumeration.AltoEndpointpropparams).toString();
+    public static final String ALTO_ENDPOINT_COST
+                            = new MediaType(MediaType.Enumeration.AltoEndpointcost).toString();
+    public static final String ALTO_ENDPOST_COSTPARAMS
+                            = new MediaType(MediaType.Enumeration.AltoEndpointcostparams).toString();
+    public static final String ALTO_ERROR
+                            = new MediaType(MediaType.Enumeration.AltoError).toString();
+}
index bd7573a759caf86fcff4e457af2b4104c7fd51dc..39306981eb235ca5fe722d24f8ca40a7234b84cf 100644 (file)
@@ -58,6 +58,7 @@
                     <target>1.7</target>
                 </configuration>
             </plugin>
+
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
                         <Export-Package>
-                            org.opendaylight.yang.gen.v1.urn.cisco.*;
-                            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.acl.rev140520.*;
-                            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.packet.fields.rev140625.*;
+                            org.opendaylight.yang.gen.v1.urn.opendaylight.alto.*;
                         </Export-Package>
                         <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
                     </instructions>
                 </configuration>
             </plugin>
+
             <plugin>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yang-maven-plugin</artifactId>
     </build>
 
     <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>18.0</version>
+        </dependency>
+
         <dependency>
             <groupId>org.opendaylight.yangtools.model</groupId>
             <artifactId>ietf-inet-types</artifactId>
index cdef005d9e64a7d41688c0ad299523bac1489fa1..0f873569bcf411cc78d5a311d976a605a5307585 100644 (file)
@@ -11,6 +11,7 @@
   </parent>
   <groupId>org.opendaylight.alto</groupId>
   <artifactId>alto-northbound</artifactId>
+  <version>1.0.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <build>
@@ -22,7 +23,7 @@
           <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal</artifactId>
-            <version>0.7.1-SNAPSHOT</version>
+            <version>${sal.version}</version>
           </dependency>
         </dependencies>
       </plugin>
@@ -35,7 +36,8 @@
         <configuration>
           <instructions>
             <Import-Package>
-              org.codehaus.jettison.json,
+              org.opendaylight.yang.gen.v1.urn.opendaylight.alto.*,
+              org.opendaylight.alto.services.api,
               org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
               org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101,
               org.apache.commons.logging,
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>com.sun.jersey.jersey-servlet</artifactId>
-      <version>1.17</version>
+      <version>${jersey.servlet.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-json</artifactId>
+      <version>${jersey.json.version}</version>
     </dependency>
 
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>commons.northbound</artifactId>
-      <version>0.4.2-SNAPSHOT</version>
+      <version>${controller.commons.northbound.version}</version>
     </dependency>
 
     <dependency>
     <dependency>
       <groupId>org.opendaylight.controller.thirdparty</groupId>
       <artifactId>org.apache.catalina.filters.CorsFilter</artifactId>
-      <version>7.0.42</version>
+      <version>${corsfilter.version}</version>
     </dependency>
 
     <dependency>
-      <groupId>org.codehaus.jettison</groupId>
-      <artifactId>jettison</artifactId>
-      <version>1.3.7</version>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-model</artifactId>
+      <version>${project.version}</version>
     </dependency>
 
     <dependency>
       <version>${project.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>services.api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
   </dependencies>
 </project>
 
index cd31068c103d98041a3fc362c077f575a5a9aa5f..8d8a194c24f61e533db8dab71127ceb74035c8ff 100644 (file)
@@ -7,12 +7,16 @@
  */
 package org.opendaylight.alto.northbound;
 
-import org.opendaylight.alto.commons.RFC7285MediaType;
+import org.opendaylight.alto.commons.types.RFC7285MediaType;
+import org.opendaylight.alto.services.api.IRDService;
+
+//import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.NetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.IRD;
 
-import org.codehaus.jettison.json.JSONObject;
 import javax.ws.rs.Path;
 import javax.ws.rs.GET;
 import javax.ws.rs.Produces;
+import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
 import org.slf4j.Logger;
@@ -23,27 +27,23 @@ public class AltoNorthbound {
 
     private static final Logger mLogger = LoggerFactory.getLogger(AltoNorthbound.class);
 
-    public class AltoError {
-        public static final String E_SYNTAX = "syntax-error";
-        public static final String E_MISSING_FIELD = "missing-field";
-        public static final String E_INVALID_FIELD_TYPE = "invalid-type";
-        public static final String E_INVALID_FIELD_VALUE = "invalid-value";
-    }
-
     @GET
     @Produces({RFC7285MediaType.ALTO_DIRECTORY, RFC7285MediaType.ALTO_ERROR})
     public Response retrieveIRD() {
-        JSONObject ird = new JSONObject();
+        IRDService fas = new FakeAltoService();
         try {
-            ird.put("test", "ok");
+            IRD ird = fas.getIRD();
+            return Response.ok(ird, RFC7285MediaType.ALTO_DIRECTORY).build();
         } catch (Exception e) {
         }
-        return Response.ok(ird.toString(), RFC7285MediaType.ALTO_ERROR).build();
+        return Response.ok("", RFC7285MediaType.ALTO_ERROR).build();
     }
 
-    @Path("/hello")
+    @Path("/networkmap/{networkmap_id}")
     @GET
-    public Response sayHello() {
-        return Response.ok(new String("hello alto")).build();
+    @Produces({RFC7285MediaType.ALTO_NETWORKMAP, RFC7285MediaType.ALTO_ERROR})
+    public Response retrieveNetworkMap(@PathParam(value = "networkmap_id") String nmap_id) {
+        /* TODO */
+        return Response.ok("", RFC7285MediaType.ALTO_ERROR).build();
     }
 }
diff --git a/alto-northbound/src/main/java/org/opendaylight/alto/northbound/FakeAltoService.java b/alto-northbound/src/main/java/org/opendaylight/alto/northbound/FakeAltoService.java
new file mode 100644 (file)
index 0000000..a33cf67
--- /dev/null
@@ -0,0 +1,61 @@
+package org.opendaylight.alto.northbound;
+
+import org.opendaylight.alto.services.api.IRDService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.IRD;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.did.rev141101.alto.resources.IRDBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ird.MetaBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.cost.types.CostTypes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.cost.types.CostTypesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.cost.types.CostTypesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.CostTypeName;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.CostMode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.CostMetric;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ird.data.Resources;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ird.data.ResourcesKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ird.data.ResourcesBuilder;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.MediaType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ResourceId;
+
+import java.util.List;
+import java.util.ArrayList;
+
+class FakeAltoService implements IRDService {
+    @Override
+    public IRD getIRD() {
+        IRDBuilder irdb = new IRDBuilder();
+        MetaBuilder mb = new MetaBuilder();
+
+        List<CostTypes> cost_types = new ArrayList<CostTypes>();
+        CostTypesBuilder cb = new CostTypesBuilder();
+        CostTypeName name = new CostTypeName("num-routing");
+        CostMetric metric = new CostMetric(CostMetric.Enumeration.Routingcost);
+        CostMode mode = CostMode.Numerical;
+        CostTypesKey ckey = new CostTypesKey(name);
+
+        cost_types.add(cb.setCostTypeName(name).setCostMetric(metric).setCostMode(mode).setKey(ckey).build());
+        irdb.setMeta(mb.setCostTypes(cost_types).build());
+
+
+        List<Resources> resources = new ArrayList<Resources>();
+        ResourcesBuilder rb = new ResourcesBuilder();
+
+        MediaType mt = new MediaType(MediaType.Enumeration.AltoNetworkmap);
+        Uri uri = new Uri("http://localhost:8080/controller/nb/v2/networkmap/default");
+        ResourcesKey rkey = new ResourcesKey(new ResourceId("my-default-networkmap"));
+
+        resources.add(rb.setMediaType(mt).setUri(uri).setKey(rkey).build());
+        irdb.setResources(resources);
+
+        return irdb.build();
+    }
+
+    @Override
+    public boolean register(ResourceId id, Resources resource) {
+        return true;
+    }
+
+    @Override
+    public void unregister(ResourceId id) {
+    }
+}
index 3e2d311f944915ed088fabeff8ba22b38c426bfd..fac6ac43eae016716956970ad849a2ed374889d3 100644 (file)
             <http-method>DELETE</http-method>
             <http-method>HEAD</http-method>
           </web-resource-collection>
-          <auth-constraint>
-            <role-name>System-Admin</role-name>
-            <role-name>Network-Admin</role-name>
-            <role-name>Network-Operator</role-name>
-            <role-name>Container-User</role-name>
-          </auth-constraint>
         </security-constraint>
-
-        <security-role>
-                <role-name>System-Admin</role-name>
-        </security-role>
-        <security-role>
-                <role-name>Network-Admin</role-name>
-        </security-role>
-        <security-role>
-                <role-name>Network-Operator</role-name>
-        </security-role>
-        <security-role>
-                <role-name>Container-User</role-name>
-        </security-role>
-
-        <login-config>
-                <auth-method>BASIC</auth-method>
-                <realm-name>opendaylight</realm-name>
-        </login-config>
 </web-app>
 
diff --git a/alto-northbound/src/main/yang/alto.yang b/alto-northbound/src/main/yang/alto.yang
deleted file mode 100644 (file)
index 7d69a6c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-module alto {
-    yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:alto";
-    prefix "alto";
-
-    revision "2015-01-05" {
-        description "Initial revision of alto model";
-    }
-}
diff --git a/alto-services/pom.xml b/alto-services/pom.xml
new file mode 100644 (file)
index 0000000..2861fc9
--- /dev/null
@@ -0,0 +1,83 @@
+<?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">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.opendaylight.alto</groupId>
+    <artifactId>alto-parent</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+
+  <groupId>org.opendaylight.alto</groupId>
+  <artifactId>services.api</artifactId>
+  <packaging>bundle</packaging>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <version>${checkstyle.version}</version>
+
+        <executions>
+          <execution>
+            <phase>process-sources</phase>
+            <goals>
+              <goal>check</goal>
+            </goals>
+          </execution>
+        </executions>
+
+        <configuration>
+          <failsOnError>true</failsOnError>
+          <configLocation>controller/checkstyle.xml</configLocation>
+          <consoleOutput>true</consoleOutput>
+          <includeTestSourceDirectory>true</includeTestSourceDirectory>
+          <sourceDirectory>${project.basedir}</sourceDirectory>
+          <excludes>**\/target\/,**\/bin\/,**\/third-party,**\/yang-gen-sal</excludes>
+        </configuration>
+
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>checkstyle</artifactId>
+            <version>${controller.checkstyle.version}</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>${bundle.plugin.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <instructions>
+            <Import-Package>
+              org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
+            </Import-Package>
+            <Export-Package>
+              org.opendaylight.alto.services.api.*;
+            </Export-Package>
+            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
+          </instructions>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-model</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+  </dependencies>
+</project>
+
diff --git a/alto-services/src/main/java/org/opendaylight/alto/services/api/IRDService.java b/alto-services/src/main/java/org/opendaylight/alto/services/api/IRDService.java
new file mode 100644 (file)
index 0000000..a72f56c
--- /dev/null
@@ -0,0 +1,16 @@
+
+package org.opendaylight.alto.services.api;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.IRD;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ird.data.Resources;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev141101.ResourceId;
+
+public interface IRDService {
+
+    public IRD getIRD();
+
+    public boolean register(ResourceId id, Resources resource);
+
+    public void unregister(ResourceId id);
+
+}
diff --git a/checkstyle.xml b/checkstyle.xml
deleted file mode 100644 (file)
index bce0694..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<!-- Copyright IBM Corporation, 2013.  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
--->
-<!DOCTYPE module PUBLIC
-    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-
-<module name="Checker">
-</module>
index faa82bcd6530b430d8539f2a0e9dd406bd75e2cd..3114060382e9c81f59774856111cf7fdbdbd8216 100644 (file)
@@ -52,6 +52,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-mdsal</artifactId>
@@ -60,6 +61,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <type>xml</type>
       <scope>runtime</scope>
     </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-restconf</artifactId>
@@ -67,17 +69,32 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <version>${mdsal.version}</version>
       <type>xml</type>
       <scope>runtime</scope>
-     </dependency>
-     <dependency>
+    </dependency>
+
+    <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>alto-model</artifactId>
       <version>${project.version}</version>
     </dependency>
+
     <dependency>
       <groupId>${project.groupId}</groupId>
-      <artifactId>alto-provider</artifactId>
+      <artifactId>commons</artifactId>
       <version>${project.version}</version>
     </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>services.api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-northbound</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
   </dependencies>
 
   <build>
index e7c215889baca20194d318a111cf49c019c9ba83..60b616b7e138b3dc18f93580ff13aabf2fdba82c 100644 (file)
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
 <!--
 Copyright (c) 2015 Yale University
 
@@ -13,17 +12,35 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <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.controller/features-restconf/${mdsal.version}/xml/features</repository>
+
   <feature name='odl-alto-model' version='${project.version}' description='OpenDaylight :: alto :: model '>
     <feature version='${yangtools.version}'>odl-yangtools-models</feature>
     <bundle>mvn:org.opendaylight.alto/alto-model/${project.version}</bundle>
   </feature>
+
+  <feature name='odl-alto-utils' version='${project.version}' description='OpenDaylight :: alto :: utils'>
+    <feature version='${project.version}'>odl-alto-model</feature>
+    <bundle>mvn:org.opendaylight.alto/commons/${project.version}</bundle>
+    <bundle>mvn:org.opendaylight.alto/services.api/${project.version}</bundle>
+  </feature>
+
+  <feature name='odl-alto-northbound' version='${project.version}' description='Opendaylight :: alto :: northbound'>
+    <feature version='${project.version}'>odl-alto-model</feature>
+    <feature version='${project.version}'>odl-alto-utils</feature>
+    <feature version='${jersey.version}'>odl-base-jersey</feature>
+    <feature version='${controller.commons.northbound.version}'>odl-adsal-northbound</feature>
+    <bundle>mvn:org.opendaylight.alto/alto-northbound/${project.version}</bundle>
+  </feature>
+
+  <!-- TODO need to create such a configuration file
+  <configfile finalname="alto-provider-default-config.xml">mvn:org.opendaylight.alto/alto-provider/${project.version}/xml/config</configfile>
+  -->
+
+  <!-- TODO not implemented yet
   <feature name='odl-alto-provider' version='${project.version}' description='OpenDaylight :: alto :: provider '>
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
     <feature version='${project.version}'>odl-alto-model</feature>
     <bundle>mvn:org.opendaylight.alto/alto-provider/${project.version}</bundle>
-    <!-- TODO need to create such a configuration file
-    <configfile finalname="alto-provider-default-config.xml">mvn:org.opendaylight.alto/alto-provider/${project.version}/xml/config</configfile>
-    -->
   </feature>
   <feature name='odl-alto-provider-rest' version='${project.version}' description='OpenDaylight :: alto :: provider :: REST '>
     <feature version="${project.version}">odl-alto-provider</feature>
@@ -34,5 +51,5 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <feature version="${mdsal.version}">odl-mdsal-apidocs</feature>
     <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
   </feature>
-
+  -->
 </features>
diff --git a/pom.xml b/pom.xml
index 50e09a6fec3f020145b11d18088aa1127bba99f1..b5f34afc8d4b8d91690687efdb77ae13303ee4ae 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,7 @@
         <ietf.topology.version>2013.10.21.2-SNAPSHOT</ietf.topology.version>
         <yang.ext.version>2013.09.07.7-SNAPSHOT</yang.ext.version>
         <config.version>0.3.0-SNAPSHOT</config.version>
+        <sal.version>0.7.1-SNAPSHOT</sal.version>
         <mdsal.version>1.2.0-SNAPSHOT</mdsal.version>
         <controller.model.version>1.2.0-SNAPSHOT</controller.model.version>
         <build.helper.version>1.8</build.helper.version>
@@ -54,6 +55,9 @@
         <config.parent.version>0.3.0-SNAPSHOT</config.parent.version>
         <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
         <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
+        <jersey.version>1.17</jersey.version>
+        <jersey.servlet.version>1.17</jersey.servlet.version>
+        <jersey.json.version>1.17</jersey.json.version>
         <jackson.version>2.3.2</jackson.version>
         <config.version>0.3.0-SNAPSHOT</config.version>
 
@@ -72,6 +76,8 @@
         <feature.test.version>1.5.0-SNAPSHOT</feature.test.version>
         <karaf.empty.version>1.5.0-SNAPSHOT</karaf.empty.version>
         <controller.checkstyle.version>0.1.0-SNAPSHOT</controller.checkstyle.version>
+        <controller.commons.northbound.version>0.5.0-SNAPSHOT</controller.commons.northbound.version>
+        <corsfilter.version>7.0.42</corsfilter.version>
 
         <!-- Test Libraries -->
         <powermock.version>1.5.6</powermock.version>
     <modules>
         <module>alto-model</module>
         <module>alto-provider</module>
-        <module>alto-northbound</module>
         <module>alto-artifacts</module>
         <module>features</module>
-        <module>commons</module>
+        <module>alto-commons</module>
+        <module>alto-services</module>
+        <!--
         <module>alto-karaf</module>
+        -->
+        <module>alto-northbound</module>
     </modules>
 
     <build>