+++ /dev/null
-/*\r
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.vpnservice;\r
-\r
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;\r
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;\r
-\r
-import org.slf4j.Logger;\r
-import org.slf4j.LoggerFactory;\r
-\r
-public class VpnserviceProvider implements BindingAwareProvider,\r
- AutoCloseable {\r
-\r
- private static final Logger LOG = LoggerFactory.getLogger(VpnserviceProvider.class);\r
- private VpnInterfaceManager vpnInterfaceManager;\r
- private VpnManager vpnManager;\r
-\r
- @Override\r
- public void onSessionInitiated(ProviderContext session) {\r
- LOG.info("VpnserviceProvider Session Initiated");\r
- try {\r
- final DataBroker dataBroker = session.getSALService(DataBroker.class);\r
- vpnManager = new VpnManager(dataBroker);\r
- vpnInterfaceManager = new VpnInterfaceManager(dataBroker);\r
- } catch (Exception e) {\r
- LOG.error("Error initializing services", e);\r
- }\r
- }\r
-\r
- @Override\r
- public void close() throws Exception {\r
- vpnManager.close();\r
- vpnInterfaceManager.close();\r
- }\r
-}\r