2 * Copyright (c) 2015 Inocybe Technologies and others. All rights reserved.
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
9 package org.opendaylight.groupbasedpolicy.renderer.iovisor.utils;
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.opendaylight.groupbasedpolicy.common.rev140421.EndpointGroupId;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.L3ContextId;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.TenantId;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.IovisorModuleInstances;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.IovisorModulesByTenantByEndpointgroupId;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.IovisorResolvedEndpoints;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.IovisorResolvedEndpointsByTenantByEndpointgroupId;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.module.instances.IovisorModuleInstance;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.module.instances.IovisorModuleInstanceKey;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.modules.by.tenant.by.endpointgroup.id.IovisorModuleByTenantByEndpointgroupId;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.modules.by.tenant.by.endpointgroup.id.IovisorModuleByTenantByEndpointgroupIdKey;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.resolved.endpoints.IovisorResolvedEndpoint;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.resolved.endpoints.IovisorResolvedEndpointKey;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.resolved.endpoints.by.tenant.by.endpointgroup.id.IovisorResolvedEndpointByTenantByEndpointgroupId;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.iovisor.rev151030.iovisor.resolved.endpoints.by.tenant.by.endpointgroup.id.IovisorResolvedEndpointByTenantByEndpointgroupIdKey;
27 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
29 public class IovisorIidFactory {
31 private IovisorIidFactory() {}
33 private static final InstanceIdentifier<IovisorModuleInstances> IOVISOR_MODULE_INSTANCES_IID =
34 InstanceIdentifier.builder(IovisorModuleInstances.class).build();
37 * @return The {@link InstanceIdentifier} of the {@link IovisorModuleInstances}
39 public static InstanceIdentifier<IovisorModuleInstances> iovisorModuleInstanceWildCardIid() {
40 return IOVISOR_MODULE_INSTANCES_IID;
44 * Return the InstanceIdentifier for a specific IovisorModuleInstance.
46 * @param iovisorModuleInstanceKey The key of the {@link IovisorModuleInstance} we want to
48 * @return The {@link InstanceIdentifier} of the {@link IovisorModuleInstance}
50 public static InstanceIdentifier<IovisorModuleInstance> iovisorModuleInstanceIid(
51 IovisorModuleInstanceKey iovisorModuleInstanceKey) {
52 return IOVISOR_MODULE_INSTANCES_IID.child(IovisorModuleInstance.class, iovisorModuleInstanceKey);
55 public static InstanceIdentifier<IovisorResolvedEndpoints> iovisorResolvedEndpointWildcardIid() {
56 return InstanceIdentifier.builder(IovisorResolvedEndpoints.class).build();
59 public static InstanceIdentifier<IovisorResolvedEndpoint> iovisorResolvedEndpointIid(L3ContextId l3Context,
60 IpAddress ipAddress) {
61 return iovisorResolvedEndpointIid(new IovisorResolvedEndpointKey(ipAddress, l3Context));
64 public static InstanceIdentifier<IovisorResolvedEndpoint> iovisorResolvedEndpointIid(
65 IovisorResolvedEndpointKey iovisorResolvedEndpointKey) {
66 return InstanceIdentifier.builder(IovisorResolvedEndpoints.class)
67 .child(IovisorResolvedEndpoint.class, iovisorResolvedEndpointKey)
71 public static InstanceIdentifier<IovisorResolvedEndpointsByTenantByEndpointgroupId> iovisorResolvedEndpointsByTenantIdByEndpointGroupIdWildCardIid() {
72 return InstanceIdentifier.builder(IovisorResolvedEndpointsByTenantByEndpointgroupId.class).build();
75 public static InstanceIdentifier<IovisorResolvedEndpointByTenantByEndpointgroupId> iovisorResolvedEndpointByTenantIdByEndpointGroupIdIid(
76 TenantId tenantId, EndpointGroupId epgId) {
77 return iovisorResolvedEndpointByTenantIdByEndpointGroupIdIid(
78 new IovisorResolvedEndpointByTenantByEndpointgroupIdKey(epgId, tenantId));
81 public static InstanceIdentifier<IovisorResolvedEndpointByTenantByEndpointgroupId> iovisorResolvedEndpointByTenantIdByEndpointGroupIdIid(
82 IovisorResolvedEndpointByTenantByEndpointgroupIdKey key) {
83 return InstanceIdentifier.builder(IovisorResolvedEndpointsByTenantByEndpointgroupId.class)
84 .child(IovisorResolvedEndpointByTenantByEndpointgroupId.class, key)
88 public static InstanceIdentifier<IovisorModulesByTenantByEndpointgroupId> iovisorModulesByTenantIdByEndpointGroupIdWildCardIid() {
89 return InstanceIdentifier.builder(IovisorModulesByTenantByEndpointgroupId.class).build();
92 public static InstanceIdentifier<IovisorModuleByTenantByEndpointgroupId> iovisorModuleByTenantIdByEndpointGroupIdIid(
93 TenantId tenantId, EndpointGroupId epgId) {
94 return iovisorModuleByTenantIdByEndpointGroupIdIid(
95 new IovisorModuleByTenantByEndpointgroupIdKey(epgId, tenantId));
98 public static InstanceIdentifier<IovisorModuleByTenantByEndpointgroupId> iovisorModuleByTenantIdByEndpointGroupIdIid(
99 IovisorModuleByTenantByEndpointgroupIdKey key) {
100 return InstanceIdentifier.builder(IovisorModulesByTenantByEndpointgroupId.class)
101 .child(IovisorModuleByTenantByEndpointgroupId.class, key)