X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=groupbasedpolicy%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fgroupbasedpolicy%2Futil%2FIidFactory.java;h=592f6cd662641665308a6c2bf4245eec2876d073;hb=bb506478c28f880c2b02e79ea8c887b0ddc64f2d;hp=4f417f1042ab6e0e7cfd009542b2a94fa9c84312;hpb=d2b598b2db53e4e2f23337478624f16ed7c7745f;p=groupbasedpolicy.git diff --git a/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/util/IidFactory.java b/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/util/IidFactory.java index 4f417f104..592f6cd66 100644 --- a/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/util/IidFactory.java +++ b/groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/util/IidFactory.java @@ -11,11 +11,31 @@ package org.opendaylight.groupbasedpolicy.util; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.EndpointLocations; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.AddressEndpointLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.AddressEndpointLocationKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.ContainmentEndpointLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.ContainmentEndpointLocationKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.AddressEndpoints; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.ContainmentEndpoints; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.address.endpoints.AddressEndpoint; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.address.endpoints.AddressEndpointKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.containment.endpoints.ContainmentEndpoint; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.containment.endpoints.ContainmentEndpointKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.parent.child.endpoints.parent.endpoint.choice.parent.containment.endpoint._case.ParentContainmentEndpoint; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.parent.child.endpoints.parent.endpoint.choice.parent.containment.endpoint._case.ParentContainmentEndpointKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.absolute.location.AbsoluteLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.RelativeLocations; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.ExternalLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.ExternalLocationKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.InternalLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.InternalLocationKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionDefinitionId; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionName; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierDefinitionId; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierName; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClauseName; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContextId; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContractId; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.EndpointGroupId; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L2BridgeDomainId; @@ -33,6 +53,17 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.r import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Key; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Prefix; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3PrefixKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.LocationProviders; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.ProviderName; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.LocationProvider; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.LocationProviderKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.location.provider.ProviderAddressEndpointLocation; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.location.provider.ProviderAddressEndpointLocationKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.AddressType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.ContextType; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.Forwarding; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.forwarding.ForwardingByTenant; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.forwarding.ForwardingByTenantKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.SubjectFeatureDefinitions; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.Tenants; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRef; @@ -43,43 +74,53 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ClassifierDefinitionKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.Tenant; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.TenantKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.Contract; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ContractKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.EndpointGroup; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.EndpointGroupKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L2BridgeDomain; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L2BridgeDomainKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L2FloodDomain; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L2FloodDomainKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L3Context; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.L3ContextKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.SubjectFeatureInstances; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.Subnet; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.SubnetKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.Clause; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.ClauseKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.Subject; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.contract.SubjectKey; -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.RuleKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.endpoint.group.ConsumerNamedSelector; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.endpoint.group.ConsumerNamedSelectorKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.endpoint.group.ProviderNamedSelector; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.endpoint.group.ProviderNamedSelectorKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ActionInstance; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ActionInstanceKey; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ClassifierInstance; -import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.subject.feature.instances.ClassifierInstanceKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.Policy; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomainKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomainKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3ContextKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.SubnetKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.Contract; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ContractKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.EndpointGroup; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.EndpointGroupKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ExternalImplicitGroup; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ExternalImplicitGroupKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.SubjectFeatureInstances; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.Clause; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.ClauseKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.Subject; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.SubjectKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.subject.Rule; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.subject.RuleKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ConsumerNamedSelector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ConsumerNamedSelectorKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ProviderNamedSelector; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ProviderNamedSelectorKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstance; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstanceKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ClassifierInstance; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ClassifierInstanceKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.RendererName; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.Renderers; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.Renderer; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.RendererKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.Capabilities; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.Interests; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.SupportedActionDefinition; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.SupportedClassifierDefinition; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.FollowedTenants; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.FollowedTenant; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.FollowedTenantKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.followed.tenant.FollowedEndpointGroup; import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.followed.tenant.FollowedEndpointGroupKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.StatisticsStore; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.statistics.store.StatisticRecord; +import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.statistics.store.StatisticRecordKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class IidFactory { @@ -88,7 +129,8 @@ public class IidFactory { throw new UnsupportedOperationException(); } - private static final InstanceIdentifier ENDPOINTS_IID = InstanceIdentifier.builder(Endpoints.class).build(); + private static final InstanceIdentifier ENDPOINTS_IID = + InstanceIdentifier.builder(Endpoints.class).build(); public static InstanceIdentifier tenantIid(TenantId id) { return InstanceIdentifier.builder(Tenants.class).child(Tenant.class, new TenantKey(id)).build(); @@ -97,6 +139,7 @@ public class IidFactory { public static InstanceIdentifier endpointGroupIid(TenantId tenantId, EndpointGroupId epgId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(EndpointGroup.class, new EndpointGroupKey(epgId)) .build(); } @@ -104,14 +147,24 @@ public class IidFactory { public static InstanceIdentifier contractIid(TenantId tenantId, ContractId contractId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(Contract.class, new ContractKey(contractId)) .build(); } + public static InstanceIdentifier contractWildcardIid(TenantId tenantId) { + return InstanceIdentifier.builder(Tenants.class) + .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) + .child(Contract.class) + .build(); + } + public static InstanceIdentifier subjectIid(TenantId tenantId, ContractId contractId, SubjectName subjectName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(Contract.class, new ContractKey(contractId)) .child(Subject.class, new SubjectKey(subjectName)) .build(); @@ -121,6 +174,7 @@ public class IidFactory { EndpointGroupId epgId, SelectorName providerSelectorName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(EndpointGroup.class, new EndpointGroupKey(epgId)) .child(ProviderNamedSelector.class, new ProviderNamedSelectorKey(providerSelectorName)) .build(); @@ -130,14 +184,17 @@ public class IidFactory { EndpointGroupId epgId, SelectorName consumerSelectorName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(EndpointGroup.class, new EndpointGroupKey(epgId)) .child(ConsumerNamedSelector.class, new ConsumerNamedSelectorKey(consumerSelectorName)) .build(); } - public static InstanceIdentifier clauseIid(TenantId tenantId, ContractId contractId, ClauseName clauseName) { + public static InstanceIdentifier clauseIid(TenantId tenantId, ContractId contractId, + ClauseName clauseName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(Contract.class, new ContractKey(contractId)) .child(Clause.class, new ClauseKey(clauseName)) .build(); @@ -147,6 +204,7 @@ public class IidFactory { RuleName ruleName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(Contract.class, new ContractKey(contractId)) .child(Subject.class, new SubjectKey(subjectName)) .child(Rule.class, new RuleKey(ruleName)) @@ -156,6 +214,7 @@ public class IidFactory { public static InstanceIdentifier actionInstanceIid(TenantId tenantId, ActionName actionName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(SubjectFeatureInstances.class) .child(ActionInstance.class, new ActionInstanceKey(actionName)) .build(); @@ -165,6 +224,7 @@ public class IidFactory { ClassifierName classifierName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(SubjectFeatureInstances.class) .child(ClassifierInstance.class, new ClassifierInstanceKey(classifierName)) .build(); @@ -187,6 +247,7 @@ public class IidFactory { SubjectName subjectName, RuleName ruleName, ClassifierName classifierRefName) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) .child(Contract.class, new ContractKey(contractId)) .child(Subject.class, new SubjectKey(subjectName)) .child(Rule.class, new RuleKey(ruleName)) @@ -194,9 +255,11 @@ public class IidFactory { .build(); } - public static InstanceIdentifier l2FloodDomainIid(TenantId tenantId, L2FloodDomainId l2FloodDomainId) { + public static InstanceIdentifier l2FloodDomainIid(TenantId tenantId, + L2FloodDomainId l2FloodDomainId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(ForwardingContext.class) .child(L2FloodDomain.class, new L2FloodDomainKey(l2FloodDomainId)) .build(); } @@ -205,6 +268,7 @@ public class IidFactory { L2BridgeDomainId l2BridgeDomainId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(ForwardingContext.class) .child(L2BridgeDomain.class, new L2BridgeDomainKey(l2BridgeDomainId)) .build(); } @@ -212,12 +276,14 @@ public class IidFactory { public static InstanceIdentifier l3ContextIid(TenantId tenantId, L3ContextId l3ContextId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(ForwardingContext.class) .child(L3Context.class, new L3ContextKey(l3ContextId)) .build(); } /** * Get the {@link Endpoint} {@link InstanceIdentifier} based on the {@link EndpointKey} + * * @param endpointKey The {@link EndpointKey} of a particular {@link Endpoint} * @return The {@link InstanceIdentifier} of the {@link Endpoint} */ @@ -229,16 +295,16 @@ public class IidFactory { return IidFactory.endpointIid(new EndpointKey(l2Context, macAddress)); } + public static InstanceIdentifier l3EndpointIid(EndpointL3Key endpointL3Key) { + return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class, endpointL3Key).build(); + } + public static InstanceIdentifier l3EndpointIid(L3ContextId l3Context, IpAddress ipAddress) { - return InstanceIdentifier.builder(Endpoints.class) - .child(EndpointL3.class, new EndpointL3Key(ipAddress, l3Context)) - .build(); + return IidFactory.l3EndpointIid(new EndpointL3Key(ipAddress, l3Context)); } public static InstanceIdentifier l3EndpointsIidWildcard() { - return InstanceIdentifier.builder(Endpoints.class) - .child(EndpointL3.class) - .build(); + return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class).build(); } public static InstanceIdentifier endpointL3PrefixIid(L3ContextId l3Context, IpPrefix ipPrefix) { @@ -254,10 +320,19 @@ public class IidFactory { public static InstanceIdentifier subnetIid(TenantId tenantId, SubnetId subnetId) { return InstanceIdentifier.builder(Tenants.class) .child(Tenant.class, new TenantKey(tenantId)) + .child(ForwardingContext.class) .child(Subnet.class, new SubnetKey(subnetId)) .build(); } + public static InstanceIdentifier subnetWildcardIid(TenantId tenantId) { + return InstanceIdentifier.builder(Tenants.class) + .child(Tenant.class, new TenantKey(tenantId)) + .child(ForwardingContext.class) + .child(Subnet.class) + .build(); + } + public static InstanceIdentifier followedEndpointgroupIid(RendererName rendererName, TenantId tenantId, EndpointGroupId epgId) { return InstanceIdentifier.builder(Renderers.class) @@ -269,4 +344,153 @@ public class IidFactory { .build(); } + public static InstanceIdentifier supportedActionDefinitionIidWildcard() { + return InstanceIdentifier.builder(Renderers.class) + .child(Renderer.class) + .child(Capabilities.class) + .child(SupportedActionDefinition.class) + .build(); + } + + public static InstanceIdentifier supportedClassifierDefinitionIidWildcard() { + return InstanceIdentifier.builder(Renderers.class) + .child(Renderer.class) + .child(Capabilities.class) + .child(SupportedClassifierDefinition.class) + .build(); + } + + public static InstanceIdentifier statisticRecordIid(StatisticRecordKey key) { + return InstanceIdentifier.builder(StatisticsStore.class).child(StatisticRecord.class, key).build(); + } + + public static InstanceIdentifier followedTenantIid(RendererName rendererName, TenantId tenantId) { + return InstanceIdentifier.builder(Renderers.class) + .child(Renderer.class, new RendererKey(rendererName)) + .child(Interests.class) + .child(FollowedTenants.class) + .child(FollowedTenant.class, new FollowedTenantKey(tenantId)) + .build(); + } + + public static InstanceIdentifier rendererIid(RendererName rendererName) { + return InstanceIdentifier.builder(Renderers.class).child(Renderer.class, new RendererKey(rendererName)).build(); + } + + public static InstanceIdentifier renderersIid() { + return InstanceIdentifier.builder(Renderers.class).build(); + } + + public static InstanceIdentifier externalImplicitGroupIid(TenantId tenantId, + EndpointGroupId epgId) { + return InstanceIdentifier.builder(Tenants.class) + .child(Tenant.class, new TenantKey(tenantId)) + .child(Policy.class) + .child(ExternalImplicitGroup.class, new ExternalImplicitGroupKey(epgId)) + .build(); + } + + public static InstanceIdentifier containmentEndpointIid(ContainmentEndpointKey key) { + return InstanceIdentifier + .builder( + org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class) + .child(ContainmentEndpoints.class) + .child(ContainmentEndpoint.class, key) + .build(); + } + + public static InstanceIdentifier addressEndpointIid(AddressEndpointKey addressEndpointKey) { + return InstanceIdentifier + .builder( + org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class) + .child(AddressEndpoints.class) + .child(AddressEndpoint.class, addressEndpointKey) + .build(); + } + + public static InstanceIdentifier parentContainmentEndpointIid( + AddressEndpointKey addressEndpointKey, ParentContainmentEndpointKey parentContainmentEndpointKey) { + return InstanceIdentifier + .builder( + org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class) + .child(AddressEndpoints.class) + .child(AddressEndpoint.class, addressEndpointKey) + .child(ParentContainmentEndpoint.class, parentContainmentEndpointKey) + .build(); + } + + public static InstanceIdentifier addressEndpointLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(AddressEndpointLocation.class, addrEndpointLocationKey) + .build(); + } + + public static InstanceIdentifier containmentEndpointLocationIid(ContainmentEndpointLocationKey addrEndpointLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(ContainmentEndpointLocation.class, addrEndpointLocationKey) + .build(); + } + + public static InstanceIdentifier internalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey, + InternalLocationKey internalLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(AddressEndpointLocation.class, addrEndpointLocationKey) + .child(RelativeLocations.class) + .child(InternalLocation.class, internalLocationKey) + .build(); + } + + public static InstanceIdentifier internalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey, + InternalLocationKey internalLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(ContainmentEndpointLocation.class, contEndpointLocationKey) + .child(RelativeLocations.class) + .child(InternalLocation.class, internalLocationKey) + .build(); + } + + public static InstanceIdentifier externalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey, + ExternalLocationKey externalLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(AddressEndpointLocation.class, addrEndpointLocationKey) + .child(RelativeLocations.class) + .child(ExternalLocation.class, externalLocationKey) + .build(); + } + + public static InstanceIdentifier externalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey, + ExternalLocationKey externalLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(ContainmentEndpointLocation.class, contEndpointLocationKey) + .child(RelativeLocations.class) + .child(ExternalLocation.class, externalLocationKey) + .build(); + } + + public static InstanceIdentifier absoluteLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) { + return InstanceIdentifier.builder(EndpointLocations.class) + .child(AddressEndpointLocation.class, addrEndpointLocationKey) + .child(AbsoluteLocation.class) + .build(); + } + + public static InstanceIdentifier providerAddressEndpointLocationIid(String provider, + Class addrType, String addr, Class cType, + ContextId containment) { + return InstanceIdentifier.builder(LocationProviders.class) + .child(LocationProvider.class, new LocationProviderKey(new ProviderName(provider))) + .child(ProviderAddressEndpointLocation.class, new ProviderAddressEndpointLocationKey(addr, addrType, containment, cType)) + .build(); + } + + public static InstanceIdentifier forwardingByTenantIid(TenantId tenantId) { + return forwardingByTenantIid(new ForwardingByTenantKey(tenantId)); + } + + public static InstanceIdentifier forwardingByTenantIid( + ForwardingByTenantKey forwardingByTenantKey) { + return InstanceIdentifier.builder(Forwarding.class) + .child(ForwardingByTenant.class, forwardingByTenantKey) + .build(); + } }