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