<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.basic.endpointcostservice</groupId>
<artifactId>endpointcostservice-impl</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>1.0.0-SNAPSHOT</value>
+ <value>1.0.1-SNAPSHOT</value>
<updated>20151224114708</updated>
</snapshotVersion>
</snapshotVersions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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.mdsal</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-api</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-basic-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!--<dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-resourcepool-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>-->
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-base-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types-20130715</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+/*
+ * 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.basic.manual.maps;
+
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.Meta;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021.network.map.Map;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.ConfigContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.ConfigContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.ConfigContextKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceCostMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceCostMapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceCostMapKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceNetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceNetworkMapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceNetworkMapKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.types.rev150921.ResourceId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.types.rev150921.Tag;
+import org.opendaylight.yangtools.yang.binding.ChildOf;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.Identifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.UUID;
+
+public class ManualMapsUtils {
+
+ public static final String DEFAULT_CONTEXT = "00000000-0000-0000-0000-000000000000";
+
+ public static InstanceIdentifier<ConfigContext> getDefaultContextIID() {
+ return getContextIID(DEFAULT_CONTEXT);
+ }
+
+ public static InstanceIdentifier<ConfigContext> getContextIID(String cid) {
+ Uuid _cid = new Uuid(cid);
+ return getContextIID(_cid);
+ }
+
+ public static InstanceIdentifier<ConfigContext> getContextIID(Uuid cid) {
+ ConfigContextKey key = new ConfigContextKey(cid);
+ return getContextIID(key);
+ }
+
+ public static InstanceIdentifier<ConfigContext> getContextIID(ConfigContextKey key) {
+ return InstanceIdentifier.builder(ConfigContext.class, key).build();
+ }
+
+ public static InstanceIdentifier<ConfigContext> getContextListIID() {
+ return InstanceIdentifier.builder(ConfigContext.class).build();
+ }
+
+ public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(String rid) {
+ return getResourceNetworkMapIID(DEFAULT_CONTEXT, rid);
+ }
+
+ public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(String cid, String rid) {
+ Uuid _cid = new Uuid(cid);
+ ResourceId _rid = new ResourceId(rid);
+ return getResourceNetworkMapIID(_cid, _rid);
+ }
+
+ public static InstanceIdentifier<ResourceNetworkMap> getResourceNetworkMapIID(Uuid cid, ResourceId rid) {
+ ConfigContextKey ckey = new ConfigContextKey(cid);
+ ResourceNetworkMapKey rkey = new ResourceNetworkMapKey(rid);
+ return getResourceIID(ckey, rkey, ResourceNetworkMap.class);
+ }
+
+ public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(String rid) {
+ return getResourceCostMapIID(DEFAULT_CONTEXT, rid);
+ }
+
+ public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(String cid, String rid) {
+ Uuid _cid = new Uuid(cid);
+ ResourceId _rid = new ResourceId(rid);
+ return getResourceCostMapIID(_cid, _rid);
+ }
+
+ public static InstanceIdentifier<ResourceCostMap> getResourceCostMapIID(Uuid cid, ResourceId rid) {
+ ConfigContextKey ckey = new ConfigContextKey(cid);
+ ResourceCostMapKey rkey = new ResourceCostMapKey(rid);
+ return getResourceIID(ckey, rkey, ResourceCostMap.class);
+ }
+
+ public static <T extends Identifiable<K> & ChildOf<? super ConfigContext>, K extends Identifier<T>>
+ InstanceIdentifier<T> getResourceIID(ConfigContextKey ckey, K rkey, Class<T> resourceType) {
+ return InstanceIdentifier.builder(ConfigContext.class, ckey)
+ .child(resourceType ,rkey).build();
+ }
+
+ public static Uuid createContext(final WriteTransaction wx) {
+ return createContext(DEFAULT_CONTEXT, wx);
+ }
+
+ public static Uuid createContext(String cid, final WriteTransaction wx) {
+ return createContext(new Uuid(cid), wx);
+ }
+
+ public static Uuid createContext(Uuid cid, final WriteTransaction wx) {
+ ConfigContextBuilder builder = new ConfigContextBuilder();
+ builder.setContextId(cid);
+ builder.setResourceNetworkMap(new LinkedList<ResourceNetworkMap>());
+ builder.setResourceCostMap(new LinkedList<ResourceCostMap>());
+
+ wx.put(LogicalDatastoreType.CONFIGURATION, getContextIID(cid), builder.build());
+ return cid;
+ }
+
+ public static InstanceIdentifier<ResourceNetworkMap> createResourceNetworkMap(String rid,
+ List<Map> networkMap,
+ WriteTransaction wx) {
+ InstanceIdentifier<ResourceNetworkMap> iid = getResourceNetworkMapIID(rid);
+ ResourceNetworkMapBuilder builder = new ResourceNetworkMapBuilder();
+ builder.setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes()).toString()));
+ builder.setResourceId(new ResourceId(rid));
+ builder.setMap(networkMap);
+ wx.put(LogicalDatastoreType.CONFIGURATION, iid, builder.build());
+ return iid;
+ }
+
+ public static InstanceIdentifier<ResourceCostMap> createResourceCostMap(String rid,
+ Meta meta,
+ List<org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.Map> costMap,
+ WriteTransaction wx) {
+ InstanceIdentifier<ResourceCostMap> iid = getResourceCostMapIID(rid);
+ ResourceCostMapBuilder builder = new ResourceCostMapBuilder();
+ builder.setTag(new Tag(UUID.nameUUIDFromBytes(rid.getBytes()).toString()));
+ builder.setResourceId(new ResourceId(rid));
+ builder.setMap(costMap);
+ builder.setMeta(meta);
+ wx.put(LogicalDatastoreType.CONFIGURATION, iid, builder.build());
+ return iid;
+ }
+
+ public static void deleteContext(String cid, final WriteTransaction wx) {
+ deleteContext(new Uuid(cid), wx);
+ }
+
+ public static void deleteContext(Uuid cid, final WriteTransaction wx) {
+ /* DO NOT submit because this might be just one step in a sequence of write operations */
+ wx.delete(LogicalDatastoreType.CONFIGURATION, getContextIID(cid));
+ }
+
+ public static void deleteResourceNetworkMap(String rid, final WriteTransaction wx) {
+ deleteResourceNetworkMap(DEFAULT_CONTEXT, rid, wx);
+ }
+
+ public static void deleteResourceNetworkMap(String cid, String rid, final WriteTransaction wx) {
+ deleteResourceNetworkMap(new Uuid(cid), new ResourceId(cid), wx);
+ }
+
+ public static void deleteResourceNetworkMap(Uuid cid, ResourceId rid, final WriteTransaction wx) {
+ wx.delete(LogicalDatastoreType.CONFIGURATION, getResourceNetworkMapIID(cid, rid));
+ }
+
+ public static void deleteResourceCostMap(String rid, final WriteTransaction wx) {
+ deleteResourceCostMap(DEFAULT_CONTEXT, rid, wx);
+ }
+
+ public static void deleteResourceCostMap(String cid, String rid, final WriteTransaction wx) {
+ deleteResourceCostMap(new Uuid(cid), new ResourceId(cid), wx);
+ }
+
+ public static void deleteResourceCostMap(Uuid cid, ResourceId rid, final WriteTransaction wx) {
+ wx.delete(LogicalDatastoreType.CONFIGURATION, getResourceCostMapIID(cid, rid));
+ }
+}
--- /dev/null
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.endpointproperty.rev151021;
+
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+public class EndpointPropertyTypeBuilder {
+
+ public static EndpointPropertyType getDefaultInstance(java.lang.String defaultValue) {
+ throw new java.lang.UnsupportedOperationException("Not yet implemented");
+ }
+
+}
--- /dev/null
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.endpointproperty.rev151021;
+
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+public class TypedEndpointAddressBuilder {
+
+ public static TypedEndpointAddress getDefaultInstance(java.lang.String defaultValue) {
+ throw new java.lang.UnsupportedOperationException("Not yet implemented");
+ }
+
+}
--- /dev/null
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021;
+
+
+/**
+ * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
+ * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
+ *
+ * The reason behind putting it under src/main/java is:
+ * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
+ * loss of user code.
+ *
+ */
+public class EndpointAddressTypeBuilder {
+
+ public static EndpointAddressType getDefaultInstance(java.lang.String defaultValue) {
+ switch (defaultValue) {
+ case "ipv4":
+ return new EndpointAddressType(EndpointAddressType.Enumeration.Ipv4);
+ case "ipv6":
+ return new EndpointAddressType(EndpointAddressType.Enumeration.Ipv6);
+ default:
+ return null;
+ }
+ }
+
+}
--- /dev/null
+module alto-costmap-config {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:basic:manual:maps:costmap";
+
+ prefix "alto-costmap-config";
+
+ import "ietf-inet-types" {
+ prefix "ietf-inet";
+ }
+
+ import "alto-basic-types" {
+ prefix "alto-types";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto-costmap-config model";
+ }
+
+ grouping cost-map-meta {
+ uses alto-types:dependent-vtags {
+ refine dependent-vtags {
+ max-elements 1;
+ }
+ }
+ }
+
+ grouping cost-map {
+ leaf "resource-id" {
+ mandatory true;
+ type alto-types:resource-id;
+ }
+ leaf tag {
+ mandatory ture;
+ type alto-types:tag;
+ }
+
+ container meta {
+ must "current()";
+ uses cost-map-meta;
+ }
+
+ list "map" {
+ leaf src {
+ type alto-types:pid-name;
+ }
+ key "src";
+ list dst-costs {
+ leaf dst {
+ type alto-types:pid-name;
+ }
+ key "dst";
+ choice cost {
+ case type-numerical {
+ leaf cost-value {
+ type decimal64 {
+ fraction-digits 4;
+ }
+ }
+ }
+ case type-ordinal {
+ leaf cost-value {
+ type int32;
+ }
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+module alto-endpointcost-config {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:basic:manual:maps:endpointcost";
+
+ prefix "alto-endpointcost-config";
+
+ import "ietf-inet-types" {
+ prefix "ietf-inet";
+ }
+
+ import "alto-basic-types" {
+ prefix "alto-types";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto-endpointcost-config model";
+ }
+}
--- /dev/null
+module alto-endpointproperty-config {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:basic:manual:maps:endpointproperty";
+
+ prefix "alto-endpointproperty-config";
+
+ import "ietf-inet-types" {
+ prefix "ietf-inet";
+ }
+
+ import "alto-basic-types" {
+ prefix "alto-types";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto-endpointproperty-config model";
+ }
+
+ typedef typed-ipv4-address {
+ type string {
+ pattern 'ipv4:(([0-9]|[1-9][0-9]|1[0-9][0-9]|'
+ + '2[0-4][0-9]|25[0-5])\.){3}'
+ + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+ + '(%[\p{N}\p{L}]+)?';
+ }
+ }
+
+ typedef typed-ipv6-address {
+ type string {
+ pattern 'ipv6:((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+ + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+ + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+ + '(%[\p{N}\p{L}]+)?';
+ pattern 'ipv6:((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+ + '(%.+)?)';
+ }
+ }
+
+ typedef typed-endpoint-address {
+ type union {
+ type typed-ipv4-address;
+ type typed-ipv6-address;
+ // EXTENSION: ADD NEW TYPE HERE.
+ }
+ description
+ "Ref: RFC7285 Sec. 10.4.1 Typed Endpoint Addresses" +
+ "= AddressType:EndpointAddr";
+ }
+
+ typedef endpoint-property-type {
+ type union {
+ type alto-types:specific-endpoint-property;
+ type alto-types:global-endpoint-property;
+ }
+ description
+ "Endpoint property type. RFC7285 Sec. 10.8.";
+ }
+
+ typedef endpoint-property-value {
+ type string;
+ description
+ "Endpoint property (value).";
+ }
+
+ grouping endpoint-property-map-data {
+ list endpoint-properties {
+ key endpoint;
+ leaf endpoint {
+ type typed-endpoint-address;
+ mandatory true;
+ }
+ list properties {
+ key property-type;
+ leaf property-type {
+ type endpoint-property-type;
+ mandatory true;
+ }
+ leaf property {
+ type endpoint-property-value;
+ mandatory true;
+ }
+ }
+ }
+ }
+
+ grouping endpoint-property-meta {
+ uses alto-types:dependent-vtags;
+ }
+
+ grouping endpoint-property-map {
+ container "meta" {
+ uses endpoint-property-meta;
+ }
+ uses endpoint-property-map-data;
+ }
+}
--- /dev/null
+module alto-manual-maps {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:basic:manual:maps";
+
+ prefix "alto-manual-maps";
+
+ import "ietf-yang-types" {
+ prefix "ietf-types";
+ }
+
+ import "alto-networkmap-config" {
+ prefix "networkmap-config";
+ }
+
+ import "alto-costmap-config" {
+ prefix "costmap-config";
+ }
+
+ import "alto-endpointproperty-config" {
+ prefix "endpointproperty-config";
+ }
+
+ import "alto-model-base" {
+ prefix "base";
+ }
+
+ import "alto-model-config" {
+ prefix "alto-cfg";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto-manual-maps model";
+ }
+
+ list config-context {
+ key "context-id";
+
+ leaf "context-id" {
+ type ietf-types:uuid;
+ default "00000000-0000-0000-0000-000000000000";
+ }
+
+ list resource-network-map {
+ key "resource-id";
+ uses networkmap-config:network-map;
+ }
+
+ list resource-cost-map {
+ key "resource-id";
+ uses costmap-config:cost-map;
+ }
+
+// container resource-endpoint-property {
+// uses endpointproperty-config:endpoint-property-map;
+// }
+ }
+
+ augment "alto-cfg:query/alto-cfg:input/alto-cfg:request/alto-cfg:config-request/"
+ + "alto-cfg:config-request-message/alto-cfg:config-resource-data" {
+ case "config-networkmap-data" {
+ uses networkmap-config:network-map;
+ }
+ case "config-costmap-data" {
+ uses costmap-config:cost-map;
+ }
+ }
+
+ augment "alto-cfg:query/alto-cfg:output/alto-cfg:response/alto-cfg:config-response/"
+ + "alto-cfg:config-response-message/alto-cfg:meta" {
+ leaf "config-response-error-code" {
+ type string;
+ }
+ }
+
+ augment "alto-cfg:query/alto-cfg:output/alto-cfg:response/alto-cfg:config-response/"
+ + "alto-cfg:config-response-message/alto-cfg:config-response-data" {
+ container "config-networkmap-response-data" {
+ uses networkmap-config:network-map;
+ }
+ container "config-costmap-response-data" {
+ uses costmap-config:cost-map;
+ }
+ }
+}
--- /dev/null
+module alto-networkmap-config {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:basic:manual:maps:networkmap";
+
+ prefix "alto-networkmap-config";
+
+ import "ietf-inet-types" {
+ prefix "ietf-inet";
+ }
+
+ import "alto-basic-types" {
+ prefix "alto-types";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto-networkmap-config model";
+ }
+
+ typedef endpoint-address-type {
+ type union {
+ type enumeration {
+ enum ipv4;
+ enum ipv6;
+ }
+ }
+ }
+
+ grouping "endpoint-address-group" {
+ list "endpoint-address-group" {
+ key "address-type";
+
+ leaf "address-type" {
+ mandatory true;
+ type endpoint-address-type;
+ }
+
+ leaf-list endpoint-prefix {
+ type ietf-inet:ip-prefix;
+ }
+ }
+ }
+
+ grouping "network-map" {
+ leaf "resource-id" {
+ mandatory true;
+ type alto-types:resource-id;
+ }
+ leaf "tag" {
+ mandatory true;
+ type alto-types:tag;
+ }
+
+ list "map" {
+ key "pid";
+ leaf pid {
+ type alto-types:pid-name;
+ }
+ uses endpoint-address-group;
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.alto</groupId>
+ <artifactId>alto-parent</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <relativePath>../../../</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-artifacts</artifactId>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-features</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-features</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <properties>
+ <mdsal.model.version>0.9.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.4.0-SNAPSHOT</mdsal.version>
+ <restconf.version>1.4.0-SNAPSHOT</restconf.version>
+ <yangtools.version>0.9.0-SNAPSHOT</yangtools.version>
+ <dlux.version>0.4.0-SNAPSHOT</dlux.version>
+ <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <!-- project specific dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${mdsal.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>restconf-artifacts</artifactId>
+ <version>${restconf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <version>${yangtools.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>features-mdsal-model</artifactId>
+ <version>${mdsal.model.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <version>${mdsal.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>features-restconf</artifactId>
+ <classifier>features</classifier>
+ <version>${restconf.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>features-dlux</artifactId>
+ <classifier>features</classifier>
+ <version>${dlux.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-northbound-features</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-resourcepool-features</artifactId>
+ <classifier>features</classifier>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-networkmap-features</artifactId>
+ <classifier>features</classifier>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-costmap-features</artifactId>
+ <classifier>features</classifier>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-base-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-impl</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<features name="odl-alto-manual-maps-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+ <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.alto.core/alto-resourcepool-features/${project.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.alto.core/alto-northbound-features/${project.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.alto.core/alto-service-model-networkmap-features/${project.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.alto.core/alto-service-model-costmap-features/${project.version}/xml/features</repository>
+
+ <feature name='odl-alto-manual-maps-api' version='${project.version}' description='OpenDaylight :: alto-manual-maps :: api'>
+ <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
+ <feature version='${project.version}'>odl-alto-resourcepool-api</feature>
+ <bundle>mvn:org.opendaylight.alto.core/alto-service-model-base-api/${project.version}</bundle>
+ <bundle>mvn:org.opendaylight.alto.core/alto-service-model-config-api/${project.version}</bundle>
+ <bundle>mvn:org.opendaylight.alto.basic/alto-manual-maps-api/${project.version}</bundle>
+ </feature>
+ <feature name='odl-alto-manual-maps' version='${project.version}' description='OpenDaylight :: alto-manual-maps'>
+ <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+ <feature version='${project.version}'>odl-alto-manual-maps-api</feature>
+ <feature version='${project.version}'>odl-alto-northbound</feature>
+ <feature version='${project.version}'>odl-alto-resourcepool</feature>
+ <feature version='${project.version}'>odl-alto-service-model-networkmap</feature>
+ <feature version='${project.version}'>odl-alto-service-model-costmap</feature>
+ <bundle>mvn:org.opendaylight.alto.basic/alto-manual-maps-impl/${project.version}</bundle>
+ <configfile finalname="${configfile.directory}/alto-manual-maps.xml">mvn:org.opendaylight.alto.basic/alto-manual-maps-impl/${project.version}/xml/config</configfile>
+ </feature>
+ <feature name='odl-alto-manual-maps-rest' version='${project.version}' description='OpenDaylight :: alto-manual-maps :: REST'>
+ <feature version="${project.version}">odl-alto-manual-maps</feature>
+ <feature version="${restconf.version}">odl-restconf</feature>
+ </feature>
+ <feature name='odl-alto-manual-maps-ui' version='${project.version}' description='OpenDaylight :: alto-manual-maps :: UI'>
+ <feature version="${project.version}">odl-alto-manual-maps-rest</feature>
+ <feature version="${restconf.version}">odl-mdsal-apidocs</feature>
+ <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
+ <feature version="${dlux.version}">odl-dlux-yangui</feature>
+ </feature>
+
+</features>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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.5.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-impl</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-resourcepool-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-ird-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-networkmap-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-costmap-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-northbound-api</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>
+ </dependencies>
+
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<snapshot>
+ <required-capabilities>
+ <capability>urn:opendaylight:alto:basic:manual:maps:impl?module=alto-manual-maps-impl&revision=2015-10-21</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
+ <capability>urn:opendaylight:alto:core:northbound?module=alto-northbound&revision=2015-10-21</capability>
+ </required-capabilities>
+ <configuration>
+
+ <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <module>
+ <type xmlns:prefix="urn:opendaylight:alto:basic:manual:maps:impl">prefix:alto-manual-maps</type>
+ <name>alto-manual-maps-default</name>
+ <broker>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+ <name>binding-osgi-broker</name>
+ </broker>
+ <alto-northbound-router>
+ <type xmlns:alto-northbound-router="urn:opendaylight:alto:core:northbound">alto-northbound-router:alto-northbound-router</type>
+ <name>alto-northbound-router</name>
+ </alto-northbound-router>
+ </module>
+ </modules>
+ </data>
+ </configuration>
+</snapshot>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata modelVersion="1.1.0">
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-simple-ird-impl</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <localCopy>true</localCopy>
+ </snapshot>
+ <lastUpdated>20151112013601</lastUpdated>
+ <snapshotVersions>
+ <snapshotVersion>
+ <classifier>config</classifier>
+ <extension>xml</extension>
+ <value>0.2.1-SNAPSHOT</value>
+ <updated>20151112013601</updated>
+ </snapshotVersion>
+ </snapshotVersions>
+ </versioning>
+</metadata>
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.basic.impl;
+
+import com.google.common.base.Optional;
+import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.Map;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.map.DstCosts;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.map.dst.costs.Cost;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.map.dst.costs.cost.TypeNumerical;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.cost.map.map.dst.costs.cost.TypeOrdinal;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceCostMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.resourcepool.rev150921.context.Resource;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.resourcepool.rev150921.context.resource.ContextTag;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.types.rev150921.ResourceId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.AltoModelCostmapService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.QueryInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.QueryOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.QueryOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.ResourceTypeCostmap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.ResourceTypeFilteredCostmap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.alto.request.costmap.request.CostmapRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.alto.response.costmap.response.CostmapResponseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.cost.type.data.CostType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.request.data.CostmapParams;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.response.data.CostmapResponseDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.response.data.costmap.response.data.CostmapSource;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.response.data.costmap.response.data.CostmapSourceBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.response.data.costmap.response.data.costmap.source.CostmapDestination;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.costmap.response.data.costmap.response.data.costmap.source.CostmapDestinationBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rfc7285.rev151021.costmap.filter.data.CostmapFilter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rfc7285.rev151021.query.input.request.costmap.request.costmap.params.filter.CostmapFilterData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rfc7285.rev151021.query.output.response.costmap.response.costmap.response.data.costmap.source.costmap.destination.cost.NumericalBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rfc7285.rev151021.query.output.response.costmap.response.costmap.response.data.costmap.source.costmap.destination.cost.OrdinalBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.Future;
+
+public class AltoManualCostmapServiceImpl implements AltoModelCostmapService {
+ private static final Logger LOG = LoggerFactory.getLogger(AltoManualCostmapServiceImpl.class);
+ private DataBroker dataBroker;
+
+ public AltoManualCostmapServiceImpl(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
+
+ @Override
+ public Future<RpcResult<QueryOutput>> query(QueryInput input) {
+ if (!input.getType().equals(ResourceTypeCostmap.class)
+ && !input.getType().equals(ResourceTypeFilteredCostmap.class)) {
+ return RpcResultBuilder.<QueryOutput>failed().buildFuture();
+ }
+
+ CostmapRequest request = (CostmapRequest)input.getRequest();
+ CostmapParams params = request.getCostmapParams();
+ CostType costType = params.getCostType();
+ CostmapFilter filter = ((CostmapFilterData)params.getFilter()).getCostmapFilter();
+
+ InstanceIdentifier<ContextTag> ctagIID = (InstanceIdentifier<ContextTag>)input.getServiceReference();
+ ResourceId resourceId = ctagIID.firstIdentifierOf(ContextTag.class)
+ .firstKeyOf(Resource.class)
+ .getResourceId();
+ String tag = ctagIID.firstKeyOf(ContextTag.class).getTag().getValue();
+
+ ReadOnlyTransaction rx = this.dataBroker.newReadOnlyTransaction();
+ List<CostmapSource> costmapSources = getFilteredCostmap(resourceId, tag, filter, rx);
+
+ CostmapResponseDataBuilder cmrdBuilder = new CostmapResponseDataBuilder();
+ cmrdBuilder.setCostType(costType);
+ cmrdBuilder.setCostmapSource(costmapSources);
+
+ CostmapResponseBuilder cmrBuilder = new CostmapResponseBuilder();
+ cmrBuilder.setCostmapResponseData(cmrdBuilder.build());
+
+ QueryOutputBuilder builder = new QueryOutputBuilder();
+ builder.setType(ResourceTypeCostmap.class).setResponse(cmrBuilder.build());
+ return RpcResultBuilder.success(builder.build()).buildFuture();
+ }
+
+ private List<CostmapSource> getFilteredCostmap(ResourceId resourceId, String tag,
+ CostmapFilter filter, ReadOnlyTransaction rx) {
+ InstanceIdentifier<ResourceCostMap> costMapIID =
+ ManualMapsUtils.getResourceCostMapIID(resourceId.getValue());
+ Future<Optional<ResourceCostMap>> rcmFuture =
+ rx.read(LogicalDatastoreType.OPERATIONAL, costMapIID);
+ Optional<ResourceCostMap> optional = null;
+ try {
+ optional = rcmFuture.get();
+ } catch (Exception e) {
+ LOG.error("Reading CostMap failed", e);
+ }
+ ResourceCostMap resourceCostMap = null;
+ if (optional.isPresent()) {
+ resourceCostMap = optional.get();
+ }
+
+ List<CostmapSource> costmapSources = new LinkedList<>();
+ for (Map entry : resourceCostMap.getMap()) {
+ if (filter!=null && filter.getPidSource()!=null && !filter.getPidSource().isEmpty()
+ && !filter.getPidSource().contains(entry.getSrc())) {
+ continue;
+ }
+
+ CostmapSourceBuilder costmapSourceBuilder = new CostmapSourceBuilder();
+ costmapSourceBuilder.setPidSource(entry.getSrc());
+ List<CostmapDestination> costmapDestinations = new LinkedList<>();
+ for (DstCosts dstCosts : entry.getDstCosts()) {
+ if (filter!=null && filter.getPidDestination()!=null && !filter.getPidDestination().isEmpty()
+ && !filter.getPidDestination().contains(dstCosts.getDst())) {
+ continue;
+ }
+ CostmapDestinationBuilder costmapDestinationBuilder = new CostmapDestinationBuilder();
+ costmapDestinationBuilder.setPidDestination(dstCosts.getDst());
+ Cost cost = dstCosts.getCost();
+ if (cost instanceof TypeNumerical) {
+ costmapDestinationBuilder.setCost(new NumericalBuilder()
+ .setCost(((TypeNumerical) cost).getCostValue())
+ .build());
+ } else if (cost instanceof TypeOrdinal) {
+ costmapDestinationBuilder.setCost(new OrdinalBuilder()
+ .setCost(((TypeOrdinal) cost).getCostValue())
+ .build());
+ }
+ costmapDestinations.add(costmapDestinationBuilder.build());
+ }
+ costmapSourceBuilder.setCostmapDestination(costmapDestinations);
+ costmapSources.add(costmapSourceBuilder.build());
+ }
+ return costmapSources;
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.basic.impl;
+
+import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
+import org.opendaylight.alto.core.northbound.api.AltoNorthboundRoute;
+import org.opendaylight.alto.core.northbound.api.AltoNorthboundRouter;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.AltoModelConfigService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.AltoModelCostmapService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.AltoModelNetworkmapService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+
+public class AltoManualMapsProvider implements BindingAwareProvider, AutoCloseable {
+ public static final String RESOURCE_CONFIG_ROUTE_NAME = "config";
+ public static final String RESOURCE_CONFIG_CONTEXT_NAME = "alto-manual-maps";
+
+ private static final Logger LOG = LoggerFactory.getLogger(AltoManualMapsProvider.class);
+
+ private DataBroker dataBroker = null;
+ private ManualMapsListener manualMapsListener = null;
+ private BindingAwareBroker.RpcRegistration<AltoModelConfigService> altoModelConfigService = null;
+ private BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> altoModelNetworkmapService = null;
+ private BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> altoModelCostmapService = null;
+
+ private AltoNorthboundRouter m_router = null;
+ private List<Uuid> m_contexts = null;
+
+ protected void setupListener() {
+ manualMapsListener = new ManualMapsListener();
+ manualMapsListener.register(dataBroker);
+ manualMapsListener.setNetworkmapServiceReg(altoModelNetworkmapService);
+ manualMapsListener.setCostmapServiceReg(altoModelCostmapService);
+ }
+
+ protected void closeListener() throws Exception {
+ if (manualMapsListener != null) {
+ manualMapsListener.close();
+ }
+ }
+
+ protected void initializeConfigContext() throws Exception {
+ m_contexts = new LinkedList<>();
+ WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
+ m_contexts.add(ManualMapsUtils.createContext(wx));
+ wx.submit().get();
+ }
+
+ protected void clearConfigContext() throws Exception {
+ WriteTransaction wx = dataBroker.newWriteOnlyTransaction();
+ for (Uuid context : m_contexts) {
+ ManualMapsUtils.deleteContext(context, wx);
+ }
+ wx.submit().get();
+ }
+
+ @Override
+ public void onSessionInitiated(ProviderContext session) {
+ LOG.info("AltoManualMapsProvider Session Initiated");
+
+ dataBroker = session.getSALService(DataBroker.class);
+ altoModelConfigService = session.addRpcImplementation(AltoModelConfigService.class,
+ new AltoModelConfigImpl(dataBroker));
+ altoModelNetworkmapService = session.addRoutedRpcImplementation(AltoModelNetworkmapService.class,
+ new AltoManualNetworkmapServiceImpl(dataBroker));
+ altoModelCostmapService = session.addRoutedRpcImplementation(AltoModelCostmapService.class,
+ new AltoManualCostmapServiceImpl(dataBroker));
+ try {
+ setupListener();
+ initializeConfigContext();
+ } catch (Exception e) {
+ LOG.error("Failed to create top-level containers");
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void close() throws Exception {
+ try {
+ if (m_router != null) {
+ m_router.removeRoute(RESOURCE_CONFIG_ROUTE_NAME);
+ }
+ clearConfigContext();
+ closeListener();
+ } catch (Exception e) {
+ LOG.error("Failed to remove route");
+ }
+ if (altoModelConfigService != null) {
+ altoModelConfigService.close();
+ }
+ if (altoModelNetworkmapService != null) {
+ altoModelNetworkmapService.close();
+ }
+ if (altoModelCostmapService != null) {
+ altoModelCostmapService.close();
+ }
+ LOG.info("AltoManualMapsProvider Closed");
+ }
+
+ public void setupRoute(AltoNorthboundRouter router) {
+ AltoNorthboundRoute route = new ManualMapsRoute(this);
+ String base_url = router.addRoute(RESOURCE_CONFIG_ROUTE_NAME, route);
+ if (base_url == null) {
+ LOG.error("Failed to register route for AltoManualMaps");
+ return;
+ }
+
+ try {
+ m_router = router;
+ } catch (Exception e) {
+ LOG.error("Failed to reigster route");
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.basic.impl;
+
+import com.google.common.base.Optional;
+import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021.EndpointAddressType;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021.endpoint.address.group.EndpointAddressGroup;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021.network.map.Map;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceNetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.resourcepool.rev150921.context.Resource;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.resourcepool.rev150921.context.resource.ContextTag;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.types.rev150921.ResourceId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.AddressTypeIpv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.AddressTypeIpv6;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.AltoModelNetworkmapService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.QueryInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.QueryOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.QueryOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.ResourceTypeNetworkmap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.alto.request.networkmap.request.NetworkmapRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.alto.response.networkmap.response.NetworkmapResponseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.networkmap.request.data.NetworkmapFilter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.networkmap.response.data.NetworkMapBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.networkmap.response.data.network.map.Partition;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.networkmap.response.data.network.map.PartitionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rfc7285.rev151021.Ipv4PrefixList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rfc7285.rev151021.Ipv4PrefixListBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rfc7285.rev151021.Ipv6PrefixList;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rfc7285.rev151021.Ipv6PrefixListBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.Future;
+
+public class AltoManualNetworkmapServiceImpl implements AltoModelNetworkmapService {
+ private static final Logger LOG = LoggerFactory.getLogger(AltoManualNetworkmapServiceImpl.class);
+ private DataBroker dataBroker;
+
+ public AltoManualNetworkmapServiceImpl(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
+
+ @Override
+ public Future<RpcResult<QueryOutput>> query(QueryInput input) {
+ if (!input.getType().equals(ResourceTypeNetworkmap.class)) {
+ return RpcResultBuilder.<QueryOutput>failed().buildFuture();
+ }
+ NetworkmapRequest request = (NetworkmapRequest)input.getRequest();
+ NetworkmapFilter filter = request.getNetworkmapFilter();
+
+ InstanceIdentifier<ContextTag> ctagIID = (InstanceIdentifier<ContextTag>)input.getServiceReference();
+ ResourceId resourceId = ctagIID.firstIdentifierOf(ContextTag.class)
+ .firstKeyOf(Resource.class)
+ .getResourceId();
+ String tag = ctagIID.firstKeyOf(ContextTag.class).getTag().getValue();
+
+ ReadOnlyTransaction rx = this.dataBroker.newReadOnlyTransaction();
+ List<Partition> partitionList = getFilteredNetworkmap(resourceId, tag, filter, rx);
+
+ NetworkMapBuilder networkMapBuilder = new NetworkMapBuilder();
+ networkMapBuilder.setPartition(partitionList);
+
+ NetworkmapResponseBuilder nmrBuilder = new NetworkmapResponseBuilder();
+ nmrBuilder.setNetworkMap(networkMapBuilder.build());
+
+ QueryOutputBuilder builder = new QueryOutputBuilder();
+ builder.setType(ResourceTypeNetworkmap.class).setResponse(nmrBuilder.build());
+ return RpcResultBuilder.success(builder.build()).buildFuture();
+ }
+
+ private List<Partition> getFilteredNetworkmap(ResourceId resourceId, String tag,
+ NetworkmapFilter filter, ReadOnlyTransaction rx) {
+ InstanceIdentifier<ResourceNetworkMap> networkMapIID =
+ ManualMapsUtils.getResourceNetworkMapIID(resourceId.getValue());
+ Future<Optional<ResourceNetworkMap>> rnmFuture =
+ rx.read(LogicalDatastoreType.OPERATIONAL, networkMapIID);
+ Optional<ResourceNetworkMap> optional = null;
+ try {
+ optional = rnmFuture.get();
+ } catch (Exception e) {
+ LOG.error("Reading NetworkMap failed", e);
+ return null;
+ }
+ if (optional==null || !optional.isPresent()) {
+ return null;
+ }
+ ResourceNetworkMap resourceNetworkMap = optional.get();
+
+ List<Partition> partitionList = new LinkedList<>();
+
+ for (Map entry : resourceNetworkMap.getMap()) {
+ if (filter!=null && filter.getPid()!=null && !filter.getPid().isEmpty()
+ && filter.getPid().contains(entry.getPid())) {
+ continue;
+ }
+
+ PartitionBuilder partitionBuilder = new PartitionBuilder();
+ partitionBuilder.setPid(entry.getPid());
+ for (EndpointAddressGroup endpointAddressGroup : entry.getEndpointAddressGroup()) {
+ if (endpointAddressGroup.getAddressType().getEnumeration() ==
+ EndpointAddressType.Enumeration.Ipv4) {
+ if (filter!=null && filter.getAddressType()!=null && !filter.getAddressType().isEmpty()
+ && !filter.getAddressType().contains(AddressTypeIpv4.class)) {
+ continue;
+ }
+
+ List<Ipv4Prefix> ipv4List = new LinkedList<>();
+ for (IpPrefix ipPrefix : endpointAddressGroup.getEndpointPrefix()) {
+ ipv4List.add(ipPrefix.getIpv4Prefix());
+ }
+
+ Ipv4PrefixListBuilder v4Builder = new Ipv4PrefixListBuilder();
+ v4Builder.setIpv4(ipv4List);
+
+ partitionBuilder.addAugmentation(Ipv4PrefixList.class, v4Builder.build());
+ } else if (endpointAddressGroup.getAddressType().getEnumeration() ==
+ EndpointAddressType.Enumeration.Ipv6) {
+ if (filter!=null && filter.getAddressType()!=null && !filter.getAddressType().isEmpty()
+ && !filter.getAddressType().contains(AddressTypeIpv6.class)) {
+ continue;
+ }
+
+ List<Ipv6Prefix> ipv6List = new LinkedList<>();
+ for (IpPrefix ipPrefix : endpointAddressGroup.getEndpointPrefix()) {
+ ipv6List.add(ipPrefix.getIpv6Prefix());
+ }
+
+ Ipv6PrefixListBuilder v6Builder = new Ipv6PrefixListBuilder();
+ v6Builder.setIpv6(ipv6List);
+
+ partitionBuilder.addAugmentation(Ipv6PrefixList.class, v6Builder.build());
+ }
+ }
+
+ partitionList.add(partitionBuilder.build());
+ }
+ return partitionList;
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.basic.impl;
+
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
+import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.ConfigResponseData1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.Meta1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceCostMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.config.context.ResourceNetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.query.input.request.config.request.config.request.message.config.resource.data.ConfigCostmapData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.query.input.request.config.request.config.request.message.config.resource.data.ConfigNetworkmapData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.query.output.response.config.response.config.response.message.config.response.data.ConfigCostmapResponseDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.query.output.response.config.response.config.response.message.config.response.data.ConfigNetworkmapResponseDataBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.AltoModelConfigService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.QueryInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.QueryOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.QueryOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.ResourceTypeConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.alto.request.config.request.ConfigRequest;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.alto.response.config.response.ConfigResponseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.config.request.data.ConfigRequestMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.config.response.data.ConfigResponseMessageBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.config.response.data.config.response.message.ConfigResponseData;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.config.response.data.config.response.message.Meta;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.rev151021.alto.request.base.Request;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.Future;
+
+public class AltoModelConfigImpl implements AltoModelConfigService {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AltoModelConfigImpl.class);
+ private DataBroker dataBroker = null;
+
+ private static final String RESPONSE_ERROR_CODE_OK = "OK";
+ private static final String RESPONSE_ERROR_CODE_FAILED = "FAILED";
+ private static final List<String> CONFIG_RESOURCE_TYPES = Arrays.asList("networkmap", "costmap");
+
+ public AltoModelConfigImpl(DataBroker dataBroker) {
+ this.dataBroker = dataBroker;
+ }
+
+ protected boolean validateConfigResourceType(String configResourceType) {
+ return CONFIG_RESOURCE_TYPES.contains(configResourceType);
+ }
+
+ protected QueryOutput readResourceNetworkMap(String rid, final ReadTransaction rx) {
+ InstanceIdentifier<ResourceNetworkMap> iid = ManualMapsUtils.getResourceNetworkMapIID(rid);
+ CheckedFuture<Optional<ResourceNetworkMap>, ReadFailedException> future =
+ rx.read(LogicalDatastoreType.OPERATIONAL, iid);
+ Optional<ResourceNetworkMap> optional = Optional.absent();
+
+ QueryOutputBuilder outputBuilder = new QueryOutputBuilder();
+ outputBuilder.setType(ResourceTypeConfig.class);
+ ConfigResponseBuilder crBuilder = new ConfigResponseBuilder();
+ ConfigResponseMessageBuilder crmBuilder = new ConfigResponseMessageBuilder();
+ ConfigResponseData1Builder crdBuilder = new ConfigResponseData1Builder();
+
+ ResourceNetworkMap result = null;
+ String errorCode = RESPONSE_ERROR_CODE_FAILED;
+
+ try {
+ optional = future.checkedGet();
+ if (optional.isPresent()) {
+ result = optional.get();
+ crdBuilder.setConfigNetworkmapResponseData(new ConfigNetworkmapResponseDataBuilder()
+ .setResourceId(result.getResourceId())
+ .setTag(result.getTag())
+ .setMap(result.getMap())
+ .build());
+ errorCode = RESPONSE_ERROR_CODE_OK;
+ }
+ } catch (Exception e) {
+ LOG.warn("Reading resource failed! ResourceId: " + rid);
+ }
+ crmBuilder
+ .setMeta((Meta) new Meta1Builder().setConfigResponseErrorCode(errorCode).build())
+ .setConfigResponseData((ConfigResponseData) crdBuilder.build());
+ crBuilder.setConfigResponseMessage(crmBuilder.build());
+ outputBuilder.setResponse(crBuilder.build());
+ return outputBuilder.build();
+ }
+
+ protected QueryOutput readResourceCostMap(String rid, final ReadTransaction rx) {
+ InstanceIdentifier<ResourceCostMap> iid = ManualMapsUtils.getResourceCostMapIID(rid);
+ CheckedFuture<Optional<ResourceCostMap>, ReadFailedException> future =
+ rx.read(LogicalDatastoreType.OPERATIONAL, iid);
+ Optional<ResourceCostMap> optional = Optional.absent();
+
+ QueryOutputBuilder outputBuilder = new QueryOutputBuilder();
+ outputBuilder.setType(ResourceTypeConfig.class);
+ ConfigResponseBuilder crBuilder = new ConfigResponseBuilder();
+ ConfigResponseMessageBuilder crmBuilder = new ConfigResponseMessageBuilder();
+ ConfigResponseData1Builder crdBuilder = new ConfigResponseData1Builder();
+
+ ResourceCostMap result = null;
+ String errorCode = RESPONSE_ERROR_CODE_FAILED;
+
+ try {
+ optional = future.checkedGet();
+ if (optional.isPresent()) {
+ result = optional.get();
+ crdBuilder.setConfigCostmapResponseData(new ConfigCostmapResponseDataBuilder()
+ .setResourceId(result.getResourceId())
+ .setTag(result.getTag())
+ .setMeta(result.getMeta())
+ .setMap(result.getMap())
+ .build());
+ errorCode = RESPONSE_ERROR_CODE_OK;
+ }
+ } catch (Exception e) {
+ LOG.warn("Reading resource failed! ResourceId: " + rid);
+ }
+ crmBuilder
+ .setMeta((Meta) new Meta1Builder().setConfigResponseErrorCode(errorCode).build())
+ .setConfigResponseData((ConfigResponseData) crdBuilder.build());
+ crBuilder.setConfigResponseMessage(crmBuilder.build());
+ outputBuilder.setResponse(crBuilder.build());
+ return outputBuilder.build();
+ }
+
+ @Override
+ public Future<RpcResult<QueryOutput>> query(QueryInput input) {
+ if (!(input.getType().equals(ResourceTypeConfig.class))) {
+ LOG.warn("Unsupported Request!");
+ return RpcResultBuilder.<QueryOutput>failed().buildFuture();
+ }
+ Request _request = input.getRequest();
+ if (!(_request instanceof ConfigRequest)) {
+ LOG.warn("Request is inconsistent with input");
+ return RpcResultBuilder.<QueryOutput>failed().buildFuture();
+ }
+ ConfigRequest request = (ConfigRequest) _request;
+ ConfigRequestMessage requestMessage = request.getConfigRequestMessage();
+ String resourceId = requestMessage.getConfigResourceId();
+ if (!validateConfigResourceType(requestMessage.getConfigResourceType())) {
+ LOG.warn("Unsupported ResourceType in Request!");
+ return RpcResultBuilder.<QueryOutput>failed().buildFuture();
+ }
+
+ final ReadWriteTransaction rwx = dataBroker.newReadWriteTransaction();
+ QueryOutput output = null;
+
+ if (requestMessage.getConfigType() == ConfigRequestMessage.ConfigType.Get) {
+ if (requestMessage.getConfigResourceType() == "networkmap") {
+ output = readResourceNetworkMap(resourceId, rwx);
+ } else if (requestMessage.getConfigResourceType() == "costmap") {
+ rwx.read(LogicalDatastoreType.CONFIGURATION, ManualMapsUtils.getResourceCostMapIID(resourceId));
+ }
+ } else if (requestMessage.getConfigType() == ConfigRequestMessage.ConfigType.Delete) {
+ if (requestMessage.getConfigResourceType() == "networkmap") {
+ ManualMapsUtils.deleteResourceNetworkMap(resourceId, rwx);
+ } else if (requestMessage.getConfigResourceType() == "costmap") {
+ ManualMapsUtils.deleteResourceCostMap(resourceId, rwx);
+ }
+ } else if (requestMessage.getConfigType() == ConfigRequestMessage.ConfigType.Create) {
+ if (requestMessage.getConfigResourceType() == "networkmap") {
+ ConfigNetworkmapData networkmapData = (ConfigNetworkmapData) requestMessage.getConfigResourceData();
+ ManualMapsUtils.createResourceNetworkMap(resourceId, networkmapData.getMap(), rwx);
+ } else if (requestMessage.getConfigResourceType() == "costmap") {
+ ConfigCostmapData costmapData = (ConfigCostmapData) requestMessage.getConfigResourceData();
+ ManualMapsUtils.createResourceCostMap(resourceId, costmapData.getMeta(), costmapData.getMap(), rwx);
+ }
+ }
+ rwx.submit();
+ return null;
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.basic.impl;
+
+import org.opendaylight.alto.basic.manual.maps.ManualMapsUtils;
+import org.opendaylight.alto.core.resourcepool.ResourcepoolUtils;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
+import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.costmap.rev151021.CostMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.networkmap.rev151021.NetworkMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.rev151021.ConfigContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.core.resourcepool.rev150921.ServiceContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.config.rev151021.ResourceTypeConfig;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.AltoModelCostmapService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.costmap.rev151021.ResourceTypeCostmap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.AltoModelNetworkmapService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.networkmap.rev151021.ResourceTypeNetworkmap;
+import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ExecutionException;
+
+public class ManualMapsListener implements AutoCloseable, DataChangeListener {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ManualMapsListener.class);
+
+ private DataBroker m_dataBroker = null;
+ private InstanceIdentifier<ConfigContext> m_iid = null;
+ private ListenerRegistration<DataChangeListener> m_reg = null;
+ private BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> m_networkmapServiceReg = null;
+ private BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> m_costmapServiceReg = null;
+
+ public ManualMapsListener() {
+ m_iid = ManualMapsUtils.getContextListIID();
+ }
+
+ public void register(DataBroker dataBroker) {
+ m_dataBroker = dataBroker;
+
+ m_reg = m_dataBroker.registerDataChangeListener(
+ LogicalDatastoreType.CONFIGURATION, m_iid,
+ this, AsyncDataBroker.DataChangeScope.SUBTREE
+ );
+ }
+
+ public void setNetworkmapServiceReg(BindingAwareBroker.RoutedRpcRegistration<AltoModelNetworkmapService> reg) {
+ this.m_networkmapServiceReg = reg;
+ }
+
+ public void setCostmapServiceReg(BindingAwareBroker.RoutedRpcRegistration<AltoModelCostmapService> reg) {
+ this.m_costmapServiceReg = reg;
+ }
+
+ @Override
+ public void close() throws Exception {
+ try {
+ if (m_reg != null) {
+ m_reg.close();
+ }
+ } catch (Exception e) {
+ LOG.info("Error while closing the registration");
+ }
+ }
+
+ @Override
+ public void onDataChanged(AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
+ final ReadWriteTransaction rwx = m_dataBroker.newReadWriteTransaction();
+
+ Map<InstanceIdentifier<?>, DataObject> original = change.getOriginalData();
+
+ for (Map.Entry<InstanceIdentifier<?>, DataObject> entry : change.getUpdatedData().entrySet()) {
+ DataObject origin = original.get(entry.getKey());
+ DataObject updated = entry.getValue();
+
+ if (updated instanceof NetworkMap) {
+ updateNetworkMap((NetworkMap) origin, (NetworkMap) updated);
+ } else if (updated instanceof CostMap) {
+ updateCostMap((CostMap) origin, (CostMap) updated);
+ }
+ }
+
+ for (InstanceIdentifier<?> iid : change.getRemovedPaths()) {
+ DataObject removed = original.get(iid);
+
+ if (removed instanceof NetworkMap) {
+ removeNetworkMap((InstanceIdentifier<NetworkMap>) iid, (NetworkMap) removed, rwx);
+ LOG.info("Remove NetworkMap data from OPERATIONAL");
+ } else if (removed instanceof CostMap) {
+ removeCostMap((InstanceIdentifier<CostMap>) iid, (CostMap) removed, rwx);
+ LOG.info("Remove CostMap data from OPERATIONAL");
+ } else if (removed instanceof ConfigContext) {
+ removeConfigContext((InstanceIdentifier<ConfigContext>) iid, (ConfigContext) removed, rwx);
+ LOG.info("Remove ConfigContext data from OPERATIONAL");
+ }
+ }
+
+ for (Map.Entry<InstanceIdentifier<?>, DataObject> entry : change.getCreatedData().entrySet()) {
+ InstanceIdentifier<?> createdIID = entry.getKey();
+ DataObject created = entry.getValue();
+
+ if (created instanceof NetworkMap) {
+ createNetworkMap((NetworkMap) created, (InstanceIdentifier<NetworkMap>) createdIID, rwx);
+ LOG.info("Create new NetworkMap data into OPERATIONAL");
+ } else if (created instanceof CostMap) {
+ createCostMap((CostMap) created, (InstanceIdentifier<CostMap>) createdIID, rwx);
+ LOG.info("Create new CostMap data into OPERATIONAL");
+ } else if (created instanceof ConfigContext) {
+ createConfigContext((ConfigContext) created, (InstanceIdentifier<ConfigContext>) createdIID, rwx);
+ LOG.info("Create new ConfigContext data into OPERATIONAL");
+ }
+ }
+
+ rwx.submit();
+ }
+
+ private void updateNetworkMap(NetworkMap origin, NetworkMap updated) {
+ //TODO: No Implementation
+ }
+
+ private void updateCostMap(CostMap origin, CostMap updated) {
+ //TODO: No Implementation
+ }
+
+ private void removeNetworkMap(InstanceIdentifier<NetworkMap> mapIID, NetworkMap removed, final WriteTransaction wx) {
+ ResourcepoolUtils.deleteResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx);
+ m_networkmapServiceReg.unregisterPath(ServiceContext.class,
+ ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ removed.getResourceId(), removed.getTag()));
+ removeMap(mapIID, wx);
+ }
+
+ private void removeCostMap(InstanceIdentifier<CostMap> mapIID, CostMap removed, final WriteTransaction wx) {
+ ManualMapsUtils.deleteResourceCostMap(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT), removed.getResourceId(), wx);
+ m_costmapServiceReg.unregisterPath(ServiceContext.class,
+ ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ removed.getResourceId(), removed.getTag()));
+ removeMap(mapIID, wx);
+ }
+
+ private void removeConfigContext(InstanceIdentifier<ConfigContext> iid, ConfigContext removed, final WriteTransaction wx) {
+ ManualMapsUtils.deleteContext(removed.getContextId(), wx);
+ removeMap(iid, wx);
+ }
+
+ private void removeMap(InstanceIdentifier<?> mapIID, final WriteTransaction wx) {
+ wx.delete(LogicalDatastoreType.OPERATIONAL, mapIID);
+ }
+
+ private void createNetworkMap(NetworkMap created, InstanceIdentifier<NetworkMap> createdIID, final WriteTransaction wx) {
+ ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
+ created.getResourceId().getValue(),
+ ResourceTypeNetworkmap.class, wx);
+ ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ created.getResourceId(), created.getTag(), null, wx);
+ m_networkmapServiceReg.registerPath(ServiceContext.class,
+ ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ created.getResourceId(), created.getTag()));
+ wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
+ }
+
+ private void createCostMap(CostMap created, InstanceIdentifier<CostMap> createdIID, final WriteTransaction wx) {
+ ResourcepoolUtils.createResource(ManualMapsUtils.DEFAULT_CONTEXT,
+ created.getResourceId().getValue(),
+ ResourceTypeCostmap.class, wx);
+ List<InstanceIdentifier<?>> dependencies = new LinkedList<>();
+ dependencies.add(
+ ResourcepoolUtils.getContextTagIID(
+ new Uuid(ResourcepoolUtils.DEFAULT_CONTEXT),
+ created.getMeta().getDependentVtags().get(0).getResourceId(),
+ created.getMeta().getDependentVtags().get(0).getTag())
+ );
+ ResourcepoolUtils.updateResource(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ created.getResourceId(), created.getTag(), dependencies, wx);
+ m_costmapServiceReg.registerPath(ServiceContext.class,
+ ResourcepoolUtils.getContextTagIID(new Uuid(ManualMapsUtils.DEFAULT_CONTEXT),
+ created.getResourceId(), created.getTag()));
+ wx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
+ }
+
+ private void createConfigContext(ConfigContext created, InstanceIdentifier<ConfigContext> createdIID, final ReadWriteTransaction rwx) {
+ try {
+ if (!ResourcepoolUtils.contextExists(created.getContextId(), rwx)) {
+ ResourcepoolUtils.createResource(ResourcepoolUtils.DEFAULT_CONTEXT,
+ created.getContextId().getValue(),
+ ResourceTypeConfig.class, rwx);
+ ResourcepoolUtils.createContext(created.getContextId(), rwx);
+ }
+ } catch (InterruptedException | ExecutionException e) {
+ return;
+ }
+ rwx.put(LogicalDatastoreType.OPERATIONAL, createdIID, created);
+ }
+}
--- /dev/null
+/*
+ * 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.basic.impl;
+
+import org.opendaylight.alto.core.northbound.api.AltoNorthboundRoute;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+@Path("/")
+public class ManualMapsRoute implements AltoNorthboundRoute {
+
+ public static final String ALTO_CONFIG = "application/alto-config+json";
+ public static final String CONFIG_SUCCESS = "Config Resource Successfully!";
+
+ private AltoManualMapsProvider altoManualMapsProvider = null;
+
+ public ManualMapsRoute(AltoManualMapsProvider provider) {
+ altoManualMapsProvider = provider;
+ }
+
+ @Path("{path:.+}")
+ @POST
+ @Produces({ ALTO_CONFIG, ALTO_ERROR })
+ public Response modifyResourceRoute (@Context HttpServletRequest request, @PathParam("path") String path, String map) {
+ return Response.ok(CONFIG_SUCCESS + "(POST: " + path + ")", ALTO_CONFIG).build();
+ }
+
+ @Path("{path:.+}")
+ @PUT
+ @Produces({ ALTO_CONFIG, ALTO_ERROR })
+ public Response newResourceRoute (@Context HttpServletRequest request, @PathParam("path") String path, String map) {
+ return Response.ok(CONFIG_SUCCESS + "(PUT: " + path + ")", ALTO_CONFIG).build();
+ }
+
+ @Path("{path:.+}")
+ @DELETE
+ @Produces({ ALTO_CONFIG, ALTO_ERROR })
+ public Response removeResourceRoute (@Context HttpServletRequest request, @PathParam("path") String path, String map) {
+ return Response.ok(CONFIG_SUCCESS + "(DELETE: " + path + ")", ALTO_CONFIG).build();
+ }
+}
--- /dev/null
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.impl.rev151021;
+
+import org.opendaylight.alto.basic.impl.AltoManualMapsProvider;
+
+public class AltoManualMapsModule extends AbstractAltoManualMapsModule {
+ public AltoManualMapsModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public AltoManualMapsModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, AltoManualMapsModule oldModule, java.lang.AutoCloseable oldInstance) {
+ super(identifier, dependencyResolver, oldModule, oldInstance);
+ }
+
+ @Override
+ public void customValidation() {
+ // add custom validation form module attributes here.
+ }
+
+ @Override
+ public java.lang.AutoCloseable createInstance() {
+ final AltoManualMapsProvider provider = new AltoManualMapsProvider();
+
+ try {
+ getBrokerDependency().registerProvider(provider);
+ provider.setupRoute(getAltoNorthboundRouterDependency());
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ return provider;
+ }
+
+}
--- /dev/null
+/*
+* Generated file
+*
+* Generated from: yang module name: alto-manual-maps-impl yang module local name: alto-manual-maps
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Nov 11 21:58:28 CST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.impl.rev151021;
+public class AltoManualMapsModuleFactory extends AbstractAltoManualMapsModuleFactory {
+
+}
--- /dev/null
+module alto-manual-maps-impl {
+ yang-version 1;
+ namespace "urn:opendaylight:alto:basic:manual:maps:impl";
+ prefix "alto-manual-maps";
+
+ import alto-northbound { prefix alto-northbound; revision-date 2015-10-21; }
+ import config { prefix config; revision-date 2013-04-05; }
+ import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
+
+ description
+ "Service definition for alto-manual-maps project";
+
+ revision "2015-10-21" {
+ description
+ "Initial revision";
+ }
+
+ identity alto-manual-maps {
+ base config:module-type;
+ config:java-name-prefix AltoManualMaps;
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case alto-manual-maps {
+ when "/config:modules/config:module/config:type = 'alto-manual-maps'";
+ container broker {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity md-sal-binding:binding-broker-osgi-registry;
+ }
+ }
+ }
+
+ container alto-northbound-router {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity alto-northbound:alto-northbound-router;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.impl.rev151021;
+
+import org.junit.Test;
+
+public class AltoManualMapsModuleFactoryTest {
+ @Test
+ public void testFactoryConstructor() {
+ // ensure no exceptions on construction
+ new AltoManualMapsModuleFactory();
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.basic.manual.maps.impl.rev151021;
+
+import org.junit.Test;
+import org.opendaylight.alto.basic.impl.AltoManualMapsProvider;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+
+public class AltoManualMapsModuleTest {
+ @Test
+ public void testCustomValidation() {
+ //TODO
+ }
+
+ @Test
+ public void testCreateInstance() throws Exception {
+ //TODO
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>karaf-parent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-karaf</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <properties>
+ <karaf.localFeature>odl-alto-manual-maps-ui</karaf.localFeature>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-artifacts</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <!-- scope is compile so all features (there is only one) are installed
+ into startup.properties and the feature repo itself is not installed -->
+ <groupId>org.apache.karaf.features</groupId>
+ <artifactId>framework</artifactId>
+ <type>kar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-manual-maps-features</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <!-- DO NOT install or deploy the karaf artifact -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.opendaylight.alto.basic</groupId>
+ <artifactId>alto-manual-maps-aggregator</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>alto-manual-maps</name>
+ <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <profiles>
+ <profile>
+ <id>minimal</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>alto-dev</id>
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>features</module>
+ <module>artifacts</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>alto-test</id>
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>features</module>
+ <module>artifacts</module>
+ <module>karaf</module>
+ <!--<module>it</module>-->
+ </modules>
+ </profile>
+ </profiles>
+ <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:git:ssh://git.opendaylight.org:29418/alto-simple-ird.git</connection>
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/alto-simple-ird.git</developerConnection>
+ <tag>HEAD</tag>
+ <url>https://wiki.opendaylight.org/view/alto-simple-ird:Main</url>
+ </scm>
+</project>
+
</prerequisites>
<modules>
<module>simple-ird</module>
+ <module>manual-maps</module>
<module>endpointcostservice</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.basic</groupId>
<artifactId>alto-simple-ird-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151112013601</updated>
</snapshotVersion>
</snapshotVersions>
type string;
}
}
+
+ grouping "vtag" {
+ leaf "resource-id" {
+ type resource-id;
+ mandatory true;
+ }
+
+ leaf "tag" {
+ type tag;
+ mandatory true;
+ }
+ }
+
+ grouping "dependent-vtags" {
+ list "dependent-vtags" {
+ key "resource-id";
+ uses "vtag";
+ min-elements 1;
+ }
+ }
}
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-northbound-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151105030453</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>resources-impl</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>1.0.0-SNAPSHOT</value>
+ <value>1.0.1-SNAPSHOT</value>
<updated>20150922130129</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-northbound-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151105030453</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-northbound-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151105030453</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-northbound-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151105030453</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-base-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151022111158</updated>
</snapshotVersion>
</snapshotVersions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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.mdsal</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.9.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-api</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-basic-types</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-resourcepool-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-base-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>yang-ext</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types-2013-07-15</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+module alto-model-config {
+ yang-version 1;
+
+ namespace "urn:opendaylight:alto:service:model:config";
+
+ prefix "alto-model-config";
+
+ import "alto-basic-types" {
+ prefix "alto-types";
+ }
+
+ import "alto-resourcepool" {
+ prefix "resourcepool";
+ }
+
+ import "alto-model-base" {
+ prefix "base";
+ }
+
+ import "ietf-inet-types" {
+ prefix "ietf-inet";
+ }
+
+ organization "Yale University";
+
+ contact "alto-dev@lists.opendaylight.org";
+
+ revision "2015-10-21" {
+ description "Initial revision of alto config api";
+ }
+
+ identity "resource-type-config" {
+ base "resourcepool:resource-type";
+ description
+ "The resource type for config";
+ }
+
+ grouping "config-request-data" {
+ container "config-request-message" {
+ leaf "config-resource-id" {
+ type string;
+ }
+ leaf "config-resource-type" {
+ type string;
+ }
+ leaf "config-type" {
+ type enumeration {
+ enum "get";
+ enum "create";
+ enum "update";
+ enum "delete";
+ }
+ }
+ choice "config-resource-data" {
+ }
+ }
+ }
+
+ grouping "config-response-data" {
+ container "config-response-message" {
+ container "meta" {
+ }
+ container "config-response-data" {
+ }
+ }
+ }
+
+ grouping "alto-request-config" {
+ uses "base:alto-request-base" {
+ augment "request" {
+ case "config-request" {
+ uses "config-request-data";
+ }
+ }
+ }
+ }
+
+ grouping "alto-response-config" {
+ uses "base:alto-response-error" {
+ augment "response" {
+ case "config-response" {
+ uses "config-response-data";
+ }
+ }
+ }
+ }
+
+ rpc query {
+ input {
+ uses "alto-request-config";
+ }
+
+ output {
+ uses "alto-response-config";
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.alto</groupId>
+ <artifactId>alto-parent</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <relativePath>../../../../</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-artifacts</artifactId>
+ <packaging>pom</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-features</artifactId>
+ <version>${project.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>features-parent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-features</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <properties>
+ <mdsal.model.version>0.9.0-SNAPSHOT</mdsal.model.version>
+ <mdsal.version>1.4.0-SNAPSHOT</mdsal.version>
+ <restconf.version>1.4.0-SNAPSHOT</restconf.version>
+ <yangtools.version>0.9.0-SNAPSHOT</yangtools.version>
+ <dlux.version>0.4.0-SNAPSHOT</dlux.version>
+ <configfile.directory>etc/opendaylight/karaf</configfile.directory>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <!-- project specific dependencies -->
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>${mdsal.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>restconf-artifacts</artifactId>
+ <version>${restconf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>features-yangtools</artifactId>
+ <classifier>features</classifier>
+ <version>${yangtools.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>features-mdsal-model</artifactId>
+ <version>${mdsal.model.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>features-mdsal</artifactId>
+ <classifier>features</classifier>
+ <version>${mdsal.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.netconf</groupId>
+ <artifactId>features-restconf</artifactId>
+ <classifier>features</classifier>
+ <version>${restconf.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.dlux</groupId>
+ <artifactId>features-dlux</artifactId>
+ <classifier>features</classifier>
+ <version>${dlux.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-impl</artifactId>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-base-features</artifactId>
+ <classifier>features</classifier>
+ <version>${project.version}</version>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-base-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<features name="odl-alto-service-model-config-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
+ <repository>mvn:org.opendaylight.yangtools/features-yangtools/${yangtools.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.controller/features-mdsal/${mdsal.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.mdsal.model/features-mdsal-model/${mdsal.model.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.netconf/features-restconf/${restconf.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.dlux/features-dlux/${dlux.version}/xml/features</repository>
+ <repository>mvn:org.opendaylight.alto.core/alto-service-model-base-features/${project.version}/xml/features</repository>
+
+ <feature name='odl-alto-service-model-config-api' version='${project.version}' description='OpenDaylight :: alto-service-model-config :: api'>
+ <feature version='${mdsal.model.version}'>odl-mdsal-models</feature>
+ <feature version='${project.version}'>odl-alto-service-model-base</feature>
+ <bundle>mvn:org.opendaylight.alto.core/alto-service-model-config-api/${project.version}</bundle>
+ </feature>
+
+ <feature name='odl-alto-service-model-config' version='${project.version}' description='OpenDaylight :: alto-service-model-config'>
+ <feature version='${mdsal.version}'>odl-mdsal-broker</feature>
+ <feature version='${project.version}'>odl-alto-service-model-config-api</feature>
+ <bundle>mvn:org.opendaylight.alto.core/alto-service-model-config-impl/${project.version}</bundle>
+ <configfile finalname="${configfile.directory}/alto-service-model-config.xml">mvn:org.opendaylight.alto.core/alto-service-model-config-impl/${project.version}/xml/config</configfile>
+ </feature>
+
+ <feature name='odl-alto-service-model-config-rest' version='${project.version}' description='OpenDaylight :: alto-service-model-config :: REST'>
+ <feature version="${project.version}">odl-alto-service-model-config</feature>
+ <feature version="${restconf.version}">odl-restconf</feature>
+ </feature>
+
+ <feature name='odl-alto-service-model-config-ui' version='${project.version}' description='OpenDaylight :: alto-service-model-config :: UI'>
+ <feature version="${project.version}">odl-alto-service-model-config-rest</feature>
+ <feature version="${restconf.version}">odl-mdsal-apidocs</feature>
+ <feature version="${mdsal.version}">odl-mdsal-xsql</feature>
+ <feature version="${dlux.version}">odl-dlux-yangui</feature>
+ </feature>
+
+</features>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<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.5.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-impl</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-base-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-resourcepool-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-api</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>
+ </dependencies>
+
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<snapshot>
+ <required-capabilities>
+ <capability>urn:opendaylight:alto:service:model:test:config?module=alto-config-test-impl&revision=2015-10-21</capability>
+ <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
+ </required-capabilities>
+ <configuration>
+
+ <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+ <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <module>
+ <type xmlns:prefix="urn:opendaylight:alto:service:model:test:config">prefix:alto-model-config-test</type>
+ <name>alto-config-test</name>
+ <broker>
+ <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
+ <name>binding-osgi-broker</name>
+ </broker>
+ </module>
+ </modules>
+ </data>
+ </configuration>
+</snapshot>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata modelVersion="1.1.0">
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-impl</artifactId>
+ <version>0.2.1-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <localCopy>true</localCopy>
+ </snapshot>
+ <lastUpdated>20151028073152</lastUpdated>
+ <snapshotVersions>
+ <snapshotVersion>
+ <classifier>config</classifier>
+ <extension>xml</extension>
+ <value>0.2.1-SNAPSHOT</value>
+ <updated>20151028073152</updated>
+ </snapshotVersion>
+ </snapshotVersions>
+ </versioning>
+</metadata>
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.core.impl.config.test;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class AltoConfigProvider implements BindingAwareProvider, AutoCloseable {
+
+ private static final Logger LOG = LoggerFactory.getLogger(AltoConfigProvider.class);
+
+ private DataBroker m_dataBrokerService = null;
+
+ @Override
+ public void onSessionInitiated(ProviderContext session) {
+ LOG.info("AltoModelConfigProvider Session Initiated");
+ m_dataBrokerService = session.getSALService(DataBroker.class);
+ }
+
+ @Override
+ public void close() throws Exception {
+ LOG.info("AltoModelBaseProvider Closed");
+ }
+}
--- /dev/null
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021;
+
+import org.opendaylight.alto.core.impl.config.test.AltoConfigProvider;
+
+public class AltoConfigModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021.AbstractAltoConfigModule {
+ public AltoConfigModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+ super(identifier, dependencyResolver);
+ }
+
+ public AltoConfigModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021.AltoConfigModule 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() {
+ AltoConfigProvider provider = new AltoConfigProvider();
+
+ getBrokerDependency().registerProvider(provider);
+ return provider;
+ }
+
+}
--- /dev/null
+/*
+* Generated file
+*
+* Generated from: yang module name: alto-config-test-impl yang module local name: alto-model-config-test
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Oct 28 11:47:28 CST 2015
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021;
+public class AltoConfigModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021.AbstractAltoConfigModuleFactory {
+
+}
--- /dev/null
+module alto-config-test-impl {
+ yang-version 1;
+ namespace "urn:opendaylight:alto:service:model:test:config";
+ prefix "alto-model-config-test-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 config project";
+
+ revision "2015-10-21" {
+ description
+ "Initial revision";
+ }
+
+ identity alto-model-config-test {
+ base config:module-type;
+ config:java-name-prefix AltoConfig;
+ }
+
+ augment "/config:modules/config:module/config:configuration" {
+ case alto-model-config-test-impl {
+ when "/config:modules/config:module/config:type = 'alto-model-config-test'";
+ container broker {
+ uses config:service-ref {
+ refine type {
+ mandatory true;
+ config:required-identity md-sal-binding:binding-broker-osgi-registry;
+ }
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021;
+
+import org.junit.Test;
+
+public class AltoConfigModuleFactoryTest {
+ @Test
+ public void testFactoryConstructor() {
+ // ensure no exceptions on construction
+ new AltoConfigModuleFactory();
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yang.gen.v1.urn.opendaylight.alto.service.model.test.config.rev151021;
+
+import org.junit.Test;
+import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
+import org.opendaylight.controller.config.api.ModuleIdentifier;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.alto.core.impl.config.test.AltoConfigProvider;
+
+import javax.management.ObjectName;
+
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+public class AltoConfigModuleTest {
+ @Test
+ public void testCustomValidation() {
+ AltoConfigModule module = new AltoConfigModule(mock(ModuleIdentifier.class), mock(DependencyResolver.class));
+
+ // ensure no exceptions on validation
+ // currently this method is empty
+ module.customValidation();
+ }
+
+ @Test
+ public void testCreateInstance() throws Exception {
+ // configure mocks
+ DependencyResolver dependencyResolver = mock(DependencyResolver.class);
+ BindingAwareBroker broker = mock(BindingAwareBroker.class);
+ when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker);
+
+ // create instance of module with injected mocks
+ AltoConfigModule module = new AltoConfigModule(mock(ModuleIdentifier.class), dependencyResolver);
+
+ // getInstance calls resolveInstance to get the broker dependency and then calls createInstance
+ AutoCloseable closeable = module.getInstance();
+
+ // verify that the module registered the returned provider with the broker
+ verify(broker).registerProvider((AltoConfigProvider)closeable);
+
+ // ensure no exceptions on close
+ closeable.close();
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+
+<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>mdsal-it-parent</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-it</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <skipITs>false</skipITs>
+ <karaf.distro.groupId>org.opendaylight.alto.core</karaf.distro.groupId>
+ <karaf.distro.artifactId>alto-service-model-config-karaf</karaf.distro.artifactId>
+ <karaf.distro.version>0.3.0-SNAPSHOT</karaf.distro.version>
+ <karaf.distro.type>zip</karaf.distro.type>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-features</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+</project>
--- /dev/null
+/*
+ * Copyright © 2015 Yale University and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.alto.core.it;
+
+import static org.ops4j.pax.exam.CoreOptions.composite;
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
+import org.ops4j.pax.exam.options.MavenUrlReference;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class AltoIrdIT extends AbstractMdsalTestBase {
+ private static final Logger LOG = LoggerFactory.getLogger(AltoIrdIT.class);
+
+ @Override
+ public String getModuleName() {
+ return "alto-model-ird-test";
+ }
+
+ @Override
+ public String getInstanceName() {
+ return "alto-ird-test";
+ }
+
+ @Override
+ public MavenUrlReference getFeatureRepo() {
+ return maven()
+ .groupId("org.opendaylight.alto.core")
+ .artifactId("alto-service-model-ird-features")
+ .classifier("features")
+ .type("xml")
+ .versionAsInProject();
+ }
+
+ @Override
+ public String getFeatureName() {
+ return "odl-alto-service-model-ird-ui";
+ }
+
+ @Override
+ public Option getLoggingOption() {
+ Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+ logConfiguration(AltoIrdIT.class),
+ LogLevel.INFO.name());
+ option = composite(option, super.getLoggingOption());
+ return option;
+ }
+
+ @Test
+ public void testirdFeatureLoad() {
+ Assert.assertTrue(true);
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>karaf-parent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-karaf</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>${project.artifactId}</name>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <properties>
+ <karaf.localFeature>odl-alto-service-model-config-ui</karaf.localFeature>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-artifacts</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <!-- scope is compile so all features (there is only one) are installed
+ into startup.properties and the feature repo itself is not installed -->
+ <groupId>org.apache.karaf.features</groupId>
+ <artifactId>framework</artifactId>
+ <type>kar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>alto-service-model-config-features</artifactId>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+ <!-- DO NOT install or deploy the karaf artifact -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright © 2015 Yale University and others. All rights reserved.
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <parent>
+ <groupId>org.opendaylight.odlparent</groupId>
+ <artifactId>odlparent</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ <relativePath/>
+ </parent>
+
+ <groupId>org.opendaylight.alto.core</groupId>
+ <artifactId>alto-service-model-config-aggregator</artifactId>
+ <version>0.3.0-SNAPSHOT</version>
+ <name>alto-service-model-config</name>
+ <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <prerequisites>
+ <maven>3.1.1</maven>
+ </prerequisites>
+ <profiles>
+ <profile>
+ <id>minimal</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <modules>
+ <module>api</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>alto-dev</id>
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>features</module>
+ <module>artifacts</module>
+ </modules>
+ </profile>
+
+ <profile>
+ <id>alto-test</id>
+ <modules>
+ <module>api</module>
+ <module>impl</module>
+ <module>features</module>
+ <module>artifacts</module>
+ <module>karaf</module>
+ <module>it</module>
+ </modules>
+ </profile>
+ </profiles>
+
+ <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-costmap-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151028073152</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-endpointcost-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151028073152</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-endpointproperty-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151028073152</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-ird-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151028073152</updated>
</snapshotVersion>
</snapshotVersions>
<metadata modelVersion="1.1.0">
<groupId>org.opendaylight.alto.core</groupId>
<artifactId>alto-service-model-networkmap-impl</artifactId>
- <version>0.2.0-SNAPSHOT</version>
+ <version>0.2.1-SNAPSHOT</version>
<versioning>
<snapshot>
<localCopy>true</localCopy>
<snapshotVersion>
<classifier>config</classifier>
<extension>xml</extension>
- <value>0.2.0-SNAPSHOT</value>
+ <value>0.2.1-SNAPSHOT</value>
<updated>20151028073152</updated>
</snapshotVersion>
</snapshotVersions>
<module>model-ird</module>
<module>model-endpointproperty</module>
<module>model-costmap</module>
+ <module>model-config</module>
</modules>
<!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
<build>
--- /dev/null
+#!/bin/bash
+
+RESOURCE_ID=$1
+TAG=$2
+if [ $3 ]; then
+ CONTEXT_ID=$3
+else
+ CONTEXT_ID="00000000-0000-0000-0000-000000000000"
+fi
+URL="http://localhost:8181/restconf/config/alto-manual-maps:config-context/"$CONTEXT_ID"/resource-network-map/"$RESOURCE_ID
+
+echo $URL
+
+DATA=$(cat ./manualmaps/template/template_networkmap \
+ | sed 's/\$1/'$RESOURCE_ID'/g' \
+ | sed 's/\$2/'$TAG'/g')
+
+echo $DATA
+
+curl -X PUT -u admin:admin -v \
+ -H "Content-Type: application/json" -d "$(echo $DATA)"\
+ $URL
--- /dev/null
+{
+ "resource-network-map": {
+ "resource-id": "$1",
+ "tag": "$2",
+ "map": [
+ {
+ "pid": "PID0",
+ "endpoint-address-group": [
+ {
+ "address-type": "ipv4",
+ "endpoint-prefix": [
+ "127.0.0.1/8"
+ ]
+ }
+ ]
+ },
+ {
+ "pid": "PID1",
+ "endpoint-address-group": [
+ {
+ "address-type": "ipv4",
+ "endpoint-prefix": [
+ "192.168.1.0/24",
+ "192.168.2.0/24"
+ ]
+ },
+ {
+ "address-type": "ipv6",
+ "endpoint-prefix": [
+ "fe80::7a2b:cbff:fef7:2055/64"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+}