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 org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
11 import org.opendaylight.controller.sal.binding.api.NotificationService;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.FlowTopologyDiscoveryListener;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkOverutilized;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkRemoved;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkUtilizationNormal;
17 import org.osgi.framework.BundleContext;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
21 public class OpenflowpluginTestTopologyNotification {
23 private static final Logger LOG = LoggerFactory.getLogger(OpenflowpluginTestTopologyNotification.class);
25 private final TopologyEventListener topologyEventListener = new TopologyEventListener();
26 private NotificationService notificationService;
28 public OpenflowpluginTestTopologyNotification(BundleContext ctx) {
31 public void onSessionInitiated(ProviderContext session) {
32 notificationService = session.getSALService(NotificationService.class);
34 notificationService.registerNotificationListener(topologyEventListener);
37 private static final class TopologyEventListener implements FlowTopologyDiscoveryListener {
39 public void onLinkDiscovered(LinkDiscovered notification) {
40 LOG.debug("-------------------------------------------");
41 LOG.debug("LinkDiscovered notification ........");
42 LOG.debug("-------------------------------------------");
46 public void onLinkOverutilized(LinkOverutilized notification) {
47 LOG.debug("-------------------------------------------");
48 LOG.debug("LinkOverutilized notification ........");
49 LOG.debug("-------------------------------------------");
53 public void onLinkRemoved(LinkRemoved notification) {
54 LOG.debug("-------------------------------------------");
55 LOG.debug("LinkRemoved notification ........");
56 LOG.debug("-------------------------------------------");
60 public void onLinkUtilizationNormal(LinkUtilizationNormal notification) {
61 LOG.debug("-------------------------------------------");
62 LOG.debug("LinkUtilizationNormal notification ........");
63 LOG.debug("-------------------------------------------");