2 * Copyright © 2015 Dell, 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.ovsdb.openstack.netvirt.sfc;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
14 import org.opendaylight.ovsdb.openstack.netvirt.sfc.openflow13.INetvirtSfcOF13Provider;
15 import org.opendaylight.ovsdb.openstack.netvirt.sfc.openflow13.NetvirtSfcOF13Provider;
16 import org.osgi.framework.BundleContext;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
20 public class NetvirtSfcProvider implements BindingAwareProvider, AutoCloseable {
21 private static final Logger LOG = LoggerFactory.getLogger(NetvirtSfcProvider.class);
22 private DataBroker dataBroker = null;
23 private BundleContext bundleContext = null;
24 private NetvirtSfcAclListener aclListener;
26 private NetvirtSfcClassifierListener classfierListener;
27 private INetvirtSfcOF13Provider provider;
29 public NetvirtSfcProvider(BundleContext bundleContext) {
30 LOG.info("NetvirtProvider: bundleContext: {}", bundleContext);
31 this.bundleContext = bundleContext;
35 public void onSessionInitiated(ProviderContext session) {
36 LOG.info("NetvirtSfcProvider Session Initiated");
37 dataBroker = session.getSALService(DataBroker.class);
39 provider = new NetvirtSfcOF13Provider(this.dataBroker);
40 aclListener = new NetvirtSfcAclListener(provider, this.dataBroker);
41 classfierListener = new NetvirtSfcClassifierListener(provider, this.dataBroker);
45 public void close() throws Exception {
46 LOG.info("NetvirtSfcProvider Closed");
48 classfierListener.close();