2 * Copyright (c) 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.vpnservice;
10 import java.util.Collections;
12 import org.opendaylight.bgpmanager.api.IBgpManager;
13 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public class VpnserviceProvider implements BindingAwareProvider,
22 private static final Logger LOG = LoggerFactory.getLogger(VpnserviceProvider.class);
23 private VpnInterfaceManager vpnInterfaceManager;
24 private VpnManager vpnManager;
25 private IBgpManager bgpManager;
28 public void onSessionInitiated(ProviderContext session) {
29 LOG.info("VpnserviceProvider Session Initiated");
31 final DataBroker dataBroker = session.getSALService(DataBroker.class);
32 vpnManager = new VpnManager(dataBroker);
33 vpnInterfaceManager = new VpnInterfaceManager(dataBroker);
34 } catch (Exception e) {
35 LOG.error("Error initializing services", e);
39 public void setBgpManager(IBgpManager bgpManager) {
40 LOG.debug("BGP Manager reference initialized");
41 this.bgpManager = bgpManager;
45 public void close() throws Exception {
47 vpnInterfaceManager.close();