6af1d94928407d363c6787ccea29f1c940b8a399
[netvirt.git] / sfc / translator / src / main / java / org / opendaylight / netvirt / sfc / translator / portchain / NeutronPortPairGroupListener.java
1 /*
2  * Copyright (c) 2016, 2017 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
9 package org.opendaylight.netvirt.sfc.translator.portchain;
10
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
13 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
14 import org.opendaylight.netvirt.sfc.translator.DelegatingDataTreeListener;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.PortPairGroups;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pair.groups.PortPairGroup;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19
20 /**
21  * OpenDaylight Neutron Port Pair Group yang models data change listener.
22  */
23 public class NeutronPortPairGroupListener extends DelegatingDataTreeListener<PortPairGroup> {
24     private static final InstanceIdentifier<PortPairGroup> PORT_PAIR_GROUP_IID =
25             InstanceIdentifier.create(Neutron.class).child(PortPairGroups.class).child(PortPairGroup.class);
26
27     public NeutronPortPairGroupListener(DataBroker db) {
28         super(db,new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, PORT_PAIR_GROUP_IID));
29     }
30
31     /**
32      * Method removes PortPairGroup which is identified by InstanceIdentifier.
33      *
34      * @param deletedPortPairGroup        - PortPairGroup for removing
35      */
36     @Override
37     public void remove(PortPairGroup deletedPortPairGroup) {
38         //NO-OP
39     }
40
41     /**
42      * Method updates the original PortPairGroup to the update PortPairGroup.
43      * Both are identified by same InstanceIdentifier.
44      *
45      * @param origPortPairGroup       - original PortPairGroup
46      * @param updatePortPairGroup     - changed PortPairGroup (contain updates)
47      */
48     @Override
49     public void update(PortPairGroup origPortPairGroup, PortPairGroup updatePortPairGroup) {
50         //NO-OP
51     }
52
53     /**
54      * Method adds the PortPairGroup which is identified by InstanceIdentifier
55      * to device.
56      *
57      * @param newPortPairGroup        - new PortPairGroup
58      */
59     @Override
60     public void add(PortPairGroup newPortPairGroup) {
61         //NO-OP
62     }
63 }