f04cf411878b634ad68ad2be511f28ed1b5bcba1
[groupbasedpolicy.git] / groupbasedpolicy / src / main / java / org / opendaylight / groupbasedpolicy / util / IidFactory.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.groupbasedpolicy.util;
10
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpPrefix;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.EndpointLocations;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.AddressEndpointLocation;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.AddressEndpointLocationKey;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.ContainmentEndpointLocation;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoint.locations.ContainmentEndpointLocationKey;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.AddressEndpoints;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.ContainmentEndpoints;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.address.endpoints.AddressEndpoint;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.address.endpoints.AddressEndpointKey;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.containment.endpoints.ContainmentEndpoint;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.endpoints.containment.endpoints.ContainmentEndpointKey;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.absolute.location.AbsoluteLocation;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.RelativeLocations;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.ExternalLocation;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.ExternalLocationKey;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.InternalLocation;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.has.relative.location.relative.locations.InternalLocationKey;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionDefinitionId;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ActionName;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierDefinitionId;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClassifierName;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ClauseName;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContextId;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.ContractId;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.EndpointGroupId;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L2BridgeDomainId;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L2FloodDomainId;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L3ContextId;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.RuleName;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.SelectorName;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.SubjectName;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.SubnetId;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.TenantId;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.Endpoints;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.Endpoint;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointKey;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3;
51 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Key;
52 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3Prefix;
53 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointL3PrefixKey;
54 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.LocationProviders;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.ProviderName;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.LocationProvider;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.LocationProviderKey;
58 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.location.provider.ProviderAddressEndpointLocation;
59 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint_location_provider.rev160419.location.providers.location.provider.ProviderAddressEndpointLocationKey;
60 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.AddressType;
61 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.ContextType;
62 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.Forwarding;
63 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.forwarding.ForwardingByTenant;
64 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.forwarding.rev160427.forwarding.ForwardingByTenantKey;
65 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.SubjectFeatureDefinitions;
66 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.Tenants;
67 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRef;
68 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.has.classifier.refs.ClassifierRefKey;
69 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ActionDefinition;
70 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ActionDefinitionKey;
71 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ClassifierDefinition;
72 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.subject.feature.definitions.ClassifierDefinitionKey;
73 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.Tenant;
74 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.TenantKey;
75 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.Policy;
76 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomainKey;
77 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomainKey;
78 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3ContextKey;
79 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.SubnetKey;
80 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.Contract;
81 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ContractKey;
82 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.EndpointGroup;
83 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.EndpointGroupKey;
84 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ExternalImplicitGroup;
85 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.ExternalImplicitGroupKey;
86 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.SubjectFeatureInstances;
87 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.Clause;
88 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.ClauseKey;
89 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.Subject;
90 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.SubjectKey;
91 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.subject.Rule;
92 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.contract.subject.RuleKey;
93 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ConsumerNamedSelector;
94 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ConsumerNamedSelectorKey;
95 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ProviderNamedSelector;
96 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.endpoint.group.ProviderNamedSelectorKey;
97 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstance;
98 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ActionInstanceKey;
99 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ClassifierInstance;
100 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.policy.subject.feature.instances.ClassifierInstanceKey;
101 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.RendererName;
102 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.Renderers;
103 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.Renderer;
104 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.RendererKey;
105 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.Capabilities;
106 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.Interests;
107 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.SupportedActionDefinition;
108 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.capabilities.SupportedClassifierDefinition;
109 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.FollowedTenants;
110 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.FollowedTenant;
111 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.FollowedTenantKey;
112 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.followed.tenant.FollowedEndpointGroup;
113 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.renderer.rev151103.renderers.renderer.interests.followed.tenants.followed.tenant.FollowedEndpointGroupKey;
114 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.StatisticsStore;
115 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.statistics.store.StatisticRecord;
116 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.statistics.store.rev151215.statistics.store.StatisticRecordKey;
117 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
118 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
119
120 public class IidFactory {
121
122     private IidFactory() {
123         throw new UnsupportedOperationException();
124     }
125
126     private static final InstanceIdentifier<Endpoints> ENDPOINTS_IID =
127             InstanceIdentifier.builder(Endpoints.class).build();
128
129     public static InstanceIdentifier<Tenant> tenantIid(TenantId id) {
130         return InstanceIdentifier.builder(Tenants.class).child(Tenant.class, new TenantKey(id)).build();
131     }
132
133     public static InstanceIdentifier<EndpointGroup> endpointGroupIid(TenantId tenantId, EndpointGroupId epgId) {
134         return InstanceIdentifier.builder(Tenants.class)
135             .child(Tenant.class, new TenantKey(tenantId))
136             .child(Policy.class)
137             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
138             .build();
139     }
140
141     public static InstanceIdentifier<Contract> contractIid(TenantId tenantId, ContractId contractId) {
142         return InstanceIdentifier.builder(Tenants.class)
143             .child(Tenant.class, new TenantKey(tenantId))
144             .child(Policy.class)
145             .child(Contract.class, new ContractKey(contractId))
146             .build();
147     }
148
149     public static InstanceIdentifier<Contract> contractWildcardIid(TenantId tenantId) {
150         return InstanceIdentifier.builder(Tenants.class)
151             .child(Tenant.class, new TenantKey(tenantId))
152             .child(Policy.class)
153             .child(Contract.class)
154             .build();
155     }
156
157     public static InstanceIdentifier<Subject> subjectIid(TenantId tenantId, ContractId contractId,
158             SubjectName subjectName) {
159         return InstanceIdentifier.builder(Tenants.class)
160             .child(Tenant.class, new TenantKey(tenantId))
161             .child(Policy.class)
162             .child(Contract.class, new ContractKey(contractId))
163             .child(Subject.class, new SubjectKey(subjectName))
164             .build();
165     }
166
167     public static InstanceIdentifier<ProviderNamedSelector> providerNamedSelectorIid(TenantId tenantId,
168             EndpointGroupId epgId, SelectorName providerSelectorName) {
169         return InstanceIdentifier.builder(Tenants.class)
170             .child(Tenant.class, new TenantKey(tenantId))
171             .child(Policy.class)
172             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
173             .child(ProviderNamedSelector.class, new ProviderNamedSelectorKey(providerSelectorName))
174             .build();
175     }
176
177     public static InstanceIdentifier<ConsumerNamedSelector> consumerNamedSelectorIid(TenantId tenantId,
178             EndpointGroupId epgId, SelectorName consumerSelectorName) {
179         return InstanceIdentifier.builder(Tenants.class)
180             .child(Tenant.class, new TenantKey(tenantId))
181             .child(Policy.class)
182             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
183             .child(ConsumerNamedSelector.class, new ConsumerNamedSelectorKey(consumerSelectorName))
184             .build();
185     }
186
187     public static InstanceIdentifier<Clause> clauseIid(TenantId tenantId, ContractId contractId,
188             ClauseName clauseName) {
189         return InstanceIdentifier.builder(Tenants.class)
190             .child(Tenant.class, new TenantKey(tenantId))
191             .child(Policy.class)
192             .child(Contract.class, new ContractKey(contractId))
193             .child(Clause.class, new ClauseKey(clauseName))
194             .build();
195     }
196
197     public static InstanceIdentifier<Rule> ruleIid(TenantId tenantId, ContractId contractId, SubjectName subjectName,
198             RuleName ruleName) {
199         return InstanceIdentifier.builder(Tenants.class)
200             .child(Tenant.class, new TenantKey(tenantId))
201             .child(Policy.class)
202             .child(Contract.class, new ContractKey(contractId))
203             .child(Subject.class, new SubjectKey(subjectName))
204             .child(Rule.class, new RuleKey(ruleName))
205             .build();
206     }
207
208     public static InstanceIdentifier<ActionInstance> actionInstanceIid(TenantId tenantId, ActionName actionName) {
209         return InstanceIdentifier.builder(Tenants.class)
210             .child(Tenant.class, new TenantKey(tenantId))
211             .child(Policy.class)
212             .child(SubjectFeatureInstances.class)
213             .child(ActionInstance.class, new ActionInstanceKey(actionName))
214             .build();
215     }
216
217     public static InstanceIdentifier<ClassifierInstance> classifierInstanceIid(TenantId tenantId,
218             ClassifierName classifierName) {
219         return InstanceIdentifier.builder(Tenants.class)
220             .child(Tenant.class, new TenantKey(tenantId))
221             .child(Policy.class)
222             .child(SubjectFeatureInstances.class)
223             .child(ClassifierInstance.class, new ClassifierInstanceKey(classifierName))
224             .build();
225     }
226
227     public static InstanceIdentifier<ClassifierDefinition> classifierDefinitionIid(
228             ClassifierDefinitionId classifierDefinitionId) {
229         return InstanceIdentifier.builder(SubjectFeatureDefinitions.class)
230             .child(ClassifierDefinition.class, new ClassifierDefinitionKey(classifierDefinitionId))
231             .build();
232     }
233
234     public static InstanceIdentifier<ActionDefinition> actionDefinitionIid(ActionDefinitionId actionDefinitionId) {
235         return InstanceIdentifier.builder(SubjectFeatureDefinitions.class)
236             .child(ActionDefinition.class, new ActionDefinitionKey(actionDefinitionId))
237             .build();
238     }
239
240     public static InstanceIdentifier<ClassifierRef> classifierRefIid(TenantId tenantId, ContractId contractId,
241             SubjectName subjectName, RuleName ruleName, ClassifierName classifierRefName) {
242         return InstanceIdentifier.builder(Tenants.class)
243             .child(Tenant.class, new TenantKey(tenantId))
244             .child(Policy.class)
245             .child(Contract.class, new ContractKey(contractId))
246             .child(Subject.class, new SubjectKey(subjectName))
247             .child(Rule.class, new RuleKey(ruleName))
248             .child(ClassifierRef.class, new ClassifierRefKey(classifierRefName))
249             .build();
250     }
251
252     @Deprecated
253     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain> l2FloodDomainIid(TenantId tenantId,
254             L2FloodDomainId l2FloodDomainId) {
255         return InstanceIdentifier.builder(Tenants.class)
256             .child(Tenant.class, new TenantKey(tenantId))
257             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
258             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain.class, new L2FloodDomainKey(l2FloodDomainId))
259             .build();
260     }
261
262     @Deprecated
263     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain> l2BridgeDomainIid(TenantId tenantId,
264             L2BridgeDomainId l2BridgeDomainId) {
265         return InstanceIdentifier.builder(Tenants.class)
266             .child(Tenant.class, new TenantKey(tenantId))
267             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
268             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain.class, new L2BridgeDomainKey(l2BridgeDomainId))
269             .build();
270     }
271
272     @Deprecated
273     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context> l3ContextIid(TenantId tenantId, L3ContextId l3ContextId) {
274         return InstanceIdentifier.builder(Tenants.class)
275             .child(Tenant.class, new TenantKey(tenantId))
276             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
277             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context.class, new L3ContextKey(l3ContextId))
278             .build();
279     }
280
281     @Deprecated
282     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet> subnetIid(
283             TenantId tenantId, SubnetId subnetId) {
284         return InstanceIdentifier.builder(Tenants.class)
285             .child(Tenant.class, new TenantKey(tenantId))
286             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
287             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet.class,
288                     new SubnetKey(subnetId))
289             .build();
290     }
291
292     @Deprecated
293     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet> subnetWildcardIid(
294             TenantId tenantId) {
295         return InstanceIdentifier.builder(Tenants.class)
296             .child(Tenant.class, new TenantKey(tenantId))
297             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
298             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet.class)
299             .build();
300     }
301
302     /**
303      * Get the {@link Endpoint} {@link InstanceIdentifier} based on the {@link EndpointKey}
304      *
305      * @param endpointKey The {@link EndpointKey} of a particular {@link Endpoint}
306      * @return The {@link InstanceIdentifier} of the {@link Endpoint}
307      */
308     public static InstanceIdentifier<Endpoint> endpointIid(EndpointKey endpointKey) {
309         return InstanceIdentifier.builder(Endpoints.class).child(Endpoint.class, endpointKey).build();
310     }
311
312     public static InstanceIdentifier<Endpoint> endpointIid(L2BridgeDomainId l2Context, MacAddress macAddress) {
313         return IidFactory.endpointIid(new EndpointKey(l2Context, macAddress));
314     }
315
316     public static InstanceIdentifier<EndpointL3> l3EndpointIid(EndpointL3Key endpointL3Key) {
317         return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class, endpointL3Key).build();
318     }
319
320     public static InstanceIdentifier<EndpointL3> l3EndpointIid(L3ContextId l3Context, IpAddress ipAddress) {
321         return IidFactory.l3EndpointIid(new EndpointL3Key(ipAddress, l3Context));
322     }
323
324     public static InstanceIdentifier<EndpointL3> l3EndpointsIidWildcard() {
325         return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class).build();
326     }
327
328     public static InstanceIdentifier<EndpointL3Prefix> endpointL3PrefixIid(L3ContextId l3Context, IpPrefix ipPrefix) {
329         return InstanceIdentifier.builder(Endpoints.class)
330             .child(EndpointL3Prefix.class, new EndpointL3PrefixKey(ipPrefix, l3Context))
331             .build();
332     }
333
334     public static InstanceIdentifier<Endpoints> endpointsIidWildcard() {
335         return ENDPOINTS_IID;
336     }
337
338     public static InstanceIdentifier<FollowedEndpointGroup> followedEndpointgroupIid(RendererName rendererName,
339             TenantId tenantId, EndpointGroupId epgId) {
340         return InstanceIdentifier.builder(Renderers.class)
341             .child(Renderer.class, new RendererKey(rendererName))
342             .child(Interests.class)
343             .child(FollowedTenants.class)
344             .child(FollowedTenant.class, new FollowedTenantKey(tenantId))
345             .child(FollowedEndpointGroup.class, new FollowedEndpointGroupKey(epgId))
346             .build();
347     }
348
349     public static InstanceIdentifier<SupportedActionDefinition> supportedActionDefinitionIidWildcard() {
350         return InstanceIdentifier.builder(Renderers.class)
351             .child(Renderer.class)
352             .child(Capabilities.class)
353             .child(SupportedActionDefinition.class)
354             .build();
355     }
356
357     public static InstanceIdentifier<SupportedClassifierDefinition> supportedClassifierDefinitionIidWildcard() {
358         return InstanceIdentifier.builder(Renderers.class)
359             .child(Renderer.class)
360             .child(Capabilities.class)
361             .child(SupportedClassifierDefinition.class)
362             .build();
363     }
364
365     public static InstanceIdentifier<StatisticRecord> statisticRecordIid(StatisticRecordKey key) {
366         return InstanceIdentifier.builder(StatisticsStore.class).child(StatisticRecord.class, key).build();
367     }
368
369     public static InstanceIdentifier<FollowedTenant> followedTenantIid(RendererName rendererName, TenantId tenantId) {
370         return InstanceIdentifier.builder(Renderers.class)
371             .child(Renderer.class, new RendererKey(rendererName))
372             .child(Interests.class)
373             .child(FollowedTenants.class)
374             .child(FollowedTenant.class, new FollowedTenantKey(tenantId))
375             .build();
376     }
377
378     public static InstanceIdentifier<Renderer> rendererIid(RendererName rendererName) {
379         return InstanceIdentifier.builder(Renderers.class).child(Renderer.class, new RendererKey(rendererName)).build();
380     }
381
382     public static InstanceIdentifier<Renderers> renderersIid() {
383         return InstanceIdentifier.builder(Renderers.class).build();
384     }
385
386     public static InstanceIdentifier<ExternalImplicitGroup> externalImplicitGroupIid(TenantId tenantId,
387             EndpointGroupId epgId) {
388         return InstanceIdentifier.builder(Tenants.class)
389             .child(Tenant.class, new TenantKey(tenantId))
390             .child(Policy.class)
391             .child(ExternalImplicitGroup.class, new ExternalImplicitGroupKey(epgId))
392             .build();
393     }
394
395     public static InstanceIdentifier<ContainmentEndpoint> containmentEndpointIid(ContainmentEndpointKey key) {
396         return InstanceIdentifier
397             .builder(
398                     org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class)
399             .child(ContainmentEndpoints.class)
400             .child(ContainmentEndpoint.class, key)
401             .build();
402     }
403
404     public static InstanceIdentifier<AddressEndpoint> addressEndpointIid(AddressEndpointKey addressEndpointKey) {
405         return InstanceIdentifier
406             .builder(
407                     org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class)
408             .child(AddressEndpoints.class)
409             .child(AddressEndpoint.class, addressEndpointKey)
410             .build();
411     }
412
413     public static InstanceIdentifier<AddressEndpointLocation> addressEndpointLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) {
414         return InstanceIdentifier.builder(EndpointLocations.class)
415                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
416                 .build();
417     }
418
419     public static InstanceIdentifier<ContainmentEndpointLocation> containmentEndpointLocationIid(ContainmentEndpointLocationKey addrEndpointLocationKey) {
420         return InstanceIdentifier.builder(EndpointLocations.class)
421                 .child(ContainmentEndpointLocation.class, addrEndpointLocationKey)
422                 .build();
423     }
424
425     public static InstanceIdentifier<InternalLocation> internalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey,
426             InternalLocationKey internalLocationKey) {
427         return InstanceIdentifier.builder(EndpointLocations.class)
428                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
429                 .child(RelativeLocations.class)
430                 .child(InternalLocation.class, internalLocationKey)
431                 .build();
432     }
433
434     public static InstanceIdentifier<InternalLocation> internalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey,
435             InternalLocationKey internalLocationKey) {
436         return InstanceIdentifier.builder(EndpointLocations.class)
437                 .child(ContainmentEndpointLocation.class, contEndpointLocationKey)
438                 .child(RelativeLocations.class)
439                 .child(InternalLocation.class, internalLocationKey)
440                 .build();
441     }
442
443     public static InstanceIdentifier<ExternalLocation> externalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey,
444             ExternalLocationKey externalLocationKey) {
445         return InstanceIdentifier.builder(EndpointLocations.class)
446                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
447                 .child(RelativeLocations.class)
448                 .child(ExternalLocation.class, externalLocationKey)
449                 .build();
450     }
451
452     public static InstanceIdentifier<ExternalLocation> externalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey,
453             ExternalLocationKey externalLocationKey) {
454         return InstanceIdentifier.builder(EndpointLocations.class)
455                 .child(ContainmentEndpointLocation.class, contEndpointLocationKey)
456                 .child(RelativeLocations.class)
457                 .child(ExternalLocation.class, externalLocationKey)
458                 .build();
459     }
460
461     public static InstanceIdentifier<AbsoluteLocation> absoluteLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) {
462         return InstanceIdentifier.builder(EndpointLocations.class)
463                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
464                 .child(AbsoluteLocation.class)
465                 .build();
466     }
467
468     public static InstanceIdentifier<ProviderAddressEndpointLocation> providerAddressEndpointLocationIid(String provider,
469             Class<? extends AddressType> addrType, String addr, Class<? extends ContextType> cType,
470             ContextId containment) {
471         return InstanceIdentifier.builder(LocationProviders.class)
472                 .child(LocationProvider.class, new LocationProviderKey(new ProviderName(provider)))
473             .child(ProviderAddressEndpointLocation.class, new ProviderAddressEndpointLocationKey(addr, addrType, containment, cType))
474             .build();
475     }
476
477     public static InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid(TenantId tenantId) {
478         return forwardingByTenantIid(new ForwardingByTenantKey(tenantId));
479     }
480
481     public static InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid(
482             ForwardingByTenantKey forwardingByTenantKey) {
483         return InstanceIdentifier.builder(Forwarding.class)
484             .child(ForwardingByTenant.class, forwardingByTenantKey)
485             .build();
486     }
487 }