1 package org.opendaylight.groupbasedpolicy.neutron.mapper.mapping;
3 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.common.rev140421.UniqueId;
4 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.endpoints.EndpointKey;
5 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.floating.ip.ports.EndpointByFloatingIpPort;
6 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.floating.ip.ports.EndpointByFloatingIpPortBuilder;
7 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.ports.EndpointByPort;
8 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.ports.EndpointByPortBuilder;
9 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.router._interface.ports.EndpointByRouterInterfacePort;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.router._interface.ports.EndpointByRouterInterfacePortBuilder;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.router.gateway.ports.EndpointByRouterGatewayPort;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.gbp.by.neutron.mappings.endpoints.by.router.gateway.ports.EndpointByRouterGatewayPortBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.floating.ip.ports.by.endpoints.FloatingIpPortByEndpoint;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.floating.ip.ports.by.endpoints.FloatingIpPortByEndpointBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.ports.by.endpoints.PortByEndpoint;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.ports.by.endpoints.PortByEndpointBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.router._interface.ports.by.endpoints.RouterInterfacePortByEndpoint;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.router._interface.ports.by.endpoints.RouterInterfacePortByEndpointBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.router.gateway.ports.by.endpoints.RouterGatewayPortByEndpoint;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.neutron.gbp.mapper.rev150513.mappings.neutron.by.gbp.mappings.router.gateway.ports.by.endpoints.RouterGatewayPortByEndpointBuilder;
22 public class MappingFactory {
24 private MappingFactory() {
25 throw new UnsupportedOperationException("cannot create an instance");
28 public static EndpointByPort createEndpointByPort(EndpointKey epKey, UniqueId portId) {
29 return new EndpointByPortBuilder().setPortId(portId)
30 .setL2Context(epKey.getL2Context())
31 .setMacAddress(epKey.getMacAddress())
35 public static PortByEndpoint createPortByEndpoint(UniqueId portId, EndpointKey epKey) {
36 return new PortByEndpointBuilder().setPortId(portId)
37 .setL2Context(epKey.getL2Context())
38 .setMacAddress(epKey.getMacAddress())
42 public static EndpointByRouterGatewayPort createEndpointByRouterGatewayPort(EndpointKey epKey, UniqueId portId) {
43 return new EndpointByRouterGatewayPortBuilder().setPortId(portId)
44 .setL2Context(epKey.getL2Context())
45 .setMacAddress(epKey.getMacAddress())
49 public static RouterGatewayPortByEndpoint createRouterGatewayPortByEndpoint(UniqueId portId, EndpointKey epKey) {
50 return new RouterGatewayPortByEndpointBuilder().setPortId(portId)
51 .setL2Context(epKey.getL2Context())
52 .setMacAddress(epKey.getMacAddress())
56 public static EndpointByRouterInterfacePort createEndpointByRouterInterfacePort(EndpointKey epKey, UniqueId portId) {
57 return new EndpointByRouterInterfacePortBuilder().setPortId(portId)
58 .setL2Context(epKey.getL2Context())
59 .setMacAddress(epKey.getMacAddress())
63 public static RouterInterfacePortByEndpoint createRouterInterfacePortByEndpoint(UniqueId portId, EndpointKey epKey) {
64 return new RouterInterfacePortByEndpointBuilder().setPortId(portId)
65 .setL2Context(epKey.getL2Context())
66 .setMacAddress(epKey.getMacAddress())
70 public static EndpointByFloatingIpPort createEndpointByFloatingIpPort(EndpointKey epKey, UniqueId portId) {
71 return new EndpointByFloatingIpPortBuilder().setPortId(portId)
72 .setL2Context(epKey.getL2Context())
73 .setMacAddress(epKey.getMacAddress())
77 public static FloatingIpPortByEndpoint createFloatingIpPortByEndpoint(UniqueId portId, EndpointKey epKey) {
78 return new FloatingIpPortByEndpointBuilder().setPortId(portId)
79 .setL2Context(epKey.getL2Context())
80 .setMacAddress(epKey.getMacAddress())