blob: d1c4325f6f18762be84916400506851f98f6f906 [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
Jordan Halterman28183ee2017-10-17 17:29:10 -070018import java.util.Set;
19
20import org.onlab.packet.IpAddress;
21
tomb41d1ac2014-09-24 01:51:24 -070022/**
23 * Service for administering the cluster node membership.
24 */
Jordan Halterman28183ee2017-10-17 17:29:10 -070025public interface ClusterAdminService extends ClusterService {
26
27 /**
28 * 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
33 */
34 void formCluster(Set<ControllerNode> nodes);
35
36 /**
37 * 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 /**
47 * 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 */
54 ControllerNode addNode(NodeId nodeId, IpAddress ip, int tcpPort);
55
56 /**
57 * Removes the specified node from the cluster node list.
58 *
59 * @param nodeId controller node identifier
60 */
61 void removeNode(NodeId nodeId);
62
63 /**
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}