BGPCEP-726: Migrate PCEP Tunnel config
[bgpcep.git] / pcep / tunnel / tunnel-provider / src / main / java / org / opendaylight / bgpcep / pcep / tunnel / provider / TunnelProviderDependencies.java
1 /*
2  * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.bgpcep.pcep.tunnel.provider;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
13 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
14 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.NetworkTopologyPcepService;
16 import org.osgi.framework.BundleContext;
17
18 final class TunnelProviderDependencies {
19     private final DataBroker dataBroker;
20     private final ClusterSingletonServiceProvider cssp;
21     private final NetworkTopologyPcepService ntps;
22     private final RpcProviderRegistry rpcProviderRegistry;
23     private final BundleContext bundleContext;
24
25     TunnelProviderDependencies(
26             final DataBroker dataBroker,
27             final ClusterSingletonServiceProvider cssp,
28             final RpcProviderRegistry rpcProviderRegistry,
29             final BundleContext bundleContext
30     ) {
31
32         this.dataBroker = requireNonNull(dataBroker);
33         this.cssp = requireNonNull(cssp);
34         this.rpcProviderRegistry = requireNonNull(rpcProviderRegistry);
35         this.bundleContext = requireNonNull(bundleContext);
36         this.ntps = this.rpcProviderRegistry.getRpcService(NetworkTopologyPcepService.class);
37     }
38
39     DataBroker getDataBroker() {
40         return this.dataBroker;
41     }
42
43     ClusterSingletonServiceProvider getCssp() {
44         return this.cssp;
45     }
46
47     NetworkTopologyPcepService getNtps() {
48         return this.ntps;
49     }
50
51     RpcProviderRegistry getRpcProviderRegistry() {
52         return this.rpcProviderRegistry;
53     }
54
55     BundleContext getBundleContext() {
56         return this.bundleContext;
57     }
58 }