Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.cluster; |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 17 | |
Jordan Halterman | 28183ee | 2017-10-17 17:29:10 -0700 | [diff] [blame] | 18 | import java.util.Set; |
| 19 | |
| 20 | import org.onlab.packet.IpAddress; |
| 21 | |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 22 | /** |
| 23 | * Service for administering the cluster node membership. |
| 24 | */ |
Jordan Halterman | 28183ee | 2017-10-17 17:29:10 -0700 | [diff] [blame] | 25 | public 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. 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 | |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 70 | } |