Thomas Vachuska | 4844808 | 2016-02-19 22:14:54 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Thomas Vachuska | 4844808 | 2016-02-19 22:14:54 -0800 | [diff] [blame] | 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 | package org.onosproject.net.region; |
| 18 | |
| 19 | import org.onosproject.cluster.NodeId; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | |
| 22 | import java.util.Collection; |
| 23 | import java.util.List; |
| 24 | import java.util.Set; |
| 25 | |
| 26 | /** |
| 27 | * Service for interacting with inventory of network control regions. |
| 28 | */ |
| 29 | public interface RegionAdminService extends RegionService { |
| 30 | |
| 31 | /** |
| 32 | * Creates a new region using the supplied data. |
| 33 | * |
| 34 | * @param regionId region identifier |
| 35 | * @param name friendly name |
| 36 | * @param type region type |
| 37 | * @param masterNodeIds list of sets of master nodes; null implies empty list |
| 38 | * @return new region descriptor |
| 39 | * @throws IllegalArgumentException if region already exists |
| 40 | */ |
| 41 | Region createRegion(RegionId regionId, String name, Region.Type type, |
| 42 | List<Set<NodeId>> masterNodeIds); |
| 43 | |
| 44 | /** |
| 45 | * Update the specified region using the new set of data. |
| 46 | * |
| 47 | * @param regionId region identifier |
| 48 | * @param name friendly name |
| 49 | * @param type region type |
| 50 | * @param masterNodeIds list of sets of master nodes; null implies empty list |
| 51 | * @return new region descriptor |
| 52 | */ |
| 53 | Region updateRegion(RegionId regionId, String name, Region.Type type, |
| 54 | List<Set<NodeId>> masterNodeIds); |
| 55 | |
| 56 | /** |
| 57 | * Removes the specified region using the new set of data. |
| 58 | * |
| 59 | * @param regionId region identifier |
| 60 | */ |
| 61 | void removeRegion(RegionId regionId); |
| 62 | |
| 63 | /** |
| 64 | * Adds the specified collection of devices to the region. |
| 65 | * |
| 66 | * @param regionId region identifier |
| 67 | * @param deviceIds list of device identifiers |
| 68 | */ |
| 69 | void addDevices(RegionId regionId, Collection<DeviceId> deviceIds); |
| 70 | |
| 71 | /** |
| 72 | * Removes the specified collection of devices from the region. |
| 73 | * |
| 74 | * @param regionId region identifier |
| 75 | * @param deviceIds list of device identifiers |
| 76 | */ |
| 77 | void removeDevices(RegionId regionId, Collection<DeviceId> deviceIds); |
| 78 | |
| 79 | } |