setCurrentState(agentName, as[i].getStatus());
  public void applyUpdates(String nodeName, int nodeStatus, AgentStatus[] as, String vote, String host) {    synchronized (statusMap) {      logger.debug("ApplyUpdates:" +                   " node=" + nodeName +                   " nodeStatus=" + controller.stateName(nodeStatus) +                   " numAgents=" + as.length);      if (statusMap.containsKey(nodeName)) {        setCurrentState(nodeName, nodeStatus);        setLeaderVote(nodeName, vote);        setLocation(nodeName, host);      } else {        StatusEntry se = new StatusEntry(nodeName, NODE, null);        statusMap.put(se.name, se);        setCurrentState(se.name, INITIAL);        queueChangeEvent(          new CommunityStatusChangeEvent(CommunityStatusChangeEvent.MEMBERS_ADDED, se));      }      // Apply agent status changes      for (int i = 0; i < as.length; i++) {        String agentName = as[i].getName();        if (statusMap.containsKey(agentName)) {          if (isLocalAgent(agentName)) {            setLocation(agentName, thisAgent);          } else {            setLocation(agentName, as[i].getLocation());          }          setCurrentState(agentName, as[i].getStatus());        }      }      electLeader();    }  }