blob: 1ee78b15ce741601613e993a804e6ba6957ed0e8 [file] [log] [blame]
Thomas Vachuska58de4162015-09-10 16:15:33 -07001/*
2 * Copyright 2015 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 */
Madan Jampaniafeebbd2015-05-19 15:26:01 -070016package org.onosproject.cluster;
17
18import java.util.Set;
19
20/**
21 * Service for obtaining the static definition of a controller cluster.
22 */
23public interface ClusterDefinitionService {
24
25 /**
26 * Returns the local controller node.
27 * @return local controller node
28 */
29 ControllerNode localNode();
30
31 /**
32 * Returns the set of seed nodes that should be used for discovering other members
33 * of the cluster.
34 * @return set of seed controller nodes
35 */
36 Set<ControllerNode> seedNodes();
37
38 /**
39 * Forms cluster configuration based on the specified set of node
40 * information. Assumes subsequent restart for the new configuration to
41 * take hold.
42 *
43 * @param nodes set of nodes that form the cluster
44 * @param ipPrefix IP address prefix, e.g. 10.0.1.*
45 */
46 void formCluster(Set<ControllerNode> nodes, String ipPrefix);
47}