Skip to content
Snippets Groups Projects

Ozg 7037 refactor package structure

1 unresolved thread
10 files
+ 428
290
Compare changes
  • Side-by-side
  • Inline
Files
10
@@ -21,7 +21,7 @@
@@ -21,7 +21,7 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
*/
package de.ozgcloud.archive.vorgang;
package de.ozgcloud.archive.archivierung;
import java.util.function.Consumer;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Predicate;
@@ -34,12 +34,11 @@ import org.springframework.security.core.context.SecurityContext;
@@ -34,12 +34,11 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
import de.ozgcloud.archive.ArchiveManagerConfiguration;
import de.ozgcloud.archive.ArchiveManagerConfiguration;
import de.ozgcloud.archive.attributes.ClientAttributeService;
import de.ozgcloud.archive.common.callcontext.CallContextUser;
import de.ozgcloud.archive.common.callcontext.CallContextUser;
import de.ozgcloud.archive.common.callcontext.CurrentUserService;
import de.ozgcloud.archive.common.callcontext.CurrentUserService;
import de.ozgcloud.archive.common.command.CommandService;
import de.ozgcloud.archive.common.command.CommandService;
import de.ozgcloud.archive.common.errorhandling.TimeoutException;
import de.ozgcloud.archive.common.errorhandling.TimeoutException;
import de.ozgcloud.archive.export.ExportService;
import de.ozgcloud.archive.vorgang.VorgangService;
import de.ozgcloud.command.Command;
import de.ozgcloud.command.Command;
import de.ozgcloud.command.CommandCreatedEvent;
import de.ozgcloud.command.CommandCreatedEvent;
import de.ozgcloud.command.CommandFailedEvent;
import de.ozgcloud.command.CommandFailedEvent;
@@ -69,15 +68,14 @@ class ArchiveEventListener {
@@ -69,15 +68,14 @@ class ArchiveEventListener {
@Qualifier(ArchiveManagerConfiguration.CURRENT_USER_SERVICE_NAME) // NOSONAR
@Qualifier(ArchiveManagerConfiguration.CURRENT_USER_SERVICE_NAME) // NOSONAR
private final CurrentUserService currentUserService;
private final CurrentUserService currentUserService;
@Qualifier(ArchiveManagerConfiguration.CLIENT_ATTRIBUTE_SERVICE_NAME) // NOSONAR
private final ClientAttributeService clientAttributeService;
@Qualifier(ArchiveManagerConfiguration.VORGANG_SERVICE_NAME) // NOSONAR
@Qualifier(ArchiveManagerConfiguration.VORGANG_SERVICE_NAME) // NOSONAR
private final VorgangService vorgangService;
private final VorgangService vorgangService;
private final ApplicationEventPublisher eventPublisher;
private final ApplicationEventPublisher eventPublisher;
 
 
@Qualifier(ArchiveManagerConfiguration.COMMAND_SERVICE_NAME) // NOSONAR
private final CommandService commandService;
private final CommandService commandService;
private final ExportService exportService;
private final ArchiveService archiveService;
@EventListener(condition = IS_ARCHIVE_VORGANG_EVENT)
@EventListener(condition = IS_ARCHIVE_VORGANG_EVENT)
void onArchiveVorgangEvent(CommandCreatedEvent event) {
void onArchiveVorgangEvent(CommandCreatedEvent event) {
@@ -85,14 +83,14 @@ class ArchiveEventListener {
@@ -85,14 +83,14 @@ class ArchiveEventListener {
}
}
void doLockVorgang(Command command) {
void doLockVorgang(Command command) {
clientAttributeService.setVorgangArchiving(command.getVorgangId());
archiveService.setVorgangArchiving(command.getVorgangId());
vorgangService.lockVorgang(command);
vorgangService.lockVorgang(command);
}
}
@EventListener(condition = IS_LOCKED_BY_ARCHIVE_MANAGER_EVENT)
@EventListener(condition = IS_LOCKED_BY_ARCHIVE_MANAGER_EVENT)
public void onVorgangLockedEvent(VorgangLockedEvent event) {
public void onVorgangLockedEvent(VorgangLockedEvent event) {
waitForPendingCommandsToFinish(event.getCommand().getVorgangId(), WAIT_INTERVAL);
waitForPendingCommandsToFinish(event.getCommand().getVorgangId(), WAIT_INTERVAL);
runWithSecurityContext(event.getCommand(), exportService::archiveVorgang);
runWithSecurityContext(event.getCommand(), archiveService::archiveVorgang);
}
}
void waitForPendingCommandsToFinish(String vorgangId, long waitIntervalInMillis) {
void waitForPendingCommandsToFinish(String vorgangId, long waitIntervalInMillis) {
Loading