Implement SFC integration
[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.sfc.rev140701.ServiceFunctionChains;
12 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChain;
13 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfc.rev140701.service.function.chain.grouping.ServiceFunctionChainKey;
14 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.ServiceFunctionPaths;
15 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.ServiceFunctionPath;
16 import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sfp.rev140701.service.function.paths.ServiceFunctionPathKey;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18
19 public class SfcIidFactory {
20
21     private SfcIidFactory() {
22         throw new UnsupportedOperationException();
23     }
24
25     public static InstanceIdentifier<ServiceFunctionChain> sfcIid(String sfcName) {
26
27         ServiceFunctionChainKey serviceFunctionChainKey =
28                 new ServiceFunctionChainKey(sfcName);
29         return InstanceIdentifier.builder(ServiceFunctionChains.class)
30                 .child(ServiceFunctionChain.class, serviceFunctionChainKey).build();
31     }
32
33     public static InstanceIdentifier<ServiceFunctionPath> sfpIid(String sfpName) {
34
35         ServiceFunctionPathKey serviceFunctionPathKey = new ServiceFunctionPathKey(sfpName);
36         return InstanceIdentifier.builder(ServiceFunctionPaths.class)
37                 .child(ServiceFunctionPath.class, serviceFunctionPathKey).build();
38
39     }
40 }