Support for network service for alto-northbound 11/20211/1
authorGao Kai <gaok12@mails.tsinghua.edu.cn>
Wed, 13 May 2015 02:56:42 +0000 (10:56 +0800)
committerGao Kai <gaok12@mails.tsinghua.edu.cn>
Wed, 13 May 2015 02:56:42 +0000 (10:56 +0800)
Change-Id: I4d3d69aa8898b456a2f7ce0f5003b145d92fe91f
Signed-off-by: Gao Kai <gaok12@mails.tsinghua.edu.cn>
20 files changed:
alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/RFC2ModelCostMapConverter.java
alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCAddressGroupConverter.java [new file with mode: 0644]
alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCNetworkMapConverter.java [new file with mode: 0644]
alto-commons/src/main/java/org/opendaylight/alto/commons/types/model150404/ModelJSONMapper.java
alto-commons/src/main/java/org/opendaylight/alto/commons/types/rfc7285/FormatValidator.java
alto-commons/src/main/java/org/opendaylight/alto/commons/types/rfc7285/RFC7285JSONMapper.java
alto-extensions/fake/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/AltoNorthboundRSApplication.java
alto-services/provider/pom.xml
alto-services/provider/simple-alto/pom.xml [new file with mode: 0644]
alto-services/provider/simple-alto/src/main/config/default-config.xml [new file with mode: 0644]
alto-services/provider/simple-alto/src/main/java/org/opendaylight/alto/services/provider/simple/SimpleAltoService.java [new file with mode: 0644]
alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModule.java [new file with mode: 0644]
alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModuleFactory.java [new file with mode: 0644]
alto-services/provider/simple-alto/src/main/yang/simple-alto.yang [new file with mode: 0644]
features/pom.xml
features/src/main/resources/features.xml
pom.xml

index 62a278a4538c62da68c3060e4821a53dc078a196..14a0b2acaa3e50ccfe9a8db16839c34d434443da 100644 (file)
@@ -6,26 +6,26 @@ import org.opendaylight.alto.commons.types.model150404.ModelCostMap;
 import org.opendaylight.alto.commons.types.model150404.ModelCostMapData;
 import org.opendaylight.alto.commons.types.rfc7285.RFC7285CostMap;
 
