else if (defenseMode.equals("DISABLED")){
else if ((defenseMode.equals("DISABLED")) && (reconnectInterval == 0L)) {
  public void execute() {      Iterator iter;            // if already know the ManagerAgent Address, then process newly announced Agents as they arrive            if (managerAddress != null) {          //********** Check for new agents on the node **********          // create conditions for all the agents that report now          Iterator iter2 = localAgentsSubscription.getAddedCollection().iterator();          while (iter2.hasNext()) {             AgentExistsCondition aec = (AgentExistsCondition) iter2.next();             addAgent(aec.getAsset());          }      }      iter = managerAddressSubscription.getAddedCollection().iterator();      if (iter.hasNext()) {          // find & set the ManagerAgent address           managerAddress = ((RobustnessManagerID)iter.next()).getMessageAddress();           if (logger.isDebugEnabled()) logger.debug("ManagerAddress: "+managerAddress.toString());          // create conditions & opmodes for the NodeAgent          createLocalCondition(getNodeID(), getNodeAddress(), managerAddress);          createRemoteCondition("Node", getNodeID(), getNodeAddress(), managerAddress);   // so we can disconnect the Node          createRemoteOpMode("Node", getNodeID(), getNodeAddress(), managerAddress);   // so we can disconnect the Node               //********** Check for new agents on the node **********          // create conditions for all the agents that reported BEFORE we found the ManagerAgent Address          Iterator iter2 = localAgentsSubscription.iterator();          while (iter2.hasNext()) {             AgentExistsCondition aec = (AgentExistsCondition) iter2.next();             addAgent(aec.getAsset());          }      }                  //********** Check for departing agents on the node & remove there conditions & opmodes **********      iter = localAgentsSubscription.getRemovedCollection().iterator();      while (iter.hasNext()) {         AgentExistsCondition aec = (AgentExistsCondition) iter.next();         if (logger.isDebugEnabled()) logger.debug("Removing "+aec.getAsset());         removeAgent(aec.getAsset());      }            //We have one local time condition, so we only get the one from iter.next();      // This was set by the DisconnectServlet for the Node      iter = localReconnectTimeSubscription.getChangedCollection().iterator();      if (iter.hasNext()) {           if (logger.isDebugEnabled()) logger.debug(localAgents.toString() + ", " + managerAddress);          if (localAgents.contains(managerAddress.toString())) {              if (eventService.isEventEnabled()) {                  eventService.event("Not allowed to Disconnect ManagementAgent on "+getNodeAddress().toString());              }              if (logger.isInfoEnabled()) {                  logger.info("Not allowed to Disconnect ManagementAgent on "+getNodeAddress().toString());              }          }          else {              if (logger.isDebugEnabled()) logger.debug("starting to process a changed LocalReconnectTimeCondition");              LocalReconnectTimeCondition lrtc = (LocalReconnectTimeCondition)iter.next();              if (logger.isDebugEnabled()) logger.debug("Found lrtc "+lrtc.getAsset());              if (lrtc != null) {                    reconnectInterval = (long) Double.parseDouble(lrtc.getValue().toString());              }              if (eventService.isEventEnabled()) {                  if (reconnectInterval > 0L)                    eventService.event("Requesting to Disconnect Node: "+getNodeID());                  else                    eventService.event("Requesting to Connect Node: "+getNodeID());                 }              ReconnectTimeCondition rtc = ReconnectTimeCondition.findOnBlackboard("Node", getNodeID(),  blackboard);              rtc.setTime(new Double(Double.parseDouble(lrtc.getValue().toString())));              rtc.setAgents(localAgents);              getBlackboardService().publishChange(rtc);              if (logger.isDebugEnabled()) logger.debug("Set the Condition for "+rtc.toString());             }      }      //********* Check for changes in our mode - there is only one ************      iter = defenseModeSubscription.getChangedCollection().iterator();      while (iter.hasNext()) {          if (noChangesYet) {                noChangesYet = false;                if (logger.isDebugEnabled()) logger.debug("Ignoring the initial Change due to handshaking");                return;  // ignore opmode changes due to handshaking          }          DisconnectDefenseAgentEnabler dmode = (DisconnectDefenseAgentEnabler)iter.next();          if (logger.isDebugEnabled()) logger.debug("Saw: "+             dmode.getClass()+":"+             dmode.getName() + " changed to " + dmode.getValue());                    if (dmode.getExpandedName().equals("Node:"+getNodeID())) {              String defenseMode = dmode.getValue().toString();              if (eventService.isEventEnabled()) {                  if (defenseMode.equals("ENABLED")) {                      eventService.event(getNodeID()+" plans to Disconnect for "+reconnectInterval/1000L+" sec");                  }                  else if (defenseMode.equals("DISABLED")){                      eventService.event(getNodeID()+" has Reconnected");                  }              }          }          // ACK that the Node has seen the action value          ReconnectTimeCondition rtc = ReconnectTimeCondition.findOnBlackboard("Node", getNodeID(),  blackboard);          rtc.setTime(new Double(-1.0));          rtc.setAgents(localAgents);          getBlackboardService().publishChange(rtc);          if (logger.isDebugEnabled()) logger.debug("Set the (ACK) Condition for "+rtc.toString());         };  }