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.itm.impl;
10 import java.math.BigInteger;
11 import java.util.List;
12 import java.util.concurrent.Future;
14 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
15 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
16 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
17 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
18 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
19 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
20 import org.opendaylight.vpnservice.interfacemgr.interfaces.IInterfaceManager;
21 import org.opendaylight.vpnservice.itm.api.IITMProvider;
23 import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.itm.op.rev150701.GetTunnelIdInput;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.itm.op.rev150701.GetTunnelIdOutput;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.itm.op.rev150701.ItmStateService;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.itm.op.rev150701.TunnelsState;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.itm.rev150701.TransportZones;
29 import org.opendaylight.yangtools.yang.common.RpcResult;
30 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory;
33 public class ItmProvider implements BindingAwareProvider, AutoCloseable, IITMProvider,ItmStateService {
35 private static final Logger LOG = LoggerFactory.getLogger(ItmProvider.class);
36 private IInterfaceManager interfaceManager;
37 private ITMManager itmManager;
38 private IMdsalApiManager mdsalManager;
39 private DataBroker dataBroker;
40 private NotificationPublishService notificationPublishService;
41 private NotificationService notificationService;
44 public void onSessionInitiated(ProviderContext session) {
45 LOG.info("ItmProvider Session Initiated");
47 dataBroker = session.getSALService(DataBroker.class);
49 itmManager = new ITMManager(dataBroker);
51 itmManager.setMdsalManager(mdsalManager);
52 itmManager.setNotificationPublishService(notificationPublishService);
53 itmManager.setMdsalManager(mdsalManager);
55 } catch (Exception e) {
56 LOG.error("Error initializing services", e);
60 public void setInterfaceManager(IInterfaceManager interfaceManager) {
61 this.interfaceManager = interfaceManager;
64 public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
65 this.notificationPublishService = notificationPublishService;
68 public void setMdsalApiManager(IMdsalApiManager mdsalMgr) {
69 this.mdsalManager = mdsalMgr;
71 public void setNotificationService(NotificationService notificationService) {
72 this.notificationService = notificationService;
76 public void close() throws Exception {
77 if (itmManager != null) {
81 LOG.info("ItmProvider Closed");
85 public Future<RpcResult<GetTunnelIdOutput>> getTunnelId(
86 GetTunnelIdInput input) {
87 // TODO Auto-generated method stub