private void runValidation(SearchResults sr) {
   todo = sr.getSize();
   done = 0;
   for (PhotoImage pid : sr.getAllObjects()) {
     for (Operation op : operations) {
       try {
         op.process(pid, errs);
       } catch (Exception e) {
         getLogger().warn("Exception on on " + op + " in " + pid.getId(), e);
         errs.add("Exception on " + op + " in " + pid.getId() + ": " + e);
       }
     }
     done++;
     if (stopRequested) {
       getLogger().info("User requested cache validation to stop.");
       break;
     }
   }
 }
 @Override
 public void run() {
   SearchForm sf = new SearchForm();
   SearchResults psr = null;
   try {
     psr = ParallelSearch.getInstance().performSearch(sf, user);
   } catch (Throwable e) {
     getLogger().warn("Could not perform search for cache validation", e);
     errs.add("Could not perform search for cache validation " + e);
   }
   if (psr != null) {
     try {
       getLogger().info("Beginning validation of %d images", psr.getSize());
       runValidation(psr);
     } catch (Throwable t) {
       getLogger().warn("Error performing cache validation", t);
       errs.add("Error performing cache validation: " + t);
     }
   }
 }