blob: bcc4ad8b5e7693d6b1ca2772b2e562a5e90bf22d [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.
Simon Hunt4fc86852015-08-20 17:57:52 -070045 *
Simon Hunta17fa672015-08-19 18:42:22 -070046 * @param intentService intent service reference
47 * @param deviceService device service reference
48 * @param hostService host service reference
49 * @param linkService link service reference
50 * @param flowService flow service reference
51 * @param flowStatsService flow statistics service reference
52 * @param portStatsService port statistics service reference
53 */
54 public ServicesBundle(IntentService intentService,
55 DeviceService deviceService,
56 HostService hostService,
57 LinkService linkService,
58 FlowRuleService flowService,
59 StatisticService flowStatsService,
60 PortStatisticsService portStatsService) {
61 this.intentService = checkNotNull(intentService);
62 this.deviceService = checkNotNull(deviceService);
63 this.hostService = checkNotNull(hostService);
64 this.linkService = checkNotNull(linkService);
65 this.flowService = checkNotNull(flowService);
66 this.flowStatsService = checkNotNull(flowStatsService);
67 this.portStatsService = checkNotNull(portStatsService);
68 }
69
Simon Hunt4fc86852015-08-20 17:57:52 -070070 /**
71 * Returns a reference to the intent service.
72 *
73 * @return intent service reference
74 */
Simon Hunta17fa672015-08-19 18:42:22 -070075 public IntentService intentService() {
76 return intentService;
77 }
78
Simon Hunt4fc86852015-08-20 17:57:52 -070079 /**
80 * Returns a reference to the device service.
81 *
82 * @return device service reference
83 */
Simon Hunta17fa672015-08-19 18:42:22 -070084 public DeviceService deviceService() {
85 return deviceService;
86 }
87
Simon Hunt4fc86852015-08-20 17:57:52 -070088 /**
89 * Returns a reference to the host service.
90 *
91 * @return host service reference
92 */
Simon Hunta17fa672015-08-19 18:42:22 -070093 public HostService hostService() {
94 return hostService;
95 }
96
Simon Hunt4fc86852015-08-20 17:57:52 -070097 /**
98 * Returns a reference to the link service.
99 *
100 * @return link service reference
101 */
Simon Hunta17fa672015-08-19 18:42:22 -0700102 public LinkService linkService() {
103 return linkService;
104 }
105
Simon Hunt4fc86852015-08-20 17:57:52 -0700106 /**
107 * Returns a reference to the flow rule service.
108 *
109 * @return flow service reference
110 */
Simon Hunta17fa672015-08-19 18:42:22 -0700111 public FlowRuleService flowService() {
112 return flowService;
113 }
114
Simon Hunt4fc86852015-08-20 17:57:52 -0700115 /**
116 * Returns a reference to the flow statistics service.
117 *
118 * @return flow statistics service reference
119 */
Simon Hunta17fa672015-08-19 18:42:22 -0700120 public StatisticService flowStatsService() {
121 return flowStatsService;
122 }
123
Simon Hunt4fc86852015-08-20 17:57:52 -0700124 /**
125 * Returns a reference to the port statistics service.
126 *
127 * @return port statistics service reference
128 */
Simon Hunta17fa672015-08-19 18:42:22 -0700129 public PortStatisticsService portStatsService() {
130 return portStatsService;
131 }
132}