Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -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 | */ |
| 16 | |
| 17 | package org.onosproject.ui.model.topo; |
| 18 | |
Simon Hunt | 338a3b4 | 2016-04-14 09:43:52 -0700 | [diff] [blame] | 19 | import org.onosproject.cluster.ControllerNode; |
| 20 | import org.onosproject.cluster.NodeId; |
| 21 | |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 22 | /** |
| 23 | * Represents an individual member of the cluster (ONOS instance). |
| 24 | */ |
Simon Hunt | cda9c03 | 2016-04-11 10:32:54 -0700 | [diff] [blame] | 25 | public class UiClusterMember extends UiElement { |
Simon Hunt | 338a3b4 | 2016-04-14 09:43:52 -0700 | [diff] [blame] | 26 | |
| 27 | private final ControllerNode cnode; |
| 28 | |
| 29 | /** |
| 30 | * Constructs a cluster member, with a reference to the specified |
| 31 | * controller node instance. |
| 32 | * |
| 33 | * @param cnode underlying controller node. |
| 34 | */ |
| 35 | public UiClusterMember(ControllerNode cnode) { |
| 36 | this.cnode = cnode; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Updates the information about this cluster member. |
| 41 | * |
| 42 | * @param cnode underlying controller node |
| 43 | */ |
| 44 | public void update(ControllerNode cnode) { |
| 45 | // TODO: update our information cache appropriately |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Returns the identity of the cluster member. |
| 50 | * |
| 51 | * @return member identifier |
| 52 | */ |
| 53 | public NodeId id() { |
| 54 | return cnode.id(); |
| 55 | } |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 56 | } |