blob: 3a9f60a187e4b341c197a350ed8de80c02c4dc2e [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;
20
21import java.util.List;
22import java.util.Set;
23
24/**
25 * Representation of a group of devices located in a common physical or
26 * logical region. Optionally, devices in the region can share the same
27 * cluster nodes mastership affinities.
28 */
29public interface Region {
30
31 /**
32 * Coarse representation of the type of the region.
33 */
34 enum Type {
35 /**
36 * Region represents an entire continent.
37 */
38 CONTINENT,
39
40 /**
41 * Region represents an entire country.
42 */
43 COUNTRY,
44
45 /**
46 * Region represents a metropolitan area.
47 */
48 METRO,
49
50 /**
51 * Region represents a campus.
52 */
53 CAMPUS,
54
55 /**
56 * Region represents a building.
57 */
58 BUILDING,
59
60 /**
61 * Region represents a building floor.
62 */
63 FLOOR,
64
65 /**
66 * Region represents a room.
67 */
68 ROOM,
69
70 /**
71 * Region represents a rack.
72 */
73 RACK,
74
75 /**
76 * Region represents a logical grouping.
77 */
78 LOGICAL_GROUP
79 }
80
81 /**
82 * Returns the unique identifier of the region.
83 *
84 * @return region identifier
85 */
86 RegionId id();
87
88 /**
89 * Returns the friendly region name that can be used for display purposes.
90 *
91 * @return friendly name of the region
92 */
93 String name();
94
95 /**
96 * Returns the region type.
97 *
98 * @return region type
99 */
100 Type type();
101
102 /**
103 * Returns the list of master node sets. The sets of cluster node identifiers
104 * should be listed in the order of preferred mastership. Nodes specified
105 * in each sets should be considered with equally priority and devices in
106 * the region can be balanced between them based on other criteria, e.g. load.
107 *
108 * @return list of preferred master node sets
109 */
110 List<Set<NodeId>> masters();
111
112}