Beispiel #1
0
 /**
  * Performs general periodic maintenance. This routine handles alle open pages/main and
  * pages/mirror file service requests. These requests are obtained from the netfiles builder. For
  * each file that should be serviced, the filechange method is called. This routine handles a
  * maximum of 10 page/main, and 50 page/mirror service calls each time it is called. The first
  * time this method is call, nothing happens (?)
  *
  * @return <code>true</code> if maintenance was performed, <code>false</code> otherwise
  */
 public boolean probeCall() {
   if (first) {
     // skip first time this method is called
     first = false;
   } else {
     // handle up to 10 pages/main fileservice requests
     try {
       Netfiles bul = (Netfiles) Vwms.getMMBase().getMMObject("netfiles");
       // Enumeration e=bul.search("WHERE service='pages' AND subservice='main' AND
       // status="+Netfiles.STATUS_REQUEST+" ORDER BY number DESC");
       Enumeration e =
           bul.search("service=='pages'+subservice=='main'+status=" + Netfiles.STATUS_REQUEST);
       int i = 0;
       while (e.hasMoreElements() && i < 10) {
         MMObjectNode node = (MMObjectNode) e.nextElement();
         fileChange("" + node.getIntValue("number"), "c");
         i++;
       }
     } catch (Exception e) {
       log.error(Logging.stackTrace(e));
     }
     // handle up to 50 pages/mirror fileservice requests
     try {
       Netfiles bul = (Netfiles) Vwms.getMMBase().getMMObject("netfiles");
       Enumeration e =
           bul.search("service=='pages'+subservice=='mirror'+status=" + Netfiles.STATUS_REQUEST);
       // Enumeration e=bul.search("WHERE service='pages' AND subservice='mirror' AND
       // status="+Netfiles.STATUS_REQUEST+" ORDER BY number DESC");
       int i = 0;
       while (e.hasMoreElements() && i < 50) {
         MMObjectNode node = (MMObjectNode) e.nextElement();
         fileChange("" + node.getIntValue("number"), "c");
         i++;
       }
     } catch (Exception e) {
       log.error(Logging.stackTrace(e));
     }
   }
   return true;
 }