2 * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.vpnservice;
\r
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
\r
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
\r
12 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
\r
14 import org.slf4j.Logger;
\r
15 import org.slf4j.LoggerFactory;
\r
17 public class VpnserviceProvider implements BindingAwareProvider,
\r
20 private static final Logger LOG = LoggerFactory.getLogger(VpnserviceProvider.class);
\r
21 private VpnInterfaceManager vpnInterfaceManager;
\r
22 private VpnManager vpnManager;
\r
25 public void onSessionInitiated(ProviderContext session) {
\r
26 LOG.info("VpnserviceProvider Session Initiated");
\r
28 final DataBroker dataBroker = session.getSALService(DataBroker.class);
\r
29 vpnManager = new VpnManager(dataBroker);
\r
30 vpnInterfaceManager = new VpnInterfaceManager(dataBroker);
\r
31 } catch (Exception e) {
\r
32 LOG.error("Error initializing services", e);
\r
37 public void close() throws Exception {
\r
39 vpnInterfaceManager.close();
\r