blob: b2b9b141a9f92165d9303585acc7134befcd384d [file] [log] [blame]
Thomas Vachuska48448082016-02-19 22:14:54 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Thomas Vachuska48448082016-02-19 22:14:54 -08003 *
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
17package org.onosproject.net.region;
18
Simon Huntcda9c032016-04-11 10:32:54 -070019import org.onosproject.event.ListenerService;
Thomas Vachuska48448082016-02-19 22:14:54 -080020import org.onosproject.net.DeviceId;
Steven Burrows19e6e4f2016-10-05 13:27:07 -050021import org.onosproject.net.HostId;
Thomas Vachuska48448082016-02-19 22:14:54 -080022
23import java.util.Set;
24
25/**
26 * Service for interacting with inventory of network control regions.
27 */
Simon Huntcda9c032016-04-11 10:32:54 -070028public interface RegionService extends ListenerService<RegionEvent, RegionListener> {
Thomas Vachuska48448082016-02-19 22:14:54 -080029
30 /**
31 * Returns set of all regions.
32 *
33 * @return set of regions
34 */
35 Set<Region> getRegions();
36
37 /**
38 * Returns the region with the specified identifier.
39 *
40 * @param regionId region identifier
41 * @return region
42 * @throws org.onlab.util.ItemNotFoundException if region with given
43 * id does not exist
44 */
45 Region getRegion(RegionId regionId);
46
47 /**
48 * Returns the region to which the specified device belongs.
49 *
50 * @param deviceId device identifier
51 * @return region or null if device does not belong to any region
52 */
53 Region getRegionForDevice(DeviceId deviceId);
54
55 /**
56 * Returns the set of devices that belong to the specified region.
57 *
58 * @param regionId region identifier
59 * @return set of identifiers for devices in the given region
60 */
61 Set<DeviceId> getRegionDevices(RegionId regionId);
62
Steven Burrows19e6e4f2016-10-05 13:27:07 -050063 /**
64 * Returns the set of hosts that belong to the specified region.
65 *
66 * @param regionId region identifier
67 * @return set of identifiers for hosts in the given region
68 */
69 Set<HostId> getRegionHosts(RegionId regionId);
70
Thomas Vachuska48448082016-02-19 22:14:54 -080071}