2 * Copyright (c) 2013 Cisco 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.md.controller.topology.manager
10 import org.opendaylight.controller.sal.binding.api.NotificationProviderService
11 import org.opendaylight.controller.sal.binding.api.data.DataProviderService
12 import org.opendaylight.yangtools.concepts.Registration
13 import org.opendaylight.yangtools.yang.binding.NotificationListener
14 import org.slf4j.LoggerFactory
15 import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider
16 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
18 class FlowCapableTopologyProvider extends AbstractBindingAwareProvider implements AutoCloseable {
22 static val LOG = LoggerFactory.getLogger(FlowCapableTopologyProvider);
25 DataProviderService dataService;
28 NotificationProviderService notificationService;
30 val FlowCapableTopologyExporter exporter = new FlowCapableTopologyExporter();
32 Registration<NotificationListener> listenerRegistration
35 LOG.info("FlowCapableTopologyProvider stopped.");
36 listenerRegistration?.close();
39 override onSessionInitiated(ProviderContext session) {
40 dataService = session.getSALService(DataProviderService)
41 notificationService = session.getSALService(NotificationProviderService)
42 exporter.setDataService(dataService);
44 listenerRegistration = notificationService.registerNotificationListener(exporter);