blob: 4282cdc561d2dfbc3388d4431e9e4649930bbf37 [file] [log] [blame]
Simon Hunta17fa672015-08-19 18:42:22 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18package org.onosproject.ui.impl.topo;
19
20import org.onosproject.incubator.net.PortStatisticsService;
21import org.onosproject.net.device.DeviceService;
22import org.onosproject.net.flow.FlowRuleService;
23import org.onosproject.net.host.HostService;
24import org.onosproject.net.intent.IntentService;
25import org.onosproject.net.link.LinkService;
26import org.onosproject.net.statistic.StatisticService;
27
28import static com.google.common.base.Preconditions.checkNotNull;
29
30/**
31 * A bundle of services that the topology view requires to get its job done.
32 */
33public class ServicesBundle {
34
35 private final IntentService intentService;
36 private final DeviceService deviceService;
37 private final HostService hostService;
38 private final LinkService linkService;
39 private final FlowRuleService flowService;
40 private final StatisticService flowStatsService;
41 private final PortStatisticsService portStatsService;
42
43 /**
44 * Creates the services bundle.
45 * @param intentService intent service reference
46 * @param deviceService device service reference
47 * @param hostService host service reference
48 * @param linkService link service reference
49 * @param flowService flow service reference
50 * @param flowStatsService flow statistics service reference
51 * @param portStatsService port statistics service reference
52 */
53 public ServicesBundle(IntentService intentService,
54 DeviceService deviceService,
55 HostService hostService,
56 LinkService linkService,
57 FlowRuleService flowService,
58 StatisticService flowStatsService,
59 PortStatisticsService portStatsService) {
60 this.intentService = checkNotNull(intentService);
61 this.deviceService = checkNotNull(deviceService);
62 this.hostService = checkNotNull(hostService);
63 this.linkService = checkNotNull(linkService);
64 this.flowService = checkNotNull(flowService);
65 this.flowStatsService = checkNotNull(flowStatsService);
66 this.portStatsService = checkNotNull(portStatsService);
67 }
68
69 public IntentService intentService() {
70 return intentService;
71 }
72
73 public DeviceService deviceService() {
74 return deviceService;
75 }
76
77 public HostService hostService() {
78 return hostService;
79 }
80
81 public LinkService linkService() {
82 return linkService;
83 }
84
85 public FlowRuleService flowService() {
86 return flowService;
87 }
88
89 public StatisticService flowStatsService() {
90 return flowStatsService;
91 }
92
93 public PortStatisticsService portStatsService() {
94 return portStatsService;
95 }
96}