@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; }
@Override public Audit launchAudit() { Audit audit = null; if (!pageMap.isEmpty()) { audit = this.getAuditService().auditPageUpload(this.pageMap, this.getParameterSet()); } return audit; }
/** * 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; }
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()); } }
private void initializeScopeMap(ScopeDataService ScopeDataService) { for (Scope scope : ScopeDataService.findAll()) { scopeMap.put(scope.getCode(), scope); } }