Integrate sync service

This commit is contained in:
Timo Bejan 2023-11-08 15:05:36 +02:00
parent 83c02409e9
commit 288bbf9f17

View File

@ -16,6 +16,8 @@ import com.iqser.red.service.redaction.v1.model.MigrationRequest;
import com.iqser.red.storage.commons.exception.StorageException;
import com.iqser.red.storage.commons.exception.StorageObjectDoesNotExist;
import com.iqser.red.storage.commons.service.StorageService;
import com.knecon.fforesight.databasetenantcommons.providers.TenantSyncService;
import com.knecon.fforesight.databasetenantcommons.providers.events.TenantSyncEvent;
import com.knecon.fforesight.tenantcommons.TenantContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -30,7 +32,7 @@ import static com.knecon.fforesight.service.layoutparser.internal.api.queue.Layo
@Slf4j
@Service
@RequiredArgsConstructor
public class SaasMigrationService {
public class SaasMigrationService implements TenantSyncService {
private final AutomaticAnalysisJob automaticAnalysisJob;
private final FileStatusPersistenceService fileStatusPersistenceService;
@ -45,6 +47,13 @@ public class SaasMigrationService {
private final SaasAnnotationIdMigrationService saasAnnotationIdMigrationService;
@Override
public void syncTenant(TenantSyncEvent tenantSyncEvent) {
startMigrationForTenant(tenantSyncEvent.getTenantId());
}
// Persistence-Service needs to be scaled to 1.
public void startMigrationForTenant(String tenantId) {
@ -138,4 +147,6 @@ public class SaasMigrationService {
}
}