Merge "Fixed EIC grouping"
authorKeith Burns <alagalah@gmail.com>
Sat, 9 May 2015 13:54:23 +0000 (13:54 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Sat, 9 May 2015 13:54:23 +0000 (13:54 +0000)
groupbasedpolicy/src/main/yang/model/policy.yang
neutron-mapper/src/main/java/org/opendaylight/groupbasedpolicy/neutron/mapper/mapping/TransformSecRule.java

index 5ac23f7a050cdca76ed3d056c3757e7806510187..13ece140f7cdb6e70db1fed446e84ec9ad08f494 100755 (executable)
@@ -237,6 +237,24 @@ module policy {
         }
     }
 
+    grouping has-endpoint-identification-constraints {
+        container endpoint-identification-constraints {
+            description
+                "Identify endpoints via other attributes other than conditions.
+                These can be things such as ip-prefix, vlan, mpls label etc. These
+                things are intended to be explicity stated, and should not contain
+                references to other objects like endpointsIDs.";
+            container l3-endpoint-identification-constraints {
+                list prefix-constraint {
+                    key ip-prefix;
+                    leaf ip-prefix {
+                        type inet:ip-prefix;
+                    }
+                }
+            }
+        }
+    }
+
     // ************************
     // Network domains grouping
     // ************************
@@ -1280,21 +1298,7 @@ module policy {
 
                         uses has-condition-matchers;
 
-                        container endpoint-identification-constraints {
-                            description
-                                "Identify endpoints via other attributes other than conditions.
-                                These can be things such as ip-prefix, vlan, mpls label etc. These
-                                things are intended to be explicity stated, and should not contain
-                                references to other objects like endpointsIDs.";
-                            container l3-endpoint-identification-constraints {
-                                list prefix-constraint {
-                                    key ip-prefix;
-                                    leaf ip-prefix {
-                                        type inet:ip-prefix;
-                                    }
-                                }
-                            }
-                        }
+                        uses has-endpoint-identification-constraints;
                     }
 
                     container provider-matchers {
@@ -1371,21 +1375,7 @@ module policy {
 
                         uses has-condition-matchers;
 
-                        container endpoint-identification-constraints {
-                            description
-                                "Identify endpoints via other attributes other than conditions.
-                                These can be things such as ip-prefix, vlan, mpls label etc. These
-                                things are intended to be explicity stated, and should not contain
-                                references to other objects like endpointsIDs.";
-                            container l3-endpoint-identification-constraints {
-                                list prefix-constraint {
-                                    key ip-prefix;
-                                    leaf ip-prefix {
-                                        type inet:ip-prefix;
-                                    }
-                                }
-                            }
-                        }
+                        uses has-endpoint-identification-constraints;
                     }
 
                     container any-matchers {
index 8940bb911bcae6a33100b0daae95060d4698e56a..9ab37b43f3be827640801d0c52735168a2e785e2 100644 (file)
@@ -26,6 +26,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRef.ConnectionTracking;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRefBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.endpoint.identification.constraints.EndpointIdentificationConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.endpoint.identification.constraints.endpoint.identification.constraints.L3EndpointIdentificationConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.endpoint.identification.constraints.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraint;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.endpoint.identification.constraints.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraintBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.instance.ParameterValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.instance.ParameterValueBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.instance.parameter.value.RangeValueBuilder;
@@ -35,10 +39,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.SubjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.ConsumerMatchersBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.ProviderMatchersBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.consumer.matchers.EndpointIdentificationConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.consumer.matchers.endpoint.identification.constraints.L3EndpointIdentificationConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.consumer.matchers.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraint;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.consumer.matchers.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraintBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.subject.Rule;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.subject.RuleBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ClassifierInstance;
@@ -122,9 +122,9 @@ public class TransformSecRule {
                                             ipPrefix).build())).build()).build()).build());
             if (isEpgIdRouterOrDhcp(providerEpgId)) {
                 clauseBuilder.setProviderMatchers(new ProviderMatchersBuilder().setEndpointIdentificationConstraints(
-                        new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.provider.matchers.EndpointIdentificationConstraintsBuilder().setL3EndpointIdentificationConstraints(
-                                new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.provider.matchers.endpoint.identification.constraints.L3EndpointIdentificationConstraintsBuilder().setPrefixConstraint(
-                                        ImmutableList.<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.provider.matchers.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraint>of(new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.clause.provider.matchers.endpoint.identification.constraints.l3.endpoint.identification.constraints.PrefixConstraintBuilder().setIpPrefix(
+                        new EndpointIdentificationConstraintsBuilder().setL3EndpointIdentificationConstraints(
+                                new L3EndpointIdentificationConstraintsBuilder().setPrefixConstraint(
+                                        ImmutableList.<PrefixConstraint>of(new PrefixConstraintBuilder().setIpPrefix(
                                                 ipPrefix)
                                             .build()))
                                     .build())