2 * Copyright © 2017 ZTE 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 com.highstreet.technologies.odl.app.impl;
10 import com.highstreet.technologies.odl.app.impl.tools.DataBrokerHolder;
11 import com.highstreet.technologies.odl.app.impl.tools.MountPointServiceHolder;
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
14 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
15 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.route.rev150105.RouteService;
17 import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory;
20 import static com.highstreet.technologies.odl.app.impl.tools.RPCHolder.rpc;
22 public class RouteProvider
25 final DataBroker dataBroker, final RpcProviderRegistry rpcRegistry, final MountPointService mountService)
27 this.dataBroker = dataBroker;
28 this.rpcRegistry = rpcRegistry;
29 this.mountService = mountService;
32 private static final Logger LOG = LoggerFactory.getLogger(RouteProvider.class);
33 private final DataBroker dataBroker;
34 private final RpcProviderRegistry rpcRegistry;
35 private final MountPointService mountService;
36 private BindingAwareBroker.RpcRegistration<RouteService> service;
39 * Method called when the blueprint container is created.
43 LOG.info("RouteProvider Session Initiated --- created at 16:29-0627-2017");
44 service = rpcRegistry.addRpcImplementation(
45 RouteService.class, rpc = new RouteRPC(dataBroker));
46 MountPointServiceHolder.setMountPointService(mountService);
47 DataBrokerHolder.setDataBroker(dataBroker);
51 * Method called when the blueprint container is destroyed.
55 LOG.info("RouteProvider Closed");