Implement endpoint registry augments 63/8563/1
authorRob Adams <readams@readams.net>
Wed, 2 Jul 2014 16:50:15 +0000 (09:50 -0700)
committerRob Adams <readams@readams.net>
Wed, 2 Jul 2014 16:50:15 +0000 (09:50 -0700)
Some minor tweaks to endpoint model from Martin

Change-Id: I4b972748fafffd90de9a499fbdda5ac65bcfa565
Signed-off-by: Rob Adams <readams@readams.net>
groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/endpoint/AbstractEndpointRegistry.java
groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/EndpointManager.java
groupbasedpolicy/src/main/yang/model/endpoint.yang
groupbasedpolicy/src/main/yang/renderer/ofoverlay/ofoverlay.yang

index 844b0d06cf4112333922fe7081b78d1ff0f8b1e3..91de0d8901a6ca7bd4dc2ebe7a08fb30633802cf 100644 (file)
@@ -49,7 +49,7 @@ import com.google.common.util.concurrent.ListenableFuture;
  * updating information about endpoints.
  * @author readamsO
  */
-public class AbstractEndpointRegistry 
+public abstract class AbstractEndpointRegistry 
         implements AutoCloseable, EndpointService {
     
     protected final DataBroker dataProvider;
index 69a2d9edcfa78973301218635fc88bfea8b1a507..d75feb90956f09d6135e4f423a50fdd9fe4228f3 100644 (file)
@@ -26,6 +26,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayContextBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.ofoverlay.rev140528.OfOverlayContextInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -113,7 +115,11 @@ public class EndpointManager
     
     @Override
     protected EndpointBuilder buildEndpoint(RegisterEndpointInput input) {
-        return super.buildEndpoint(input);
+        OfOverlayContextInput ictx = 
+                input.getAugmentation(OfOverlayContextInput.class);
+        return super.buildEndpoint(input)
+                .addAugmentation(OfOverlayContext.class, 
+                                 new OfOverlayContextBuilder(ictx).build());
     }
 
     @Override
index a49b1413a7a666b1d66ef106df2c5f794e528515..e675239209ddf687baaa6e8a23a51ec3428d5285 100644 (file)
@@ -114,6 +114,7 @@ module endpoint {
         description 
             "Repository for operational state data about endpoints needed for
              policy resolution.";
+        config false;
 
         list endpoint {
             description 
@@ -131,19 +132,7 @@ module endpoint {
                  list as well.";
 
             key "l3-context ip-address";
-
-            leaf l3-context {
-                type gbp-common:l3-context-id;
-                mandatory true;
-                description 
-                    "The context for this layer 3 address";
-            }
-            leaf ip-address {
-                type inet:ip-address;
-                mandatory true;
-                description 
-                    "The actual IP address for the endpoint";
-            }
+            uses l3-key;
 
             uses endpoint-fields;
         }
index 2fed364e42b537aedd387891d859fe262f273f82..683e0c7651ac0f97052d4d0d6da64aed55a9be42 100644 (file)
@@ -52,18 +52,48 @@ module ofoverlay {
         }
     }
 
-    augment "/endpoint:endpoints/endpoint:endpoint" {
-        ext:augment-identifier "of-overlay-context";
+    grouping endpoint-location {
+        description 
+            "The location for this endpoint in the overlay network";
+
+        leaf location-type {
+            default internal;
+
+            type enumeration {
+                enum internal {
+                    description 
+                    "The endpoint is located on a port that is part of 
+                             the overlay network.  You must include the node ID
+                             and port number for this endpoint.";
+                }
+                enum external {
+                    description "This endpoint is not inside the overlay.";
+                }
+            }
+        }
 
         leaf node-id {
-            description "The OpenFlow switch for the endpoint";
+            description 
+                "The OpenFlow switch for the endpoint. Must be included 
+                     for all internal endpoints.";
             type inv:node-id;
         }
 
         leaf port-number {
             description 
-                "The port number of the OpenFlow port for the endpoint";
+                "The port number of the OpenFlow port for the endpoint.  
+                     Must be included for all internal endpoints";
             type uint32;
         }
     }
+
+    augment "/endpoint:endpoints/endpoint:endpoint" {
+        ext:augment-identifier "of-overlay-context";
+        uses endpoint-location;
+    }
+
+    augment "/endpoint:register-endpoint/endpoint:input" {
+        ext:augment-identifier "of-overlay-context-input";
+        uses endpoint-location;
+    }
 }