Merge "Bug 3618: Tenant.OPER not removed when Tenant.CONF removed"
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / java / org / opendaylight / groupbasedpolicy / renderer / ofoverlay / sfcutils / SfcIidFactory.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.renderer.ofoverlay.sfcutils;
10
11 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.RenderedServicePaths;
12 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePath;
13 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.rsp.rev140701.rendered.service.paths.RenderedServicePathKey;
14 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.ServiceFunctionChains;
15 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChain;
16 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChainKey;
17 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.ServiceFunctionPaths;
18 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.ServiceFunctionPath;
19 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.ServiceFunctionPathKey;
20 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
21
22 public class SfcIidFactory {
23
24     private SfcIidFactory() {
25         throw new UnsupportedOperationException();
26     }
27
28     public static InstanceIdentifier<ServiceFunctionChain> sfcIid(String sfcName) {
29
30         ServiceFunctionChainKey serviceFunctionChainKey =
31                 new ServiceFunctionChainKey(sfcName);
32         return InstanceIdentifier.builder(ServiceFunctionChains.class)
33                 .child(ServiceFunctionChain.class, serviceFunctionChainKey).build();
34     }
35
36     public static InstanceIdentifier<ServiceFunctionPath> sfpIid(String sfpName) {
37
38         ServiceFunctionPathKey serviceFunctionPathKey = new ServiceFunctionPathKey(sfpName);
39         return InstanceIdentifier.builder(ServiceFunctionPaths.class)
40                 .child(ServiceFunctionPath.class, serviceFunctionPathKey).build();
41     }
42
43     public static InstanceIdentifier<RenderedServicePath> rspIid(String rspName) {
44
45         RenderedServicePathKey rspKey = new RenderedServicePathKey(rspName);
46         return InstanceIdentifier.builder(RenderedServicePaths.class)
47                 .child(RenderedServicePath.class, rspKey).build();
48     }
49 }