Merge "ACL: Updated to cache interface/interface state details"
[netvirt.git] / openstack / sfc-translator / impl / src / main / java / org / opendaylight / netvirt / openstack / sfc / translator / portchain / PortPairGroupTranslator.java
1 /*
2  * Copyright (c) 2016 Brocade Communications 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 package org.opendaylight.netvirt.openstack.sfc.translator.portchain;
9
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
11 import org.opendaylight.netvirt.openstack.sfc.translator.INeutronSfcDataProcessor;
12 import org.opendaylight.netvirt.openstack.sfc.translator.NeutronMdsalHelper;
13 import org.opendaylight.netvirt.openstack.sfc.translator.SfcMdsalHelper;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pair.groups.PortPairGroup;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18
19 /**
20  * Class will convert OpenStack Port Pair API yang models present in
21  * neutron northbound project to OpenDaylight SFC yang models.
22  */
23 public class PortPairGroupTranslator implements INeutronSfcDataProcessor<PortPairGroup> {
24     private static final Logger LOG = LoggerFactory.getLogger(PortPairGroupTranslator.class);
25
26     private final DataBroker db;
27     private NeutronPortPairGroupListener neutronPortPairGroupListener;
28     private final SfcMdsalHelper sfcMdsalHelper;
29     private final NeutronMdsalHelper neutronMdsalHelper;
30
31     public PortPairGroupTranslator(DataBroker db) {
32         this.db = db;
33         sfcMdsalHelper = new SfcMdsalHelper(db);
34         neutronMdsalHelper = new NeutronMdsalHelper(db);
35     }
36
37     public void start() {
38         LOG.info("Port Pair Group Translator Initialized.");
39         if(neutronPortPairGroupListener == null) {
40             neutronPortPairGroupListener = new NeutronPortPairGroupListener(db, this);
41         }
42     }
43
44     /**
45      * Method removes PortPairGroup which is identified by InstanceIdentifier.
46      *
47      * @param path - the whole path to PortPairGroup
48      * @param deletedPortPairGroup        - PortPairGroup for removing
49      */
50     @Override
51     public void remove(InstanceIdentifier<PortPairGroup> path, PortPairGroup deletedPortPairGroup) {
52
53     }
54
55     /**
56      * Method updates the original PortPairGroup to the update PortPairGroup.
57      * Both are identified by same InstanceIdentifier.
58      *
59      * @param path - the whole path to PortPairGroup
60      * @param originalPortPairGroup   - original PortPairGroup (for update)
61      * @param updatePortPairGroup     - changed PortPairGroup (contain updates)
62      */
63     @Override
64     public void update(InstanceIdentifier<PortPairGroup> path,
65                        PortPairGroup originalPortPairGroup,
66                        PortPairGroup updatePortPairGroup) {
67
68     }
69
70     /**
71      * Method adds the PortPairGroup which is identified by InstanceIdentifier
72      * to device.
73      *
74      * @param path - the whole path to new PortPairGroup
75      * @param newPortPairGroup        - new PortPairGroup
76      */
77     @Override
78     public void add(InstanceIdentifier<PortPairGroup> path, PortPairGroup newPortPairGroup) {
79
80     }
81 }