コード例 #1
0
 @Override
 public void auditCrashed(Audit audit, Exception exception) {
   String url = "";
   if (audit.getSubject() != null) {
     url = audit.getSubject().getURL();
   }
   LOGGER.error(
       "AUDIT CRASHED:"
           + audit
           + ","
           + url
           + ","
           + (long) (audit.getDateOfCreation().getTime() / 1000),
       exception);
   Audit auditCrashed = null;
   for (Audit auditRunning : this.auditExecutionList.keySet()) {
     if (auditRunning.getId().equals(audit.getId())
         && (long) (auditRunning.getDateOfCreation().getTime() / 1000)
             == (long) (audit.getDateOfCreation().getTime() / 1000)) {
       auditCrashed = auditRunning;
       break;
     }
   }
   if (auditCrashed != null) {
     Long token = this.auditExecutionList.get(auditCrashed);
     this.auditExecutionList.remove(auditCrashed);
     this.auditCrashedList.put(token, new AbstractMap.SimpleImmutableEntry<>(audit, exception));
     this.exception = exception;
   }
 }
コード例 #2
0
 @Override
 public void auditCompleted(Audit audit) {
   LOGGER.debug(
       "AUDIT COMPLETED:"
           + audit
           + ","
           + audit.getSubject().getURL()
           + ","
           + (long) (audit.getDateOfCreation().getTime() / 1000)
           + audit.getId());
   Audit auditCompleted = null;
   for (Audit auditRunning : this.auditExecutionList.keySet()) {
     if (auditRunning.getId().equals(audit.getId())
         && (long) (auditRunning.getDateOfCreation().getTime() / 1000)
             == (long) (audit.getDateOfCreation().getTime() / 1000)) {
       auditCompleted = auditRunning;
       break;
     }
   }
   if (auditCompleted != null) {
     Long token = this.auditExecutionList.get(auditCompleted);
     this.auditExecutionList.remove(auditCompleted);
     this.auditCompletedList.put(token, audit);
   }
 }