blob: 259c8b072cf121504f82e736e2fb6b22d3ff853c [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;
21
22import java.util.Set;
23
24/**
25 * Service for interacting with inventory of network control regions.
26 */
Simon Huntcda9c032016-04-11 10:32:54 -070027public interface RegionService extends ListenerService<RegionEvent, RegionListener> {
Thomas Vachuska48448082016-02-19 22:14:54 -080028
29 /**
30 * Returns set of all regions.
31 *
32 * @return set of regions
33 */
34 Set<Region> getRegions();
35
36 /**
37 * Returns the region with the specified identifier.
38 *
39 * @param regionId region identifier
40 * @return region
41 * @throws org.onlab.util.ItemNotFoundException if region with given
42 * id does not exist
43 */
44 Region getRegion(RegionId regionId);
45
46 /**
47 * Returns the region to which the specified device belongs.
48 *
49 * @param deviceId device identifier
50 * @return region or null if device does not belong to any region
51 */
52 Region getRegionForDevice(DeviceId deviceId);
53
54 /**
55 * Returns the set of devices that belong to the specified region.
56 *
57 * @param regionId region identifier
58 * @return set of identifiers for devices in the given region
59 */
60 Set<DeviceId> getRegionDevices(RegionId regionId);
61
62}