2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.web;
10 import java.net.InetAddress;
13 * Information about a clustered controller to send to the UI frontend
16 public class ClusterNodeBean {
17 private final byte[] address;
18 private final String name;
19 private final Boolean me;
20 private final Boolean coordinator;
21 private final Integer numConnectedNodes;
23 public static class Builder {
25 private final byte[] address;
26 private final String name;
29 private Boolean me = null;
30 private Boolean coordinator = null;
31 private Integer numConnectedNodes = null;
33 public Builder(InetAddress address) {
34 this.address = address.getAddress();
35 this.name = address.getHostAddress();
38 public Builder highlightMe() {
43 public Builder iAmCoordinator() {
44 this.coordinator = true;
48 public Builder nodesConnected(int numNodes) {
49 this.numConnectedNodes = numNodes;
53 public ClusterNodeBean build() {
54 return new ClusterNodeBean(this);
58 private ClusterNodeBean(Builder builder) {
59 this.address = builder.address;
60 this.name = builder.name;
62 this.coordinator = builder.coordinator;
63 this.numConnectedNodes = builder.numConnectedNodes;