コード例 #1
0
 @Override
 public Audit auditPageUpload(
     Contract contract,
     Map<String, String> fileMap,
     String clientIp,
     Set<Parameter> parameterSet,
     Locale locale) {
   if (LOGGER.isDebugEnabled()) {
     LOGGER.debug("auditPage Upload on " + fileMap.size() + " files");
     for (Parameter param : parameterSet) {
       LOGGER.debug(
           "param "
               + param.getValue()
               + " "
               + param.getParameterElement().getParameterElementCode());
     }
   }
   Act act;
   if (fileMap.size() > 1) {
     act = createAct(contract, ScopeEnum.GROUPOFFILES, clientIp);
   } else {
     act = createAct(contract, ScopeEnum.FILE, clientIp);
   }
   AuditTimeoutThread auditPageUploadThread =
       new AuditPageUploadThread(fileMap, auditService, act, parameterSet, locale, delay);
   Audit audit = submitAuditAndLaunch(auditPageUploadThread, act);
   return audit;
 }
コード例 #2
0
 @Override
 public Audit launchAudit() {
   Audit audit = null;
   if (!pageMap.isEmpty()) {
     audit = this.getAuditService().auditPageUpload(this.pageMap, this.getParameterSet());
   }
   return audit;
 }
コード例 #3
0
 /**
  * This method initializes an act instance and persists it.
  *
  * @param contract
  * @param scope
  * @return
  */
 private Act createAct(Contract contract, ScopeEnum scope, String clientIp) {
   Date beginDate = new Date();
   Act act = actFactory.createAct(beginDate, contract);
   act.setStatus(ActStatus.RUNNING);
   act.setScope(scopeMap.get(scope));
   act.setClientIp(clientIp);
   actDataService.saveOrUpdate(act);
   return act;
 }
コード例 #4
0
 public AuditPageUploadThread(
     Map<String, String> pageMap,
     AuditService auditService,
     Act act,
     Set<Parameter> parameterSet,
     Locale locale,
     int delay) {
   super(auditService, act, parameterSet, locale, delay);
   if (pageMap != null) {
     this.pageMap.putAll(pageMap);
     LOGGER.info("Launching audit files on " + pageMap.keySet());
   }
 }
コード例 #5
0
 private void initializeScopeMap(ScopeDataService ScopeDataService) {
   for (Scope scope : ScopeDataService.findAll()) {
     scopeMap.put(scope.getCode(), scope);
   }
 }