Merge "Fix NPE caused by ElanServiceProvider"
[netvirt.git] / openstack / sfc-translator / impl / src / main / java / org / opendaylight / netvirt / openstack / sfc / translator / portchain / NeutronPortPairGroupListener.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.controller.md.sal.binding.api.DataTreeIdentifier;
12 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
13 import org.opendaylight.netvirt.openstack.sfc.translator.DelegatingDataTreeListener;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.PortPairGroups;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.sfc.rev160511.sfc.attributes.port.pair.groups.PortPairGroup;
17 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
18
19 /**
20  * OpenDaylight Neutron Port Pair Group yang models data change listener
21  */
22 public class NeutronPortPairGroupListener extends DelegatingDataTreeListener<PortPairGroup> {
23     private static final InstanceIdentifier<PortPairGroup> portPairGroupIid =
24             InstanceIdentifier.create(Neutron.class).child(PortPairGroups.class).child(PortPairGroup.class);
25
26     public NeutronPortPairGroupListener(DataBroker db) {
27         super(db,new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, portPairGroupIid));
28     }
29
30     /**
31      * Method removes PortPairGroup which is identified by InstanceIdentifier.
32      *
33      * @param path - the whole path to PortPairGroup
34      * @param deletedPortPairGroup        - PortPairGroup for removing
35      */
36     @Override
37     public void remove(InstanceIdentifier<PortPairGroup> path, 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 path - the whole path to PortPairGroup
46      * @param originalPortPairGroup   - original PortPairGroup (for update)
47      * @param updatePortPairGroup     - changed PortPairGroup (contain updates)
48      */
49     @Override
50     public void update(InstanceIdentifier<PortPairGroup> path,
51                        PortPairGroup originalPortPairGroup,
52                        PortPairGroup updatePortPairGroup) {
53         //NO-OP
54     }
55
56     /**
57      * Method adds the PortPairGroup which is identified by InstanceIdentifier
58      * to device.
59      *
60      * @param path - the whole path to new PortPairGroup
61      * @param newPortPairGroup        - new PortPairGroup
62      */
63     @Override
64     public void add(InstanceIdentifier<PortPairGroup> path, PortPairGroup newPortPairGroup) {
65         //NO-OP
66     }
67 }