2 * Copyright (c) 2016, 2017 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
9 package org.opendaylight.netvirt.sfc.translator.portchain;
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;
21 * OpenDaylight Neutron Port Pair Group yang models data change listener.
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);
27 public NeutronPortPairGroupListener(DataBroker db) {
28 super(db,new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, PORT_PAIR_GROUP_IID));
32 * Method removes PortPairGroup which is identified by InstanceIdentifier.
34 * @param deletedPortPairGroup - PortPairGroup for removing
37 public void remove(PortPairGroup deletedPortPairGroup) {
42 * Method updates the original PortPairGroup to the update PortPairGroup.
43 * Both are identified by same InstanceIdentifier.
45 * @param origPortPairGroup - original PortPairGroup
46 * @param updatePortPairGroup - changed PortPairGroup (contain updates)
49 public void update(PortPairGroup origPortPairGroup, PortPairGroup updatePortPairGroup) {
54 * Method adds the PortPairGroup which is identified by InstanceIdentifier
57 * @param newPortPairGroup - new PortPairGroup
60 public void add(PortPairGroup newPortPairGroup) {