blob: 13bf1c207c3a8435e9aa2e8db667f11f5736aec6 [file] [log] [blame]
Simon Hunta17fa672015-08-19 18:42:22 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Hunta17fa672015-08-19 18:42:22 -07003 *
Simon Hunted804d52016-03-30 09:51:40 -07004 * 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
Simon Hunta17fa672015-08-19 18:42:22 -07007 *
Simon Hunted804d52016-03-30 09:51:40 -07008 * http://www.apache.org/licenses/LICENSE-2.0
Simon Hunta17fa672015-08-19 18:42:22 -07009 *
Simon Hunted804d52016-03-30 09:51:40 -070010 * 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.
Simon Hunta17fa672015-08-19 18:42:22 -070015 */
16
Simon Hunted804d52016-03-30 09:51:40 -070017package org.onosproject.ui.impl.topo.util;
Simon Hunta17fa672015-08-19 18:42:22 -070018
19import org.onosproject.incubator.net.PortStatisticsService;
20import org.onosproject.net.device.DeviceService;
21import org.onosproject.net.flow.FlowRuleService;
22import org.onosproject.net.host.HostService;
23import org.onosproject.net.intent.IntentService;
24import org.onosproject.net.link.LinkService;
25import org.onosproject.net.statistic.StatisticService;
26
27import static com.google.common.base.Preconditions.checkNotNull;
28
29/**
30 * A bundle of services that the topology view requires to get its job done.
31 */
32public class ServicesBundle {
33
34 private final IntentService intentService;
35 private final DeviceService deviceService;
36 private final HostService hostService;
37 private final LinkService linkService;
38 private final FlowRuleService flowService;
39 private final StatisticService flowStatsService;
40 private final PortStatisticsService portStatsService;
41
42 /**
43 * Creates the services bundle.
Simon Hunt4fc86852015-08-20 17:57:52 -070044 *
Simon Hunta17fa672015-08-19 18:42:22 -070045 * @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
Simon Hunt4fc86852015-08-20 17:57:52 -070069 /**
70 * Returns a reference to the intent service.
71 *
72 * @return intent service reference
73 */
Simon Hunta17fa672015-08-19 18:42:22 -070074 public IntentService intentService() {
75 return intentService;
76 }
77
Simon Hunt4fc86852015-08-20 17:57:52 -070078 /**
79 * Returns a reference to the device service.
80 *
81 * @return device service reference
82 */
Simon Hunta17fa672015-08-19 18:42:22 -070083 public DeviceService deviceService() {
84 return deviceService;
85 }
86
Simon Hunt4fc86852015-08-20 17:57:52 -070087 /**
88 * Returns a reference to the host service.
89 *
90 * @return host service reference
91 */
Simon Hunta17fa672015-08-19 18:42:22 -070092 public HostService hostService() {
93 return hostService;
94 }
95
Simon Hunt4fc86852015-08-20 17:57:52 -070096 /**
97 * Returns a reference to the link service.
98 *
99 * @return link service reference
100 */
Simon Hunta17fa672015-08-19 18:42:22 -0700101 public LinkService linkService() {
102 return linkService;
103 }
104
Simon Hunt4fc86852015-08-20 17:57:52 -0700105 /**
106 * Returns a reference to the flow rule service.
107 *
108 * @return flow service reference
109 */
Simon Hunta17fa672015-08-19 18:42:22 -0700110 public FlowRuleService flowService() {
111 return flowService;
112 }
113
Simon Hunt4fc86852015-08-20 17:57:52 -0700114 /**
115 * Returns a reference to the flow statistics service.
116 *
117 * @return flow statistics service reference
118 */
Simon Hunta17fa672015-08-19 18:42:22 -0700119 public StatisticService flowStatsService() {
120 return flowStatsService;
121 }
122
Simon Hunt4fc86852015-08-20 17:57:52 -0700123 /**
124 * Returns a reference to the port statistics service.
125 *
126 * @return port statistics service reference
127 */
Simon Hunta17fa672015-08-19 18:42:22 -0700128 public PortStatisticsService portStatsService() {
129 return portStatsService;
130 }
131}