2 * Copyright (c) 2014, 2015 Ericsson India Global Services Pvt Ltd. 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.openflowplugin.test;
10 import java.util.ArrayList;
11 import java.util.List;
12 import org.opendaylight.mdsal.binding.api.NotificationService;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorUpdated;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeUpdated;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.OpendaylightInventoryListener;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 public class OpenflowpluginTestNodeConnectorNotification {
23 private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestNodeConnectorNotification.class);
25 private final PortEventListener portEventListener = new PortEventListener();
26 private final NotificationService notificationService;
28 public OpenflowpluginTestNodeConnectorNotification(final NotificationService notificationService) {
29 this.notificationService = notificationService;
34 notificationService.registerNotificationListener(portEventListener);
37 private static final class PortEventListener implements OpendaylightInventoryListener {
39 List<NodeUpdated> nodeUpdated = new ArrayList<>();
40 List<NodeRemoved> nodeRemoved = new ArrayList<>();
41 List<NodeConnectorUpdated> nodeConnectorUpdated = new ArrayList<>();
42 List<NodeConnectorRemoved> nodeConnectorRemoved = new ArrayList<>();
46 public void onNodeConnectorRemoved(final NodeConnectorRemoved notification) {
47 LOG.debug("NodeConnectorRemoved Notification");
48 LOG.debug("NodeConnectorRef {}", notification.getNodeConnectorRef());
49 nodeConnectorRemoved.add(notification);
54 public void onNodeConnectorUpdated(final NodeConnectorUpdated notification) {
55 LOG.debug("NodeConnectorUpdated Notification");
56 LOG.debug("NodeConnectorRef {}", notification.getNodeConnectorRef());
57 nodeConnectorUpdated.add(notification);
62 public void onNodeRemoved(final NodeRemoved notification) {
63 LOG.debug("NodeRemoved Notification");
64 LOG.debug("NodeRef {}", notification.getNodeRef());
65 nodeRemoved.add(notification);
70 public void onNodeUpdated(final NodeUpdated notification) {
71 LOG.debug("NodeUpdated Notification");
72 LOG.debug("NodeRef {}", notification.getNodeRef());
73 nodeUpdated.add(notification);