mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Used i18n messages for master import sub progresses
This commit is contained in:
1 parent
b5e4528f8e
commit
05631b29b6
5 files changed
+50
-11
No files matched your search
+6
-3
@@ -1,5 +1,8 @@
|
||||
package com.sap.sailing.server.masterdata;
|
||||
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.TRANSFER_COMPLETED;
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.TRANSFER_STARTED;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
@@ -35,8 +38,8 @@ public class MasterDataImporter {
|
||||
ClassNotFoundException {
|
||||
ObjectInputStreamResolvingAgainstCache<DomainFactory> objectInputStream = racingEventService.getBaseDomainFactory()
|
||||
.createObjectInputStreamResolvingAgainstThisFactory(inputStream);
|
||||
racingEventService
|
||||
.createOrUpdateDataImportProgressWithReplication(importOperationId, 0.03, "Reading Data", 0.5);
|
||||
racingEventService.createOrUpdateDataImportProgressWithReplication(importOperationId, 0.03,
|
||||
TRANSFER_STARTED.getMessageKey(), 0.5);
|
||||
|
||||
RaceLogStore raceLogStore = MongoRaceLogStoreFactory.INSTANCE.getMongoRaceLogStore(
|
||||
racingEventService.getMongoObjectFactory(), racingEventService.getDomainObjectFactory());
|
||||
@@ -65,7 +68,7 @@ public class MasterDataImporter {
|
||||
}
|
||||
|
||||
racingEventService.createOrUpdateDataImportProgressWithReplication(importOperationId, 0.3,
|
||||
"Data-Transfer Complete, Initializing Import Operation", 0.5);
|
||||
TRANSFER_COMPLETED.getMessageKey(), 0.5);
|
||||
|
||||
applyMasterDataImportOperation(topLevelMasterData, importOperationId, override);
|
||||
}
|
||||
|
||||
+9
-4
@@ -1,5 +1,10 @@
|
||||
package com.sap.sailing.server.operationaltransformation;
|
||||
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.IMPORT_LEADERBOARD_GROUPS;
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.IMPORT_WAIT;
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.IMPORT_WIND_TRACKS;
|
||||
import static com.sap.sailing.domain.common.DataImportProgress.SubProgress.UPDATE_EVENT_LEADERBOARD_GROUP_LINKS;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.ArrayList;
|
||||
@@ -96,10 +101,10 @@ public class ImportMasterDataOperation extends
|
||||
public MasterDataImportObjectCreationCountImpl internalApplyTo(RacingEventService toState) throws Exception {
|
||||
final DataImportLockWithProgress dataImportLock = toState.getDataImportLock();
|
||||
this.progress = dataImportLock.getProgress(importOperationId);
|
||||
progress.setNameOfCurrentSubProgress("Waiting for other data import operations to finish");
|
||||
progress.setNameOfCurrentSubProgress(IMPORT_WAIT.getMessageKey());
|
||||
LockUtil.lockForWrite(dataImportLock);
|
||||
try {
|
||||
progress.setNameOfCurrentSubProgress("Importing leaderboard groups");
|
||||
progress.setNameOfCurrentSubProgress(IMPORT_LEADERBOARD_GROUPS.getMessageKey());
|
||||
progress.setCurrentSubProgressPct(0);
|
||||
int numOfGroupsToImport = masterData.getLeaderboardGroups().size();
|
||||
int i = 0;
|
||||
@@ -108,7 +113,7 @@ public class ImportMasterDataOperation extends
|
||||
i++;
|
||||
progress.setCurrentSubProgressPct((double) i / numOfGroupsToImport);
|
||||
}
|
||||
progress.setNameOfCurrentSubProgress("Updating Event-LeaderboardGroup links");
|
||||
progress.setNameOfCurrentSubProgress(UPDATE_EVENT_LEADERBOARD_GROUP_LINKS.getMessageKey());
|
||||
progress.setOverAllProgressPct(0.4);
|
||||
progress.setCurrentSubProgressPct(0);
|
||||
final Iterable<Event> allEvents = masterData.getAllEvents();
|
||||
@@ -119,7 +124,7 @@ public class ImportMasterDataOperation extends
|
||||
eventCounter++;
|
||||
progress.setCurrentSubProgressPct((double) eventCounter / numOfEventsToHandle);
|
||||
}
|
||||
progress.setNameOfCurrentSubProgress("Importing wind tracks");
|
||||
progress.setNameOfCurrentSubProgress(IMPORT_WIND_TRACKS.getMessageKey());
|
||||
progress.setOverAllProgressPct(0.5);
|
||||
progress.setCurrentSubProgressPct(0);
|
||||
createWindTracks(toState);
|
||||
|
||||
Reference in new issue
Block a user