public Object getValueAt(int row, int column) {
if ((clusterInfo == null) || (clusterInfo.length == 0)) {
return ("");
}
CompositeData info = clusterInfo[row];
switch (column) {
case 0:
// only set for HA clusters, otherwise null
return (info.get(BrokerClusterInfo.ID));
case 1:
return (info.get(BrokerClusterInfo.ADDRESS));
case 2:
return (BrokerState.toString(((Integer) info.get(BrokerClusterInfo.STATE)).intValue()));
case 3:
Object numMsgsObj = info.get(BrokerClusterInfo.NUM_MSGS);
// only set for HA clusters, otherwise null
if (numMsgsObj != null) {
return numMsgsObj.toString();
} else {
return "";
}
// return ((info.get(BrokerClusterInfo.NUM_MSGS)).toString());
case 4:
// only set for HA clusters, otherwise null
return (info.get(BrokerClusterInfo.TAKEOVER_BROKER_ID));
case 5:
// only set for HA clusters, otherwise null
Long statusTimestampObj = (Long) info.get(BrokerClusterInfo.STATUS_TIMESTAMP);
if (statusTimestampObj != null) {
long tmpLong = ((Long) info.get(BrokerClusterInfo.STATUS_TIMESTAMP)).longValue();
long idle = System.currentTimeMillis() - tmpLong;
return (getTimeString(idle));
} else {
return "";
}