blob: f89a9aecd8a46361325a55c8a5bf4d9e8990ea8f [file] [log] [blame]
Simon Hunt5f6dbf82016-03-30 08:53:33 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Hunt5f6dbf82016-03-30 08:53:33 -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 */
16
17package org.onosproject.ui.model.topo;
18
Simon Hunt338a3b42016-04-14 09:43:52 -070019import org.onosproject.cluster.ControllerNode;
20import org.onosproject.cluster.NodeId;
21
Simon Hunt5f6dbf82016-03-30 08:53:33 -070022/**
23 * Represents an individual member of the cluster (ONOS instance).
24 */
Simon Huntcda9c032016-04-11 10:32:54 -070025public class UiClusterMember extends UiElement {
Simon Hunt338a3b42016-04-14 09:43:52 -070026
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 Hunt5f6dbf82016-03-30 08:53:33 -070056}