2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netvirt.openstack.sfc.translator.portchain;
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;
20 * OpenDaylight Neutron Port Pair Group yang models data change listener
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);
26 public NeutronPortPairGroupListener(DataBroker db) {
27 super(db,new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, portPairGroupIid));
31 * Method removes PortPairGroup which is identified by InstanceIdentifier.
33 * @param path - the whole path to PortPairGroup
34 * @param deletedPortPairGroup - PortPairGroup for removing
37 public void remove(InstanceIdentifier<PortPairGroup> path, PortPairGroup deletedPortPairGroup) {
42 * Method updates the original PortPairGroup to the update PortPairGroup.
43 * Both are identified by same InstanceIdentifier.
45 * @param path - the whole path to PortPairGroup
46 * @param originalPortPairGroup - original PortPairGroup (for update)
47 * @param updatePortPairGroup - changed PortPairGroup (contain updates)
50 public void update(InstanceIdentifier<PortPairGroup> path,
51 PortPairGroup originalPortPairGroup,
52 PortPairGroup updatePortPairGroup) {
57 * Method adds the PortPairGroup which is identified by InstanceIdentifier
60 * @param path - the whole path to new PortPairGroup
61 * @param newPortPairGroup - new PortPairGroup
64 public void add(InstanceIdentifier<PortPairGroup> path, PortPairGroup newPortPairGroup) {