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.interfacemgr;
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
11 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
16 public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable {
18 private static final Logger LOG = LoggerFactory.getLogger(InterfacemgrProvider.class);
20 private InterfaceManager interfaceManager;
23 public void onSessionInitiated(ProviderContext session) {
24 LOG.info("InterfacemgrProvider Session Initiated");
26 final DataBroker dataBroker = session.getSALService(DataBroker.class);
27 interfaceManager = new InterfaceManager(dataBroker);
28 } catch (Exception e) {
29 LOG.error("Error initializing services", e);
34 public void close() throws Exception {
35 LOG.info("InterfacemgrProvider Closed");
36 interfaceManager.close();