2 * Copyright (c) 2017 AT&T Intellectual Property. 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.bgpcep.pcep.tunnel.provider;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.mdsal.binding.api.DataBroker;
13 import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
14 import org.opendaylight.mdsal.binding.api.RpcProviderService;
15 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev181109.NetworkTopologyPcepService;
17 import org.osgi.framework.BundleContext;
19 final class TunnelProviderDependencies {
20 private final DataBroker dataBroker;
21 private final ClusterSingletonServiceProvider cssp;
22 private final NetworkTopologyPcepService ntps;
23 private final RpcProviderService rpcProviderRegistry;
24 private final BundleContext bundleContext;
26 TunnelProviderDependencies(
27 final DataBroker dataBroker,
28 final ClusterSingletonServiceProvider cssp,
29 final RpcProviderService rpcProviderRegistry,
30 final RpcConsumerRegistry rpcConsumerRegistry,
31 final BundleContext bundleContext
34 this.dataBroker = requireNonNull(dataBroker);
35 this.cssp = requireNonNull(cssp);
36 this.rpcProviderRegistry = requireNonNull(rpcProviderRegistry);
37 this.bundleContext = requireNonNull(bundleContext);
38 this.ntps = rpcConsumerRegistry.getRpcService(NetworkTopologyPcepService.class);
41 DataBroker getDataBroker() {
42 return this.dataBroker;
45 ClusterSingletonServiceProvider getCssp() {
49 NetworkTopologyPcepService getNtps() {
53 RpcProviderService getRpcProviderRegistry() {
54 return this.rpcProviderRegistry;
57 BundleContext getBundleContext() {
58 return this.bundleContext;