5c7cf1deed397143bcdb9c19719a2b71db87cb23
[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.rev130715.IpAddress;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.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
119 public class IidFactory {
120
121     private IidFactory() {
122         throw new UnsupportedOperationException();
123     }
124
125     private static final InstanceIdentifier<Endpoints> ENDPOINTS_IID =
126             InstanceIdentifier.builder(Endpoints.class).build();
127
128     public static InstanceIdentifier<Tenant> tenantIid(TenantId id) {
129         return InstanceIdentifier.builder(Tenants.class).child(Tenant.class, new TenantKey(id)).build();
130     }
131
132     public static InstanceIdentifier<EndpointGroup> endpointGroupIid(TenantId tenantId, EndpointGroupId epgId) {
133         return InstanceIdentifier.builder(Tenants.class)
134             .child(Tenant.class, new TenantKey(tenantId))
135             .child(Policy.class)
136             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
137             .build();
138     }
139
140     public static InstanceIdentifier<Contract> contractIid(TenantId tenantId, ContractId contractId) {
141         return InstanceIdentifier.builder(Tenants.class)
142             .child(Tenant.class, new TenantKey(tenantId))
143             .child(Policy.class)
144             .child(Contract.class, new ContractKey(contractId))
145             .build();
146     }
147
148     public static InstanceIdentifier<Contract> contractWildcardIid(TenantId tenantId) {
149         return InstanceIdentifier.builder(Tenants.class)
150             .child(Tenant.class, new TenantKey(tenantId))
151             .child(Policy.class)
152             .child(Contract.class)
153             .build();
154     }
155
156     public static InstanceIdentifier<Subject> subjectIid(TenantId tenantId, ContractId contractId,
157             SubjectName subjectName) {
158         return InstanceIdentifier.builder(Tenants.class)
159             .child(Tenant.class, new TenantKey(tenantId))
160             .child(Policy.class)
161             .child(Contract.class, new ContractKey(contractId))
162             .child(Subject.class, new SubjectKey(subjectName))
163             .build();
164     }
165
166     public static InstanceIdentifier<ProviderNamedSelector> providerNamedSelectorIid(TenantId tenantId,
167             EndpointGroupId epgId, SelectorName providerSelectorName) {
168         return InstanceIdentifier.builder(Tenants.class)
169             .child(Tenant.class, new TenantKey(tenantId))
170             .child(Policy.class)
171             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
172             .child(ProviderNamedSelector.class, new ProviderNamedSelectorKey(providerSelectorName))
173             .build();
174     }
175
176     public static InstanceIdentifier<ConsumerNamedSelector> consumerNamedSelectorIid(TenantId tenantId,
177             EndpointGroupId epgId, SelectorName consumerSelectorName) {
178         return InstanceIdentifier.builder(Tenants.class)
179             .child(Tenant.class, new TenantKey(tenantId))
180             .child(Policy.class)
181             .child(EndpointGroup.class, new EndpointGroupKey(epgId))
182             .child(ConsumerNamedSelector.class, new ConsumerNamedSelectorKey(consumerSelectorName))
183             .build();
184     }
185
186     public static InstanceIdentifier<Clause> clauseIid(TenantId tenantId, ContractId contractId,
187             ClauseName clauseName) {
188         return InstanceIdentifier.builder(Tenants.class)
189             .child(Tenant.class, new TenantKey(tenantId))
190             .child(Policy.class)
191             .child(Contract.class, new ContractKey(contractId))
192             .child(Clause.class, new ClauseKey(clauseName))
193             .build();
194     }
195
196     public static InstanceIdentifier<Rule> ruleIid(TenantId tenantId, ContractId contractId, SubjectName subjectName,
197             RuleName ruleName) {
198         return InstanceIdentifier.builder(Tenants.class)
199             .child(Tenant.class, new TenantKey(tenantId))
200             .child(Policy.class)
201             .child(Contract.class, new ContractKey(contractId))
202             .child(Subject.class, new SubjectKey(subjectName))
203             .child(Rule.class, new RuleKey(ruleName))
204             .build();
205     }
206
207     public static InstanceIdentifier<ActionInstance> actionInstanceIid(TenantId tenantId, ActionName actionName) {
208         return InstanceIdentifier.builder(Tenants.class)
209             .child(Tenant.class, new TenantKey(tenantId))
210             .child(Policy.class)
211             .child(SubjectFeatureInstances.class)
212             .child(ActionInstance.class, new ActionInstanceKey(actionName))
213             .build();
214     }
215
216     public static InstanceIdentifier<ClassifierInstance> classifierInstanceIid(TenantId tenantId,
217             ClassifierName classifierName) {
218         return InstanceIdentifier.builder(Tenants.class)
219             .child(Tenant.class, new TenantKey(tenantId))
220             .child(Policy.class)
221             .child(SubjectFeatureInstances.class)
222             .child(ClassifierInstance.class, new ClassifierInstanceKey(classifierName))
223             .build();
224     }
225
226     public static InstanceIdentifier<ClassifierDefinition> classifierDefinitionIid(
227             ClassifierDefinitionId classifierDefinitionId) {
228         return InstanceIdentifier.builder(SubjectFeatureDefinitions.class)
229             .child(ClassifierDefinition.class, new ClassifierDefinitionKey(classifierDefinitionId))
230             .build();
231     }
232
233     public static InstanceIdentifier<ActionDefinition> actionDefinitionIid(ActionDefinitionId actionDefinitionId) {
234         return InstanceIdentifier.builder(SubjectFeatureDefinitions.class)
235             .child(ActionDefinition.class, new ActionDefinitionKey(actionDefinitionId))
236             .build();
237     }
238
239     public static InstanceIdentifier<ClassifierRef> classifierRefIid(TenantId tenantId, ContractId contractId,
240             SubjectName subjectName, RuleName ruleName, ClassifierName classifierRefName) {
241         return InstanceIdentifier.builder(Tenants.class)
242             .child(Tenant.class, new TenantKey(tenantId))
243             .child(Policy.class)
244             .child(Contract.class, new ContractKey(contractId))
245             .child(Subject.class, new SubjectKey(subjectName))
246             .child(Rule.class, new RuleKey(ruleName))
247             .child(ClassifierRef.class, new ClassifierRefKey(classifierRefName))
248             .build();
249     }
250
251     @Deprecated
252     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain> l2FloodDomainIid(TenantId tenantId,
253             L2FloodDomainId l2FloodDomainId) {
254         return InstanceIdentifier.builder(Tenants.class)
255             .child(Tenant.class, new TenantKey(tenantId))
256             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
257             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2FloodDomain.class, new L2FloodDomainKey(l2FloodDomainId))
258             .build();
259     }
260
261     @Deprecated
262     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain> l2BridgeDomainIid(TenantId tenantId,
263             L2BridgeDomainId l2BridgeDomainId) {
264         return InstanceIdentifier.builder(Tenants.class)
265             .child(Tenant.class, new TenantKey(tenantId))
266             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
267             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L2BridgeDomain.class, new L2BridgeDomainKey(l2BridgeDomainId))
268             .build();
269     }
270
271     @Deprecated
272     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context> l3ContextIid(TenantId tenantId, L3ContextId l3ContextId) {
273         return InstanceIdentifier.builder(Tenants.class)
274             .child(Tenant.class, new TenantKey(tenantId))
275             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
276             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.L3Context.class, new L3ContextKey(l3ContextId))
277             .build();
278     }
279
280     @Deprecated
281     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet> subnetIid(
282             TenantId tenantId, SubnetId subnetId) {
283         return InstanceIdentifier.builder(Tenants.class)
284             .child(Tenant.class, new TenantKey(tenantId))
285             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
286             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet.class,
287                     new SubnetKey(subnetId))
288             .build();
289     }
290
291     @Deprecated
292     public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet> subnetWildcardIid(
293             TenantId tenantId) {
294         return InstanceIdentifier.builder(Tenants.class)
295             .child(Tenant.class, new TenantKey(tenantId))
296             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.ForwardingContext.class)
297             .child(org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.policy.rev140421.tenants.tenant.forwarding.context.Subnet.class)
298             .build();
299     }
300
301     /**
302      * Get the {@link Endpoint} {@link InstanceIdentifier} based on the {@link EndpointKey}
303      *
304      * @param endpointKey The {@link EndpointKey} of a particular {@link Endpoint}
305      * @return The {@link InstanceIdentifier} of the {@link Endpoint}
306      */
307     public static InstanceIdentifier<Endpoint> endpointIid(EndpointKey endpointKey) {
308         return InstanceIdentifier.builder(Endpoints.class).child(Endpoint.class, endpointKey).build();
309     }
310
311     public static InstanceIdentifier<Endpoint> endpointIid(L2BridgeDomainId l2Context, MacAddress macAddress) {
312         return IidFactory.endpointIid(new EndpointKey(l2Context, macAddress));
313     }
314
315     public static InstanceIdentifier<EndpointL3> l3EndpointIid(EndpointL3Key endpointL3Key) {
316         return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class, endpointL3Key).build();
317     }
318
319     public static InstanceIdentifier<EndpointL3> l3EndpointIid(L3ContextId l3Context, IpAddress ipAddress) {
320         return IidFactory.l3EndpointIid(new EndpointL3Key(ipAddress, l3Context));
321     }
322
323     public static InstanceIdentifier<EndpointL3> l3EndpointsIidWildcard() {
324         return InstanceIdentifier.builder(Endpoints.class).child(EndpointL3.class).build();
325     }
326
327     public static InstanceIdentifier<EndpointL3Prefix> endpointL3PrefixIid(L3ContextId l3Context, IpPrefix ipPrefix) {
328         return InstanceIdentifier.builder(Endpoints.class)
329             .child(EndpointL3Prefix.class, new EndpointL3PrefixKey(ipPrefix, l3Context))
330             .build();
331     }
332
333     public static InstanceIdentifier<Endpoints> endpointsIidWildcard() {
334         return ENDPOINTS_IID;
335     }
336
337     public static InstanceIdentifier<FollowedEndpointGroup> followedEndpointgroupIid(RendererName rendererName,
338             TenantId tenantId, EndpointGroupId epgId) {
339         return InstanceIdentifier.builder(Renderers.class)
340             .child(Renderer.class, new RendererKey(rendererName))
341             .child(Interests.class)
342             .child(FollowedTenants.class)
343             .child(FollowedTenant.class, new FollowedTenantKey(tenantId))
344             .child(FollowedEndpointGroup.class, new FollowedEndpointGroupKey(epgId))
345             .build();
346     }
347
348     public static InstanceIdentifier<SupportedActionDefinition> supportedActionDefinitionIidWildcard() {
349         return InstanceIdentifier.builder(Renderers.class)
350             .child(Renderer.class)
351             .child(Capabilities.class)
352             .child(SupportedActionDefinition.class)
353             .build();
354     }
355
356     public static InstanceIdentifier<SupportedClassifierDefinition> supportedClassifierDefinitionIidWildcard() {
357         return InstanceIdentifier.builder(Renderers.class)
358             .child(Renderer.class)
359             .child(Capabilities.class)
360             .child(SupportedClassifierDefinition.class)
361             .build();
362     }
363
364     public static InstanceIdentifier<StatisticRecord> statisticRecordIid(StatisticRecordKey key) {
365         return InstanceIdentifier.builder(StatisticsStore.class).child(StatisticRecord.class, key).build();
366     }
367
368     public static InstanceIdentifier<FollowedTenant> followedTenantIid(RendererName rendererName, TenantId tenantId) {
369         return InstanceIdentifier.builder(Renderers.class)
370             .child(Renderer.class, new RendererKey(rendererName))
371             .child(Interests.class)
372             .child(FollowedTenants.class)
373             .child(FollowedTenant.class, new FollowedTenantKey(tenantId))
374             .build();
375     }
376
377     public static InstanceIdentifier<Renderer> rendererIid(RendererName rendererName) {
378         return InstanceIdentifier.builder(Renderers.class).child(Renderer.class, new RendererKey(rendererName)).build();
379     }
380
381     public static InstanceIdentifier<Renderers> renderersIid() {
382         return InstanceIdentifier.builder(Renderers.class).build();
383     }
384
385     public static InstanceIdentifier<ExternalImplicitGroup> externalImplicitGroupIid(TenantId tenantId,
386             EndpointGroupId epgId) {
387         return InstanceIdentifier.builder(Tenants.class)
388             .child(Tenant.class, new TenantKey(tenantId))
389             .child(Policy.class)
390             .child(ExternalImplicitGroup.class, new ExternalImplicitGroupKey(epgId))
391             .build();
392     }
393
394     public static InstanceIdentifier<ContainmentEndpoint> containmentEndpointIid(ContainmentEndpointKey key) {
395         return InstanceIdentifier
396             .builder(
397                     org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class)
398             .child(ContainmentEndpoints.class)
399             .child(ContainmentEndpoint.class, key)
400             .build();
401     }
402
403     public static InstanceIdentifier<AddressEndpoint> addressEndpointIid(AddressEndpointKey addressEndpointKey) {
404         return InstanceIdentifier
405             .builder(
406                     org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.base_endpoint.rev160427.Endpoints.class)
407             .child(AddressEndpoints.class)
408             .child(AddressEndpoint.class, addressEndpointKey)
409             .build();
410     }
411
412     public static InstanceIdentifier<AddressEndpointLocation> addressEndpointLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) {
413         return InstanceIdentifier.builder(EndpointLocations.class)
414                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
415                 .build();
416     }
417
418     public static InstanceIdentifier<ContainmentEndpointLocation> containmentEndpointLocationIid(ContainmentEndpointLocationKey addrEndpointLocationKey) {
419         return InstanceIdentifier.builder(EndpointLocations.class)
420                 .child(ContainmentEndpointLocation.class, addrEndpointLocationKey)
421                 .build();
422     }
423
424     public static InstanceIdentifier<InternalLocation> internalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey,
425             InternalLocationKey internalLocationKey) {
426         return InstanceIdentifier.builder(EndpointLocations.class)
427                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
428                 .child(RelativeLocations.class)
429                 .child(InternalLocation.class, internalLocationKey)
430                 .build();
431     }
432
433     public static InstanceIdentifier<InternalLocation> internalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey,
434             InternalLocationKey internalLocationKey) {
435         return InstanceIdentifier.builder(EndpointLocations.class)
436                 .child(ContainmentEndpointLocation.class, contEndpointLocationKey)
437                 .child(RelativeLocations.class)
438                 .child(InternalLocation.class, internalLocationKey)
439                 .build();
440     }
441
442     public static InstanceIdentifier<ExternalLocation> externalLocationIid(AddressEndpointLocationKey addrEndpointLocationKey,
443             ExternalLocationKey externalLocationKey) {
444         return InstanceIdentifier.builder(EndpointLocations.class)
445                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
446                 .child(RelativeLocations.class)
447                 .child(ExternalLocation.class, externalLocationKey)
448                 .build();
449     }
450
451     public static InstanceIdentifier<ExternalLocation> externalLocationIid(ContainmentEndpointLocationKey contEndpointLocationKey,
452             ExternalLocationKey externalLocationKey) {
453         return InstanceIdentifier.builder(EndpointLocations.class)
454                 .child(ContainmentEndpointLocation.class, contEndpointLocationKey)
455                 .child(RelativeLocations.class)
456                 .child(ExternalLocation.class, externalLocationKey)
457                 .build();
458     }
459
460     public static InstanceIdentifier<AbsoluteLocation> absoluteLocationIid(AddressEndpointLocationKey addrEndpointLocationKey) {
461         return InstanceIdentifier.builder(EndpointLocations.class)
462                 .child(AddressEndpointLocation.class, addrEndpointLocationKey)
463                 .child(AbsoluteLocation.class)
464                 .build();
465     }
466
467     public static InstanceIdentifier<ProviderAddressEndpointLocation> providerAddressEndpointLocationIid(
468             String provider, Class<? extends AddressType> addrType, String addr, Class<? extends ContextType> cType,
469             ContextId containment) {
470         return providerAddressEndpointLocationIid(new ProviderName(provider),
471                 new ProviderAddressEndpointLocationKey(addr, addrType, containment, cType));
472     }
473
474     public static InstanceIdentifier<ProviderAddressEndpointLocation> providerAddressEndpointLocationIid(
475             ProviderName provider, ProviderAddressEndpointLocationKey providerAddressEndpointLocationKey) {
476         return locationProviderIid(provider).child(ProviderAddressEndpointLocation.class,
477                 providerAddressEndpointLocationKey);
478     }
479
480     public static InstanceIdentifier<LocationProvider> locationProviderIid(ProviderName provider) {
481         return InstanceIdentifier.builder(LocationProviders.class)
482             .child(LocationProvider.class, new LocationProviderKey(provider))
483             .build();
484     }
485
486     public static InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid(TenantId tenantId) {
487         return forwardingByTenantIid(new ForwardingByTenantKey(tenantId));
488     }
489
490     public static InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid(
491             ForwardingByTenantKey forwardingByTenantKey) {
492         return InstanceIdentifier.builder(Forwarding.class)
493             .child(ForwardingByTenant.class, forwardingByTenantKey)
494             .build();
495     }
496 }