blob: 625183afda90fc26967c1b9f6c53b1e6da41d325 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.cluster;
tomb41d1ac2014-09-24 01:51:24 -070017
Pavlin Radoslavov444b5192014-10-28 10:45:19 -070018import org.onlab.packet.IpAddress;
tomee49c372014-09-26 15:14:50 -070019
Thomas Vachuskade563cf2015-04-01 00:28:50 -070020import java.util.Set;
21
tomb41d1ac2014-09-24 01:51:24 -070022/**
23 * Service for administering the cluster node membership.
24 */
Thomas Vachuska7a8de842016-03-07 20:56:35 -080025public interface ClusterAdminService extends ClusterService {
tomb41d1ac2014-09-24 01:51:24 -070026
27 /**
Thomas Vachuskade563cf2015-04-01 00:28:50 -070028 * Forms cluster configuration based on the specified set of node
29 * information.  This method resets and restarts the controller
30 * instance.
31 *
32 * @param nodes set of nodes that form the cluster
Thomas Vachuskade563cf2015-04-01 00:28:50 -070033 */
Madan Jampaniec1df022015-10-13 21:23:03 -070034 void formCluster(Set<ControllerNode> nodes);
Thomas Vachuskade563cf2015-04-01 00:28:50 -070035
36 /**
Thiago Santos7a174cf2016-09-01 14:56:54 -030037 * Forms cluster configuration based on the specified set of node
38 * information.&nbsp; This method resets and restarts the controller
39 * instance.
40 *
41 * @param nodes set of nodes that form the cluster
42 * @param partitionSize number of nodes to compose a partition
43 */
44 void formCluster(Set<ControllerNode> nodes, int partitionSize);
45
46 /**
tomee49c372014-09-26 15:14:50 -070047 * Adds a new controller node to the cluster.
48 *
49 * @param nodeId controller node identifier
50 * @param ip node IP listen address
51 * @param tcpPort tcp listen port
52 * @return newly added node
53 */
Pavlin Radoslavov444b5192014-10-28 10:45:19 -070054 ControllerNode addNode(NodeId nodeId, IpAddress ip, int tcpPort);
tomee49c372014-09-26 15:14:50 -070055
56 /**
tomb41d1ac2014-09-24 01:51:24 -070057 * Removes the specified node from the cluster node list.
58 *
59 * @param nodeId controller node identifier
60 */
61 void removeNode(NodeId nodeId);
62
Thomas Vachuska7a8de842016-03-07 20:56:35 -080063 /**
64 * Marks the current node as fully started or not.
65 *
66 * @param started true indicates all components have been started
67 */
68 void markFullyStarted(boolean started);
69
tomb41d1ac2014-09-24 01:51:24 -070070}