Merge "initial commit - sxp-mapper project created"
authorMartin Sunal <msunal@cisco.com>
Thu, 21 Apr 2016 18:33:52 +0000 (18:33 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 21 Apr 2016 18:33:52 +0000 (18:33 +0000)
sxp-mapper/pom.xml [new file with mode: 0755]
sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModule.java [new file with mode: 0644]
sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModuleFactory.java [new file with mode: 0644]
sxp-mapper/src/main/yang/sxp-mapper-cfg.yang [new file with mode: 0644]
sxp-mapper/src/main/yang/sxp-mapper-model.yang [new file with mode: 0644]

diff --git a/sxp-mapper/pom.xml b/sxp-mapper/pom.xml
new file mode 100755 (executable)
index 0000000..e0af0e3
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+  This program and the accompanying materials are made available under the
+  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  and is available at http://www.eclipse.org/legal/epl-v10.html -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.controller</groupId>
+        <artifactId>config-parent</artifactId>
+        <version>0.4.2-SNAPSHOT</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.opendaylight.groupbasedpolicy</groupId>
+    <artifactId>sxp-mapper</artifactId>
+    <version>0.3.2-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+    <name>groupbasedpolicy-sxp-mapper</name>
+
+    <properties>
+        <sxp.version>1.2.2-SNAPSHOT</sxp.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.opendaylight.sxp</groupId>
+                <artifactId>sxp-api</artifactId>
+                <version>${sxp.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- model dependencies -->
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>ietf-inet-types</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>yang-ext</artifactId>
+        </dependency>
+
+        <!-- sxp deps -->
+        <dependency>
+            <groupId>org.opendaylight.sxp</groupId>
+            <artifactId>sxp-api</artifactId>
+        </dependency>
+
+        <!-- testing dependencies -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-binding-broker-impl</artifactId>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <!-- project build -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
diff --git a/sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModule.java b/sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModule.java
new file mode 100644 (file)
index 0000000..2b23b7f
--- /dev/null
@@ -0,0 +1,25 @@
+package org.opendaylight.controller.config.yang.config.groupbasedpolicy.sxp_mapper;
+/**
+* sxp-mapper impl module
+*/
+public class SxpMapperProviderModule extends org.opendaylight.controller.config.yang.config.groupbasedpolicy.sxp_mapper.AbstractSxpMapperProviderModule {
+    public SxpMapperProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+        super(identifier, dependencyResolver);
+    }
+
+    public SxpMapperProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.groupbasedpolicy.sxp_mapper.SxpMapperProviderModule 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() {
+        // TODO:implement
+        throw new java.lang.UnsupportedOperationException();
+    }
+
+}
diff --git a/sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModuleFactory.java b/sxp-mapper/src/main/java/org/opendaylight/controller/config/yang/config/groupbasedpolicy/sxp_mapper/SxpMapperProviderModuleFactory.java
new file mode 100644 (file)
index 0000000..9be5b6a
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+* Generated file
+*
+* Generated from: yang module name: sxp-mapper-cfg yang module local name: sxp-mapper-impl
+* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
+* Generated at: Wed Mar 02 15:09:59 CET 2016
+*
+* Do not modify this file unless it is present under src/main directory
+*/
+package org.opendaylight.controller.config.yang.config.groupbasedpolicy.sxp_mapper;
+public class SxpMapperProviderModuleFactory extends org.opendaylight.controller.config.yang.config.groupbasedpolicy.sxp_mapper.AbstractSxpMapperProviderModuleFactory {
+
+}
diff --git a/sxp-mapper/src/main/yang/sxp-mapper-cfg.yang b/sxp-mapper/src/main/yang/sxp-mapper-cfg.yang
new file mode 100644 (file)
index 0000000..2d84ac8
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module sxp-mapper-cfg {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy:sxp-mapper";
+    prefix "sxpm-cfg";
+
+    import config { prefix config; revision-date 2013-04-05; }
+    import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; }
+
+    description
+        "This module contains the base YANG definitions for
+          sxf-mapper impl configuration.";
+
+    revision "2016-03-02" {
+        description
+            "Initial revision.";
+    }
+
+    identity sxp-mapper-impl {
+        description
+            "sxp-mapper impl module";
+
+        base "config:module-type";
+        config:java-name-prefix SxpMapperProvider;
+    }
+
+    // Augments the 'configuration' choice node under modules/module.
+    augment "/config:modules/config:module/config:configuration" {
+        case sxp-mapper-impl {
+            when "/config:modules/config:module/config:type = 'sxp-mapper-impl'";
+
+            //wires in the data-broker service
+            container data-broker {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity mdsal:binding-async-data-broker;
+                    }
+                }
+            }
+            //RPC Registry
+            container rpc-registry {
+                uses config:service-ref {
+                    refine type {
+                        mandatory true;
+                        config:required-identity mdsal:binding-rpc-registry;
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/sxp-mapper/src/main/yang/sxp-mapper-model.yang b/sxp-mapper/src/main/yang/sxp-mapper-model.yang
new file mode 100644 (file)
index 0000000..0b53240
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+module sxp-mapper-model {
+    yang-version 1;
+    namespace "urn:opendaylight:params:xml:ns:yang:controller:config:groupbasedpolicy:sxp-mapper:model";
+    prefix "sxpm-model";
+
+    import sxp-database { prefix sxp-database; revision-date 2014-10-02; }
+
+    description
+        "This module contains the YANG definitions for
+          sxf-mapper implementation.";
+
+    revision "2016-03-02" {
+        description
+            "Initial revision.";
+    }
+
+    container sxp-mapper {
+        description "root point for endpoint templates";
+
+        list endpoint-policy-template-by-sgt {
+            key sgt;
+            leaf sgt {
+                type sxp-database:sgt;
+                description
+                    "SGT for which this endpoint template is used";
+            }
+            leaf tenant {
+               type gbp-common:tenant-id;
+               mandatory true;
+               description
+                    "The tenant of this endpoint";
+            }
+            leaf-list endpoint-groups {
+               type gbp-common:endpoint-group-id;
+               mandatory true;
+               description
+                    "The groups associated with this endpoint";
+            }
+            leaf-list conditions {
+               type gbp-common:condition-name;
+               description
+                    "The conditions associated with this endpoint";
+            }
+        }
+
+        list endpoint-forwarding-template-by-subnet {
+            description "If the IP from IP/SGT binding is inside of ip-prefix then
+                the endpoint will be in the l3-context.";
+            key ip-prefix;
+            leaf ip-prefix {
+                type inet:ip-prefix;
+                description
+                    "The IP prefix where an endpoint can be connected.";
+            }
+            leaf l3-context {
+               type gbp-common:l3-context-id;
+               mandatory true;
+               description
+                    "The context for the endpoint’s layer 3 address";
+            }
+        }
+    }
+}