blob: e402a7d8a2684854a9227a635629e91d1e958860 [file] [log] [blame]
Thomas Vachuska48448082016-02-19 22:14:54 -08001/*
2 * Copyright 2016 Open Networking Laboratory
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
17package org.onosproject.net.region;
18
19import org.onosproject.cluster.NodeId;
20import org.onosproject.net.DeviceId;
21
22import java.util.Collection;
23import java.util.List;
24import java.util.Set;
25
26/**
27 * Service for interacting with inventory of network control regions.
28 */
29public 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}