se.timestamp = now(); if (se.currentState != state) { se.priorState = se.currentState; se.currentState = state; se.expiration = expiration; logger.debug("setCurrentState" + " agent=" + name + " newState=" + se.currentState + " priorState=" + se.priorState + " expiration=" + expiration); if (se.type == NODE) { electLeader();
if (se != null) { se.timestamp = now(); if (se.currentState != state) { se.priorState = se.currentState; se.currentState = state; se.expiration = expiration; logger.debug("setCurrentState" + " agent=" + name + " newState=" + se.currentState + " priorState=" + se.priorState + " expiration=" + expiration); if (hasAttribute(se.attrs, "Role", HEALTH_MONITOR)) { electLeader(); } queueChangeEvent( new CommunityStatusChangeEvent(CommunityStatusChangeEvent. STATE_CHANGE, se));
  public void setCurrentState(String name, int state, long expiration) {    StatusEntry se = (StatusEntry)statusMap.get(name);    se.timestamp = now();    if (se.currentState != state) {      se.priorState = se.currentState;      se.currentState = state;      se.expiration = expiration;      logger.debug("setCurrentState" +                  " agent=" + name +                  " newState=" + se.currentState +                  " priorState=" + se.priorState +                  " expiration=" + expiration);      if (se.type == NODE) {         electLeader();      }      queueChangeEvent(        new CommunityStatusChangeEvent(CommunityStatusChangeEvent.STATE_CHANGE, se));      }  }