errorMsg("commUp value not specified", out);
errorMsg("commUpStr incorrectly specified: " + commUpStr, out);
    public void execute(HttpServletRequest req, HttpServletResponse res) throws IOException {      String connectedAgentName = req.getParameter("connectedAgentName");      boolean commUp;      CommStatus cs = null;      //initialize the PrintWriter      PrintWriter out = res.getWriter();      out.println("<html><head></head><body>");      //parse the commUp      String commUpStr = req.getParameter("commUp");      if (commUpStr != null) {        try {          commUp = Boolean.getBoolean(commUpStr);        } catch (Exception ex) {          errorMsg("commUp value incorrectly specified", out);          return;        }      } else {        errorMsg("commUp value not specified", out);        return;      }      if (connectedAgentName != null) {        //iterate over the existing CommStatusObjects to see if one already exists        blackboard.openTransaction();        Collection col = blackboard.query(commStatusObjectsQuery);        for (Iterator i = col.iterator(); i.hasNext();) {          CommStatus temp = (CommStatus) i.next();          if (temp.connectedAgentName.equals(connectedAgentName)) {            cs = temp;            System.out.println("\n CSS Found matching CommStatus object for connectedAgentName: " +                               connectedAgentName);            break;          }        }        blackboard.closeTransaction();      } else {        errorMsg("ConnectedAgentName not specified", out);        return;      }      if (cs == null) { //if an existing CommStatus object was not found then create one        cs = new CommStatus(connectedAgentName);        if (commUp == false) {          cs.setCommLoss(currentTimeMillis());          System.out.println("\n CSS Setting Comm LOSS for NEW CommStatus object for connectedAgentName: " +                             connectedAgentName);        } else {          cs.setCommRestore(currentTimeMillis());          System.out.println("\n CSS Setting Comm RESTORE for NEW CommStatus object for connectedAgentName: " +                             connectedAgentName);        }        blackboard.openTransaction();        blackboard.publishAdd(cs);        blackboard.closeTransaction();      } else {  //otherwise update the existing CommStatus object        if (commUp == false) {          cs.setCommLoss(currentTimeMillis());          System.out.println("\n CSS Setting Comm LOSS for MATCHING CommStatus object for connectedAgentName: " +                             connectedAgentName);        } else {          cs.setCommRestore(currentTimeMillis());          System.out.println("\n CSS Setting Comm RESTORE for MATCHING CommStatus object for connectedAgentName: " +                             connectedAgentName);        }        blackboard.openTransaction();        blackboard.publishChange(cs);        blackboard.closeTransaction();      }      out.println("<BR>Success. </body></html>");      out.flush();    }