-public class RFC2ModelCostMapConverter 
+public class RFC2ModelCostMapConverter
     extends Converter<RFC7285CostMap, ModelCostMap>{
 
   protected RFC2ModelCostMapMetaConverter metaConv = new RFC2ModelCostMapMetaConverter();
   protected RFC2ModelCostMapDataConverter dataConv = new RFC2ModelCostMapDataConverter();
-  
+
   public RFC2ModelCostMapConverter() {
   }
 
   public RFC2ModelCostMapConverter(RFC7285CostMap _in) {
       super(_in);
   }
-  
+
   @Override
   protected Object _convert() {
     ModelCostMap out = new ModelCostMap();
     out.rid = getCostMapResourceId(in());
     //TODO: replace the dummy one in the future
     out.tag = "da65eca2eb7a10ce8b059740b0b2e3f8eb1d4786";
-    
+
     out.meta = metaConv.convert(in().meta);
     out.map = new LinkedList<ModelCostMapData>();
     for (String src : in().map.keySet()) {
@@ -36,7 +36,7 @@ public class RFC2ModelCostMapConverter
     }
     return out;
   }
-  
+
   private String getCostMapResourceId(RFC7285CostMap costMap) {
     String networkMapRID = costMap.meta.netmap_tags.get(0).rid;
     String costMetric = costMap.meta.costType.metric;
diff --git a/alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCAddressGroupConverter.java b/alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCAddressGroupConverter.java
new file mode 100644 (file)
index 0000000..1cec730
--- /dev/null
@@ -0,0 +1,42 @@
+package org.opendaylight.alto.commons.types.converter;
+
+import org.opendaylight.alto.commons.helper.Converter;
+
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285VersionTag;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285Endpoint;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class YANGJSON2RFCAddressGroupConverter extends Converter<JsonNode, RFC7285Endpoint.AddressGroup> {
+    public YANGJSON2RFCAddressGroupConverter() {
+    }
+
+    public YANGJSON2RFCAddressGroupConverter(JsonNode _in) {
+        super(_in);
+    }
+
+    @Override
+    protected Object _convert() {
+        JsonNode node = this.in();
+        RFC7285Endpoint.AddressGroup ag = new RFC7285Endpoint.AddressGroup();
+
+        for (JsonNode address: node) {
+            JsonNode prefixes = address.get("endpointPrefix");
+            assert !prefixes.isArray();
+            for (JsonNode prefix: prefixes) {
+                JsonNode ipv4 = prefix.get("ipv4Prefix");
+                JsonNode ipv6 = prefix.get("ipv6Prefix");
+                if ((ipv4 != null) && (!ipv4.isNull())) {
+                    ag.ipv4.add(ipv4.get("value").asText());
+                }
+                if ((ipv6 != null) && (!ipv6.isNull())) {
+                    ag.ipv6.add(ipv6.get("value").asText());
+                }
+            }
+        }
+        return ag;
+    }
+
+}
diff --git a/alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCNetworkMapConverter.java b/alto-commons/src/main/java/org/opendaylight/alto/commons/types/converter/YANGJSON2RFCNetworkMapConverter.java
new file mode 100644 (file)
index 0000000..fb7a895
--- /dev/null
@@ -0,0 +1,50 @@
+package org.opendaylight.alto.commons.types.converter;
+
+import org.opendaylight.alto.commons.helper.Converter;
+
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285NetworkMap;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285VersionTag;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285Endpoint;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.fasterxml.jackson.databind.JsonNode;
+
+public class YANGJSON2RFCNetworkMapConverter extends Converter<JsonNode, RFC7285NetworkMap> {
+    public YANGJSON2RFCNetworkMapConverter() {
+    }
+
+    public YANGJSON2RFCNetworkMapConverter(JsonNode _in) {
+        super(_in);
+    }
+
+    protected YANGJSON2RFCAddressGroupConverter group_converter
+                = new YANGJSON2RFCAddressGroupConverter();
+
+    @Override
+    protected Object _convert() {
+        JsonNode node = this.in();
+        RFC7285NetworkMap nm = new RFC7285NetworkMap();
+
+        String resource_id = node.get("resourceId").get("value").asText();
+        String tag = node.get("tag").get("value").asText();
+
+        nm.meta.vtag = new RFC7285VersionTag(resource_id, tag);
+
+        JsonNode map = node.get("map");
+        assert !map.isArray();
+        for (JsonNode egroup: map) {
+            String pid = extract_pid(egroup);
+            JsonNode addr_group = egroup.get("endpointAddressGroup");
+            assert addr_group.isNull();
+            RFC7285Endpoint.AddressGroup ag = group_converter.convert(addr_group);
+
+            nm.map.put(pid, ag);
+        }
+        return nm;
+    }
+
+    protected String extract_pid(JsonNode node) {
+        return node.get("pid").get("value").asText();
+    }
+}
index 84dc470f0e7b3b775493f4325eb6280bed603900..0dc3d304e1c6c80f7b0ec41b7cf539efd2d0ed5f 100644 (file)
@@ -14,22 +14,23 @@ public class ModelJSONMapper {
                             .setSerializationInclusion(Include.NON_DEFAULT)
                             .disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
 
+
     public ModelNetworkMap asNetworkMap(String json) throws Exception {
       return mapper.readValue(json, ModelNetworkMap.class);
     }
-    
+
     public List<ModelNetworkMap> asNetworkMapList(String json) throws Exception {
       return Arrays.asList(mapper.readValue(json, ModelNetworkMap[].class));
     }
-    
+
     public ModelCostMap asCostMap(String json) throws Exception {
       return mapper.readValue(json, ModelCostMap.class);
     }
-    
+
     public List<ModelCostMap> asCostMapList(String json) throws Exception {
       return Arrays.asList(mapper.readValue(json, ModelCostMap[].class));
     }
-    
+
     public ModelEndpointPropertyMap asEndpointPropMap(String json) throws Exception {
       return mapper.readValue(json, ModelEndpointPropertyMap.class);
     }
index 2cefed380307bb2ef8d6a067f449e217b804f9a3..5f2bd27dcc0ca87b2e0d6c37eec8f933e88cd93d 100644 (file)
@@ -15,7 +15,7 @@ public class FormatValidator {
                             = Pattern.compile("^["+VALID_CHARSET_WITH_DOT+"]{1,64}$");
     private static final String VALID_TAG_CHARSET = "!-~";
     private static final Pattern VALID_TAG_PATTERN
-                            = Pattern.compile("^["+VALID_TAG_CHARSET+"]{1,64}$}");
+                            = Pattern.compile("^["+VALID_TAG_CHARSET+"]{1,64}$");
 
     public static boolean validId(String id) {
         return VALID_ID_PATTERN.matcher(id).matches();
index eb118daddb3d2a7f902ab97a8cc18708dd7f8242..ebd2d6993b09cc8b2770a02f5c11e76f7d96dda9 100644 (file)
@@ -36,7 +36,7 @@ public class RFC7285JSONMapper {
     public RFC7285CostMap asCostMap(String json) throws Exception {
         return mapper.readValue(json, RFC7285CostMap.class);
     }
-    
+
     public List<RFC7285CostMap> asCostMapList(String json) throws Exception {
       return Arrays.asList(mapper.readValue(json, RFC7285CostMap[].class));
     }
@@ -60,7 +60,7 @@ public class RFC7285JSONMapper {
     public RFC7285NetworkMap asNetworkMap(String json) throws Exception {
         return mapper.readValue(json, RFC7285NetworkMap.class);
     }
-    
+
     public List<RFC7285NetworkMap> asNetworkMapList(String json) throws Exception {
       return Arrays.asList(mapper.readValue(json, RFC7285NetworkMap[].class));
     }
@@ -76,7 +76,7 @@ public class RFC7285JSONMapper {
     public RFC7285VersionTag asVersionTag(String json) throws Exception {
         return mapper.readValue(json, RFC7285VersionTag.class);
     }
-    
+
     public RFC7285EndpointPropertyMap asEndpointPropMap(String json) throws Exception {
       return mapper.readValue(json, RFC7285EndpointPropertyMap.class);
   }
index 0141e95e351985c6f8005bd1ec671dcf2c785c22..8c7b37ba5e3c477dde161984c08361bc45c97c32 100644 (file)
         <extensions>true</extensions>
         <configuration>
           <instructions>
-            <Import-Package>
-              org.opendaylight.alto.services.api.rfc7285,
-              org.opendaylight.alto.commons.types.rfc7285,
-              org.slf4j,
-            </Import-Package>
+            <Import-Package>*</Import-Package>
             <Export-Package>
               org.opendaylight.alto.ext.fake;
             </Export-Package>
index 3e50fabd820dd2389abd2efb719eea67fe22392d..d7862b6d0f9c4adfb790d0b3f2f53eafa572cb05 100644 (file)
           <instructions>
             <Import-Package>
               org.opendaylight.yang.gen.v1.urn.opendaylight.alto.*,
-              org.opendaylight.alto.ext.fake,
               org.opendaylight.alto.services.api.rfc7285,
               org.opendaylight.alto.commons.*,
               org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924,
               org.apache.commons.logging,
               com.sun.jersey.spi.container.servlet,
-              org.opendaylight.controller.northbound.commons,
-              org.opendaylight.controller.northbound.commons.exception,
-              org.opendaylight.controller.northbound.commons.utils,
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.sal.authorization,
               org.opendaylight.controller.sal.packet.address,
       <version>${controller.commons.northbound.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-common-util</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
       <artifactId>service-api-rfc7285</artifactId>
       <version>${project.version}</version>
     </dependency>
-
-    <dependency>
-      <groupId>${project.groupId}</groupId>
-      <artifactId>alto-fake-extension</artifactId>
-      <version>${project.version}</version>
-    </dependency>
   </dependencies>
 </project>
index 0c29ab5d472d982901468f1a6d190f232a170bc9..09abd6621fe4fa3a9fc89413c6e45f640bccfb18 100644 (file)
@@ -27,12 +27,18 @@ import org.opendaylight.alto.commons.types.rfc7285.RFC7285CostMap;
 import org.opendaylight.alto.commons.types.rfc7285.RFC7285Endpoint;
 
 import org.opendaylight.alto.services.api.rfc7285.AltoService;
+import org.opendaylight.alto.services.api.rfc7285.IRDService;
+import org.opendaylight.alto.services.api.rfc7285.NetworkMapService;
+import org.opendaylight.alto.services.api.rfc7285.CostMapService;
+import org.opendaylight.alto.services.api.rfc7285.EndpointCostService;
+import org.opendaylight.alto.services.api.rfc7285.EndpointPropertyService;
 
-import org.opendaylight.alto.ext.fake.FakeAltoService;
 
 import org.opendaylight.alto.northbound.exception.AltoBasicException;
 import org.opendaylight.alto.northbound.exception.AltoBadFormatException;
 
+import org.opendaylight.controller.sal.utils.ServiceHelper;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,11 +47,18 @@ public class AltoNorthbound {
 
     private static final Logger logger = LoggerFactory.getLogger(AltoNorthbound.class);
 
-    private AltoService altoService = new FakeAltoService();
     private RFC7285JSONMapper mapper = new RFC7285JSONMapper();
 
-    private void checkAltoService() throws Exception {
-        if (altoService == null)
+    private <E> E getService(Class<E> clazz) {
+        E service = (E)ServiceHelper.getGlobalInstance(clazz, this);
+        if (service == null) {
+            service = (E)ServiceHelper.getGlobalInstance(AltoService.class, this);
+        }
+        return service;
+    }
+
+    private void checkService(Object service) throws Exception {
+        if (service == null)
             throw new AltoBasicException(Status.SERVICE_UNAVAILABLE, null);
     }
 
@@ -85,9 +98,10 @@ public class AltoNorthbound {
     @GET
     @Produces({ MediaType.ALTO_DIRECTORY, MediaType.ALTO_ERROR })
     public Response retrieveIRD() throws Exception {
-        checkAltoService();
+        IRDService service = getService(IRDService.class);
+        checkService(service);
 
-        RFC7285IRD ird = altoService.getDefaultIRD();
+        RFC7285IRD ird = service.getDefaultIRD();
         if (ird == null)
             return fail(Status.NOT_FOUND, null);
         return success(ird, MediaType.ALTO_DIRECTORY);
@@ -98,10 +112,11 @@ public class AltoNorthbound {
     @Produces({ MediaType.ALTO_DIRECTORY, MediaType.ALTO_ERROR })
     public Response retrieveIRD(
             @PathParam("id") String id) throws Exception {
-        checkAltoService();
+        IRDService service = getService(IRDService.class);
+        checkService(service);
         checkResourceId(id);
 
-        RFC7285IRD ird = altoService.getIRD(id);
+        RFC7285IRD ird = service.getIRD(id);
         if (ird == null)
             return fail(Status.NOT_FOUND, id);
         return success(ird, MediaType.ALTO_DIRECTORY);
@@ -111,9 +126,10 @@ public class AltoNorthbound {
     @GET
     @Produces({ MediaType.ALTO_NETWORKMAP, MediaType.ALTO_ERROR })
     public Response retrieveDefaultNetworkMap() throws Exception {
-        checkAltoService();
+        NetworkMapService service = getService(NetworkMapService.class);
+        checkService(service);
 
-        RFC7285NetworkMap map = altoService.getDefaultNetworkMap();
+        RFC7285NetworkMap map = service.getDefaultNetworkMap();
         if (map == null)
             return fail(Status.NOT_FOUND, null);
         return success(map, MediaType.ALTO_NETWORKMAP);
@@ -124,10 +140,11 @@ public class AltoNorthbound {
     @Produces({ MediaType.ALTO_NETWORKMAP, MediaType.ALTO_ERROR })
     public Response retrieveNetworkMap(
             @PathParam("id") String id) throws Exception {
-        checkAltoService();
+        NetworkMapService service = getService(NetworkMapService.class);
+        checkService(service);
         checkResourceId(id);
 
-        RFC7285NetworkMap map = altoService.getNetworkMap(id);
+        RFC7285NetworkMap map = service.getNetworkMap(id);
         if (map == null)
             return fail(Status.NOT_FOUND, id);
         return success(map, MediaType.ALTO_NETWORKMAP);
@@ -139,12 +156,13 @@ public class AltoNorthbound {
     public Response retrieveNetworkMap(
             @PathParam("id") String id,
             @PathParam("tag") String tag) throws Exception {
-        checkAltoService();
+        NetworkMapService service = getService(NetworkMapService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
-        RFC7285NetworkMap map = altoService.getNetworkMap(vtag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285NetworkMap map = service.getNetworkMap(vtag);
         if (map == null)
             return fail(Status.NOT_FOUND, vtag);
         return success(map, MediaType.ALTO_NETWORKMAP);
@@ -154,10 +172,11 @@ public class AltoNorthbound {
     @GET
     @Produces({ MediaType.ALTO_COSTMAP, MediaType.ALTO_ERROR})
     public Response retrieveCostMap(@PathParam("id") String id) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
 
-        RFC7285CostMap map = altoService.getCostMap(id);
+        RFC7285CostMap map = service.getCostMap(id);
         if (map == null)
             return fail(Status.NOT_FOUND, id);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -169,12 +188,13 @@ public class AltoNorthbound {
     public Response retrieveCostMap(
             @PathParam("id") String id,
             @PathParam("tag") String tag) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
-        RFC7285CostMap map = altoService.getCostMap(vtag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285CostMap map = service.getCostMap(vtag);
         if (map == null)
             return fail(Status.NOT_FOUND, vtag);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -187,13 +207,14 @@ public class AltoNorthbound {
             @PathParam("id") String id,
             @PathParam("mode") String mode,
             @PathParam("metric") String metric) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
 
         RFC7285CostType costType = new RFC7285CostType(mode, metric);
-        if (!altoService.supportCostType(id, costType))
+        if (!service.supportCostType(id, costType))
             return fail(Status.NOT_FOUND, costType);
-        RFC7285CostMap map = altoService.getCostMap(id, costType);
+        RFC7285CostMap map = service.getCostMap(id, costType);
         if (map == null)
             return fail(Status.NOT_FOUND, id);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -207,15 +228,16 @@ public class AltoNorthbound {
             @PathParam("tag") String tag,
             @PathParam("mode") String mode,
             @PathParam("metric") String metric) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
         RFC7285CostType costType = new RFC7285CostType(mode, metric);
-        if (!altoService.supportCostType(vtag, costType))
+        if (!service.supportCostType(vtag, costType))
             return fail(Status.NOT_FOUND, costType);
-        RFC7285CostMap map = altoService.getCostMap(vtag, costType);
+        RFC7285CostMap map = service.getCostMap(vtag, costType);
         if (map == null)
             return fail(Status.NOT_FOUND, vtag);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -227,14 +249,15 @@ public class AltoNorthbound {
     @Produces({ MediaType.ALTO_NETWORKMAP, MediaType.ALTO_ERROR})
     public Response retrieveFilteredNetworkMap(
             @PathParam("id") String id, String filterJSON) throws Exception {
-        checkAltoService();
+        NetworkMapService service = getService(NetworkMapService.class);
+        checkService(service);
         checkResourceId(id);
 
         RFC7285NetworkMap.Filter filter = mapper.asNetworkMapFilter(filterJSON);
 
-        if (!altoService.validateNetworkMapFilter(id, filter))
+        if (!service.validateNetworkMapFilter(id, filter))
             return fail(Status.BAD_REQUEST, filter);
-        RFC7285NetworkMap map = altoService.getNetworkMap(id, filter);
+        RFC7285NetworkMap map = service.getNetworkMap(id, filter);
         if (map == null)
             return fail(Status.NOT_FOUND, id);
         return success(map, MediaType.ALTO_NETWORKMAP);
@@ -248,16 +271,17 @@ public class AltoNorthbound {
             @PathParam("id") String id,
             @PathParam("tag") String tag,
             String filterJSON) throws Exception {
-        checkAltoService();
+        NetworkMapService service = getService(NetworkMapService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
         RFC7285NetworkMap.Filter filter = mapper.asNetworkMapFilter(filterJSON);
-        if (!altoService.validateNetworkMapFilter(vtag, filter))
+        if (!service.validateNetworkMapFilter(vtag, filter))
             return fail(Status.BAD_REQUEST, filter);
 
-        RFC7285NetworkMap map = altoService.getNetworkMap(vtag, filter);
+        RFC7285NetworkMap map = service.getNetworkMap(vtag, filter);
         if (map == null)
             return fail(Status.NOT_FOUND, vtag);
         return success(map, MediaType.ALTO_NETWORKMAP);
@@ -269,14 +293,15 @@ public class AltoNorthbound {
     @Produces({ MediaType.ALTO_COSTMAP, MediaType.ALTO_ERROR})
     public Response retrieveFilteredCostMap(
             @PathParam("id") String id, String filterJSON) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
 
         RFC7285CostMap.Filter filter = mapper.asCostMapFilter(filterJSON);
-        if (!altoService.validateCostMapFilter(id, filter))
+        if (!service.validateCostMapFilter(id, filter))
             return fail(Status.BAD_REQUEST, filter);
 
-        RFC7285CostMap map = altoService.getCostMap(id, filter);
+        RFC7285CostMap map = service.getCostMap(id, filter);
         if (map == null)
             return fail(Status.NOT_FOUND, id);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -289,16 +314,17 @@ public class AltoNorthbound {
     public Response retrieveFilteredCostMap(
             @PathParam("id") String id,
             @PathParam("tag") String tag, String filterJSON) throws Exception {
-        checkAltoService();
+        CostMapService service = getService(CostMapService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
         RFC7285CostMap.Filter filter = mapper.asCostMapFilter(filterJSON);
-        if (!altoService.validateCostMapFilter(vtag, filter))
+        if (!service.validateCostMapFilter(vtag, filter))
             return fail(Status.BAD_REQUEST, filter);
 
-        RFC7285CostMap map = altoService.getCostMap(vtag, filter);
+        RFC7285CostMap map = service.getCostMap(vtag, filter);
         if (map == null)
             return fail(Status.NOT_FOUND, vtag);
         return success(map, MediaType.ALTO_COSTMAP);
@@ -311,11 +337,12 @@ public class AltoNorthbound {
     public Response retrieveEndpointPropMap(
             @PathParam("id") String id,
             String params) throws Exception {
-        checkAltoService();
+        EndpointPropertyService service = getService(EndpointPropertyService.class);
+        checkService(service);
         checkResourceId(id);
 
         RFC7285Endpoint.PropertyRequest request = mapper.asPropertyRequest(params);
-        RFC7285Endpoint.PropertyResponse response = altoService.getEndpointProperty(id, request);
+        RFC7285Endpoint.PropertyResponse response = service.getEndpointProperty(id, request);
         if (response == null)
             return fail(Status.NOT_FOUND, request);
         return success(response, MediaType.ALTO_ENDPOINT_PROP);
@@ -329,13 +356,14 @@ public class AltoNorthbound {
             @PathParam("id") String id,
             @PathParam("tag") String tag,
             String params) throws Exception {
-        checkAltoService();
+        EndpointPropertyService service = getService(EndpointPropertyService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
-       RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
+        RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
         RFC7285Endpoint.PropertyRequest request = mapper.asPropertyRequest(params);
-        RFC7285Endpoint.PropertyResponse response = altoService.getEndpointProperty(vtag, request);
+        RFC7285Endpoint.PropertyResponse response = service.getEndpointProperty(vtag, request);
         if (response == null)
             return fail(Status.NOT_FOUND, request);
         return success(response, MediaType.ALTO_ENDPOINT_PROP);
@@ -348,11 +376,12 @@ public class AltoNorthbound {
     public Response retrieveEndpointCostMap(
             @PathParam("id") String id,
             String params) throws Exception {
-        checkAltoService();
+        EndpointCostService service = getService(EndpointCostService.class);
+        checkService(service);
         checkResourceId(id);
 
         RFC7285Endpoint.CostRequest request = mapper.asCostRequest(params);
-        RFC7285Endpoint.CostResponse response = altoService.getEndpointCost(id, request);
+        RFC7285Endpoint.CostResponse response = service.getEndpointCost(id, request);
         if (response == null)
             return fail(Status.NOT_FOUND, request);
         return success(response, MediaType.ALTO_ENDPOINT_COST);
@@ -366,13 +395,14 @@ public class AltoNorthbound {
             @PathParam("id") String id,
             @PathParam("tag") String tag,
             String params) throws Exception {
-        checkAltoService();
+        EndpointCostService service = getService(EndpointCostService.class);
+        checkService(service);
         checkResourceId(id);
         checkTag(tag);
 
         RFC7285VersionTag vtag = new RFC7285VersionTag(id, tag);
         RFC7285Endpoint.CostRequest request = mapper.asCostRequest(params);
-        RFC7285Endpoint.CostResponse response = altoService.getEndpointCost(vtag, request);
+        RFC7285Endpoint.CostResponse response = service.getEndpointCost(vtag, request);
         if (response == null)
             return fail(Status.NOT_FOUND, request);
         return success(response, MediaType.ALTO_ENDPOINT_COST);
index 3239286463638fedc6b57d16c3b6b7c027711d3f..6ab9bc6f4f410ea54ad879345a57a8239381cbb6 100644 (file)
@@ -9,7 +9,6 @@ public class AltoNorthboundRSApplication extends Application {
     public Set<Class<?>> getClasses() {
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(AltoNorthbound.class);
-        classes.add(Echo.class);
         return classes;
     }
 }
index f3883da5bb05977b8ab3458ee0f1c92d8add25fd..cb53fd0afaf56d495983062bb092af8ba7c23db1 100644 (file)
@@ -16,6 +16,7 @@
   <packaging>pom</packaging>
 
   <modules>
+    <module>simple-alto</module>
   </modules>
 
 </project>
diff --git a/alto-services/provider/simple-alto/pom.xml b/alto-services/provider/simple-alto/pom.xml
new file mode 100644 (file)
index 0000000..3c6d610
--- /dev/null
@@ -0,0 +1,70 @@
+<?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/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>simple-impl</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>bundle</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-model</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>alto-commons</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>service-api-rfc7285</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <!-- Testing Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-all</artifactId>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal</artifactId>
+      <version>0.9.0-SNAPSHOT</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>config-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>sal-binding-config</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.opendaylight.yangtools.model</groupId>
+      <artifactId>ietf-inet-types</artifactId>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/alto-services/provider/simple-alto/src/main/config/default-config.xml b/alto-services/provider/simple-alto/src/main/config/default-config.xml
new file mode 100644 (file)
index 0000000..df411c5
--- /dev/null
@@ -0,0 +1,25 @@
+<snapshot>
+  <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:alto-simple="urn:opendaylight:alto:simple-impl">
+            alto-simple:simple-alto-adsal-impl
+          </type>
+          <name>simple-alto-adsal-impl</name>
+
+          <data-broker>
+            <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
+              binding:binding-async-data-broker
+            </type>
+            <name>binding-data-broker</name>
+          </data-broker>
+        </module>
+      </modules>
+    </data>
+  </configuration>
+
+  <required-capabilities>
+    <capability>urn:opendaylight:alto:simple-impl?module=simple-alto-adsal-impl&amp;revision=2015-05-12</capability>
+  </required-capabilities>
+</snapshot>
diff --git a/alto-services/provider/simple-alto/src/main/java/org/opendaylight/alto/services/provider/simple/SimpleAltoService.java b/alto-services/provider/simple-alto/src/main/java/org/opendaylight/alto/services/provider/simple/SimpleAltoService.java
new file mode 100644 (file)
index 0000000..4e2349a
--- /dev/null
@@ -0,0 +1,158 @@
+package org.opendaylight.alto.services.provider.simple;
+
+import org.opendaylight.alto.services.api.rfc7285.NetworkMapService;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285NetworkMap;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285Endpoint;
+import org.opendaylight.alto.commons.types.rfc7285.RFC7285VersionTag;
+import org.opendaylight.alto.commons.types.converter.YANGJSON2RFCNetworkMapConverter;
+
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.rev150404.Resources;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.rev150404.resources.IRD;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.rev150404.resources.NetworkMaps;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.rev150404.resources.network.maps.NetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.rev150404.resources.network.maps.NetworkMapKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev150404.ResourceId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev150404.ird.meta.DefaultAltoNetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.types.rev150404.ird.Meta;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+
+import org.opendaylight.controller.sal.utils.ServiceHelper;
+import org.osgi.framework.ServiceRegistration;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.AsyncFunction;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+import java.util.LinkedHashMap;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+public class SimpleAltoService implements NetworkMapService, AutoCloseable {
+
+    private final Logger m_logger = LoggerFactory.getLogger(SimpleAltoService.class);
+    private DataBroker m_db = null;
+    private ObjectMapper m_mapper = new ObjectMapper();
+    private ServiceRegistration m_reg = null;
+    private YANGJSON2RFCNetworkMapConverter m_converter = null;
+
+    public SimpleAltoService(DataBroker db) {
+        this.m_db = db;
+        this.m_reg = ServiceHelper.registerGlobalServiceWReg(NetworkMapService.class, this, null);
+        this.m_converter = new YANGJSON2RFCNetworkMapConverter();
+        assert ServiceHelper.getGlobalInstance(NetworkMapService.class, this) != this;
+    }
+
+    @Override
+    public void close() {
+        this.m_reg.unregister();
+    }
+
+    @Override
+    public RFC7285NetworkMap getDefaultNetworkMap() {
+        //TODO
+        return null;
+    }
+
+    @Override
+    public RFC7285NetworkMap getNetworkMap(String id) {
+        m_logger.info("Handling resource-id: {}", id);
+        InstanceIdentifier<NetworkMap> niid = getNetworkMapIID(id);
+        m_logger.info("IID: {}", niid);
+
+        try {
+            ReadOnlyTransaction tx = m_db.newReadOnlyTransaction();
+            ListenableFuture<Optional<NetworkMap>> result
+                    = tx.read(LogicalDatastoreType.CONFIGURATION, niid);
+            if (result.get().isPresent()) {
+                NetworkMap nm = result.get().get();
+                ObjectNode node = m_mapper.valueToTree(nm);
+                m_logger.info(m_mapper.writeValueAsString(nm));
+
+                RFC7285NetworkMap ret = m_converter.convert(node);
+                return ret;
+            } else {
+                m_logger.info("Failed to read with niid: {}", niid);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public RFC7285NetworkMap getNetworkMap(RFC7285VersionTag vtag) {
+        RFC7285NetworkMap nm = getNetworkMap(vtag.rid);
+
+        if ((nm != null) && (vtag.equals(nm.meta.vtag))) {
+            return nm;
+        }
+        return null;
+    }
+
+    @Override
+    public RFC7285NetworkMap getNetworkMap(String id, RFC7285NetworkMap.Filter filter) {
+        RFC7285NetworkMap nm = getNetworkMap(id);
+
+        if (nm == null)
+            return null;
+
+        LinkedHashMap<String, RFC7285Endpoint.AddressGroup> map
+                    = new LinkedHashMap<String, RFC7285Endpoint.AddressGroup>();
+        for (String pid: filter.pids) {
+            if (nm.map.containsKey(pid))
+                map.put(pid, nm.map.get(pid));
+        }
+        nm.map = map;
+        return nm;
+    }
+
+    @Override
+    public RFC7285NetworkMap getNetworkMap(RFC7285VersionTag vtag, RFC7285NetworkMap.Filter filter) {
+        RFC7285NetworkMap nm = getNetworkMap(vtag.rid, filter);
+        if ((nm != null) && (vtag.equals(nm.meta.vtag))) {
+            return nm;
+        }
+        return null;
+    }
+
+    @Override
+    public Boolean validateNetworkMapFilter(String id, RFC7285NetworkMap.Filter filter) {
+        if ((filter != null) && (filter.pids != null))
+            return true;
+        return false;
+    }
+
+    @Override
+    public Boolean validateNetworkMapFilter(RFC7285VersionTag vtag, RFC7285NetworkMap.Filter filter) {
+        return validateNetworkMapFilter(vtag.rid, filter);
+    }
+
+    protected InstanceIdentifier<DefaultAltoNetworkMap> getDefaultNetworkMapIID() {
+        InstanceIdentifier<DefaultAltoNetworkMap> iid = InstanceIdentifier.builder(Resources.class)
+                                                .child(IRD.class)
+                                                .child(Meta.class)
+                                                .child(DefaultAltoNetworkMap.class).build();
+        return iid;
+    }
+
+    protected InstanceIdentifier<NetworkMap> getNetworkMapIID(String resource_id) {
+        NetworkMapKey key = new NetworkMapKey(ResourceId.getDefaultInstance(resource_id));
+        InstanceIdentifier<NetworkMap> iid = InstanceIdentifier.builder(Resources.class)
+                                                .child(NetworkMaps.class)
+                                                .child(NetworkMap.class, key)
+                                                .build();
+        return iid;
+    }
+}
diff --git a/alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModule.java b/alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModule.java
new file mode 100644 (file)
index 0000000..1554568
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.simple.impl.rev150512;
+
+import org.opendaylight.alto.services.provider.simple.SimpleAltoService;
+
+public class SimpleAltoImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.alto.simple.impl.rev150512.AbstractSimpleAltoImplModule {
+    public SimpleAltoImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public SimpleAltoImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.alto.simple.impl.rev150512.SimpleAltoImplModule 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() {
+        SimpleAltoService service = new SimpleAltoService(this.getDataBrokerDependency());
+        return service;
+    }
+
+}
diff --git a/alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModuleFactory.java b/alto-services/provider/simple-alto/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/alto/simple/impl/rev150512/SimpleAltoImplModuleFactory.java
new file mode 100644 (file)
index 0000000..5ea77f3
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: simple-alto-adsal-impl yang module local name: simple-alto-adsal-impl
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Tue May 12 16:43:21 CST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.simple.impl.rev150512;
+public class SimpleAltoImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.alto.simple.impl.rev150512.AbstractSimpleAltoImplModuleFactory {
+
+}
diff --git a/alto-services/provider/simple-alto/src/main/yang/simple-alto.yang b/alto-services/provider/simple-alto/src/main/yang/simple-alto.yang
new file mode 100644 (file)
index 0000000..9d01c24
--- /dev/null
@@ -0,0 +1,44 @@
+module simple-alto-adsal-impl {
+    yang-version 1;
+    namespace "urn:opendaylight:alto:simple-impl";
+
+    prefix alto-simple;
+
+    import config {
+        prefix config;
+        revision-date 2013-04-05;
+    }
+
+    import opendaylight-md-sal-binding {
+        prefix mdsal;
+        revision-date 2013-10-28;
+    }
+
+    description
+        "This module contains the base YANG definition for adsal-based northbound services";
+
+    revision "2015-05-12" {
+        description "Initial revision";
+    }
+
+    identity simple-alto-adsal-impl {
+        base config:module-type;
+
+        config:java-name-prefix SimpleAltoImpl;
+    }
+
+    augment "/config:modules/config:module/config:configuration" {
+        case simple-alto-adsal-impl {
+            when "/config:modules/config:module/config:type = 'simple-alto-adsal-impl'";
+
+            container data-broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity mdsal:binding-async-data-broker;
+                    }
+                }
+            }
+        }
+    }
+}
index 91d13167b77680ef04eb392538f42330750e47e6..e0c58721802a400fee5d270418bf584b1ef721f6 100644 (file)
@@ -19,6 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
 
   <properties>
     <features.file>features.xml</features.file>
+    <configfile.directory>etc/opendaylight/karaf</configfile.directory>
   </properties>
 
   <dependencyManagement>
@@ -69,6 +70,15 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <scope>runtime</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>features-adsal</artifactId>
+      <version>${sal.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+      <scope>runtime</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>features-restconf</artifactId>
@@ -101,6 +111,20 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
       <version>${project.version}</version>
     </dependency>
 
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>simple-impl</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>simple-impl</artifactId>
+      <version>${project.version}</version>
+      <type>xml</type>
+      <classifier>config</classifier>
+    </dependency>
+
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>alto-northbound</artifactId>
index 90db26ba0161206c69e456c0181a8cafc504a4f3..c6bcc4e2080ba81259a35d0fd017bdeee6cfb9da 100644 (file)
@@ -10,6 +10,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   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-adsal/${sal.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>
   <repository>mvn:org.opendaylight.controller/features-base/${odl.version}/xml/features</repository>
@@ -35,6 +36,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <feature name='odl-alto-commons' version='${project.version}' description='OpenDaylight :: alto :: utils'>
     <feature version='${project.version}'>odl-alto-model</feature>
     <feature version='${jackson.version}'>odl-base-jackson</feature>
+    <feature version='7.0.53'>odl-base-tomcat</feature>
     <bundle>mvn:org.opendaylight.alto/alto-commons/${project.version}</bundle>
   </feature>
 
@@ -43,7 +45,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
     <feature version='${l2switch.version}'>odl-l2switch-hosttracker</feature>
     <feature version='${l2switch.version}'>odl-l2switch-addresstracker</feature>
-    <configfile finalname="etc/opendaylight/karaf/03-alto.xml">mvn:org.opendaylight.alto/alto-config/${project.version}/xml/config</configfile>
+    <configfile finalname="${configfile.directory}/03-alto.xml">mvn:org.opendaylight.alto/alto-config/${project.version}/xml/config</configfile>
     <bundle>mvn:org.opendaylight.alto/alto-provider/${project.version}</bundle>
   </feature>
 
@@ -68,12 +70,21 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <bundle>mvn:org.opendaylight.alto/alto-services/${project.version}</bundle>
   </feature>
 
+  <feature name='odl-alto-simple' version='${project.version}' description='OpenDaylight :: alto :: Simple'>
+    <feature version='${project.version}'>odl-alto-commons</feature>
+    <feature version='${mdsal.version}'>odl-mdsal-common</feature>
+    <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+    <feature version='${sal.version}'>odl-adsal-core</feature>
+    <bundle>mvn:org.opendaylight.alto/simple-impl/${project.version}</bundle>
+    <configfile finalname='${configfile.directory}/alto-simple.xml'>mvn:org.opendaylight.alto/simple-impl/${project.version}/xml/config</configfile>
+  </feature>
+
   <feature name='odl-alto-northbound' version='${project.version}' description='Opendaylight :: alto :: Northbound'>
     <feature version='${jersey.version}'>odl-base-jersey</feature>
     <feature>war</feature>
     <feature version='${project.version}'>odl-alto-commons</feature>
+    <feature version='${project.version}'>odl-alto-simple</feature>
     <bundle>mvn:org.opendaylight.alto/service-api-rfc7285/${project.version}</bundle>
-    <bundle>mvn:org.opendaylight.alto/services.ext.fake/${project.version}</bundle>
     <bundle>mvn:org.opendaylight.alto/alto-northbound/${project.version}</bundle>
   </feature>
 
diff --git a/pom.xml b/pom.xml
index e59bb9ad931221cab558984458f346ab7cb8ee52..09bdb1b0e793ea19768d20452da6baa21fa2d5b9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -27,6 +27,7 @@
     <module>alto-commons</module>
     <module>alto-manager</module>
     <module>alto-services/api</module>
+    <module>alto-services/provider</module>
     <module>alto-extensions</module>
     <!-- <module>alto-karaf</module> -->
     <module>alto-northbound</module>
@@ -48,7 +49,7 @@
          TODO: need more investigation -->
     <config.version>0.3.0-SNAPSHOT</config.version>
 
-    <sal.version>0.7.1-SNAPSHOT</sal.version>
+    <sal.version>0.9.0-SNAPSHOT</sal.version>
     <war.version>${karaf.version}</war.version>
     <mdsal.version>1.2.0-SNAPSHOT</mdsal.version>
     <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
@@ -64,6 +65,7 @@
     </controller.commons.northbound.version>
     <l2switch.version>0.2.0-SNAPSHOT</l2switch.version>
     <ietf.topology.version>2013.10.21.7-SNAPSHOT</ietf.topology.version>
+    <commons.catalina.version>7.0.53.v201406061610</commons.catalina.version>
   </properties>
 
   <dependencyManagement>