mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 21:30:57 +00:00
Added possibility to reload a racelog from database by using a button in the gwt ui
This commit is contained in:
1 parent
4e15502d14
commit
81f9a007bb
25 files changed
+199
-23
No files matched your search
+17
-3
@@ -2,11 +2,13 @@ package com.sap.sailing.domain.persistence.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import com.mongodb.DB;
|
||||
import com.sap.sailing.domain.persistence.DomainObjectFactory;
|
||||
import com.sap.sailing.domain.persistence.MongoObjectFactory;
|
||||
import com.sap.sailing.domain.racelog.RaceLog;
|
||||
import com.sap.sailing.domain.racelog.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
|
||||
@@ -15,23 +17,35 @@ public class MongoRaceLogStoreImpl implements RaceLogStore {
|
||||
private final MongoObjectFactory mongoObjectFactory;
|
||||
private final DomainObjectFactory domainObjectFactory;
|
||||
private final Map<RaceLogIdentifier, RaceLog> raceLogCache;
|
||||
private final WeakHashMap<RaceLog, MongoRaceLogListener> listeners;
|
||||
|
||||
public MongoRaceLogStoreImpl(DB db, MongoObjectFactory mongoObjectFactory, DomainObjectFactory domainObjectFactory) {
|
||||
this.db = db;
|
||||
this.mongoObjectFactory = mongoObjectFactory;
|
||||
this.domainObjectFactory = domainObjectFactory;
|
||||
this.raceLogCache = new HashMap<>();
|
||||
this.listeners = new WeakHashMap<RaceLog, MongoRaceLogListener>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLog getRaceLog(RaceLogIdentifier identifier) {
|
||||
if (raceLogCache.containsKey(identifier)) {
|
||||
public RaceLog getRaceLog(RaceLogIdentifier identifier, boolean ignoreCache) {
|
||||
if (!ignoreCache && raceLogCache.containsKey(identifier)) {
|
||||
return raceLogCache.get(identifier);
|
||||
}
|
||||
RaceLog result = domainObjectFactory.loadRaceLog(identifier);
|
||||
result.addListener(new MongoRaceLogListener(identifier, mongoObjectFactory, db));
|
||||
MongoRaceLogListener listener = new MongoRaceLogListener(identifier, mongoObjectFactory, db);
|
||||
listeners.put(result, listener);
|
||||
result.addListener(listener);
|
||||
raceLogCache.put(identifier, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListenersAddedByStoreFrom(RaceLog raceLog) {
|
||||
RaceLogEventVisitor visitor = listeners.get(raceLog);
|
||||
if (visitor != null) {
|
||||
raceLog.removeListener(visitor);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.domain.racelog;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import com.sap.sailing.domain.common.WithID;
|
||||
import com.sap.sailing.domain.racelog.impl.RaceLogEventComparator;
|
||||
import com.sap.sailing.domain.tracking.Track;
|
||||
@@ -46,6 +48,12 @@ public interface RaceLog extends Track<RaceLogEvent>, WithID {
|
||||
*/
|
||||
void removeListener(RaceLogEventVisitor listener);
|
||||
|
||||
/**
|
||||
* Removes all listeners
|
||||
* @return
|
||||
*/
|
||||
HashSet<RaceLogEventVisitor> removeAllListeners();
|
||||
|
||||
/**
|
||||
* Checks if the race log is empty.
|
||||
*/
|
||||
@@ -54,4 +62,8 @@ public interface RaceLog extends Track<RaceLogEvent>, WithID {
|
||||
Iterable<RaceLogEvent> getRawFixesDescending();
|
||||
|
||||
Iterable<RaceLogEvent> getFixesDescending();
|
||||
|
||||
void addAllListeners(HashSet<RaceLogEventVisitor> listeners);
|
||||
|
||||
Iterable<RaceLogEventVisitor> getAllListeners();
|
||||
}
|
||||
+19
@@ -149,4 +149,23 @@ public class RaceLogImpl extends TrackImpl<RaceLogEvent> implements RaceLog {
|
||||
return getFixes().descendingSet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<RaceLogEventVisitor> removeAllListeners() {
|
||||
synchronized(listeners) {
|
||||
HashSet<RaceLogEventVisitor> clonedListeners = new HashSet<RaceLogEventVisitor>(listeners);
|
||||
listeners = new HashSet<RaceLogEventVisitor>();
|
||||
return clonedListeners;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAllListeners(HashSet<RaceLogEventVisitor> listeners) {
|
||||
this.listeners = listeners;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<RaceLogEventVisitor> getAllListeners() {
|
||||
return this.listeners;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,6 +35,8 @@ public interface RaceColumn extends Named {
|
||||
*/
|
||||
void setRaceLogInformation(RaceLogInformation information);
|
||||
|
||||
RaceLogInformation getRaceLogInformation();
|
||||
|
||||
/**
|
||||
* Gets the race column's race log associated to the passed fleet.
|
||||
*
|
||||
@@ -179,5 +181,13 @@ public interface RaceColumn extends Named {
|
||||
* @param fleet
|
||||
* @return
|
||||
*/
|
||||
RaceLogIdentifier getRaceLogIdentifier(Fleet fleet);
|
||||
RaceLogIdentifier getRaceLogIdentifier(Fleet fleet);
|
||||
|
||||
/**
|
||||
* Sets (or reloads) {@link RaceLog} for this column with the given fleet
|
||||
*
|
||||
* @param raceLogInformation
|
||||
* @param fleetImpl
|
||||
*/
|
||||
void setOrReloadRaceLogInformation(RaceLogInformation raceLogInformation, Fleet fleetImpl);
|
||||
}
|
||||
+41
-14
@@ -3,6 +3,7 @@ package com.sap.sailing.domain.base.impl;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@@ -12,8 +13,8 @@ import com.sap.sailing.domain.base.RaceColumn;
|
||||
import com.sap.sailing.domain.common.RaceIdentifier;
|
||||
import com.sap.sailing.domain.common.impl.Util;
|
||||
import com.sap.sailing.domain.racelog.RaceLog;
|
||||
import com.sap.sailing.domain.racelog.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifierTemplate;
|
||||
import com.sap.sailing.domain.racelog.RaceLogInformation;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
import com.sap.sailing.domain.racelog.impl.RaceLogIdentifierImpl;
|
||||
@@ -32,7 +33,7 @@ public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implem
|
||||
* parent object name, name of this raceColumn and the name of a fleet of this raceColumn to access the RaceLog in the
|
||||
* RaceLogStore for persistence purposes.
|
||||
*/
|
||||
private RaceLogIdentifierTemplate raceLogsIdentifierTemplate;
|
||||
private transient RaceLogInformation raceLogInformation;
|
||||
|
||||
public AbstractRaceColumn() {
|
||||
this.trackedRaces = new HashMap<Fleet, TrackedRace>();
|
||||
@@ -42,25 +43,21 @@ public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implem
|
||||
|
||||
@Override
|
||||
public synchronized void setRaceLogInformation(final RaceLogInformation information) {
|
||||
raceLogs.clear();
|
||||
raceLogsIdentifierTemplate = information.getIdentifierTemplate();
|
||||
RaceLogStore store = information.getStore();
|
||||
for (final Fleet fleet : getFleets()) {
|
||||
RaceLogIdentifier identifier = raceLogsIdentifierTemplate.compileRaceLogIdentifier(fleet);
|
||||
RaceLog raceLog = store.getRaceLog(identifier);
|
||||
raceLog.addListener(new RaceColumnRaceLogReplicator(this, identifier));
|
||||
raceLogs.put(fleet, raceLog);
|
||||
setOrReloadRaceLogInformation(information, fleet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLog getRaceLog(Fleet fleet) {
|
||||
return raceLogs.get(fleet);
|
||||
synchronized (raceLogs) {
|
||||
return raceLogs.get(fleet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogIdentifier getRaceLogIdentifier(Fleet fleet) {
|
||||
return new RaceLogIdentifierImpl(raceLogsIdentifierTemplate, getName(), fleet);
|
||||
return new RaceLogIdentifierImpl(raceLogInformation.getIdentifierTemplate(), getName(), fleet);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,7 +79,7 @@ public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implem
|
||||
}
|
||||
}
|
||||
if (previouslyLinkedRace != null) {
|
||||
RaceLogIdentifierImpl identifier = new RaceLogIdentifierImpl(raceLogsIdentifierTemplate, getName(), fleet);
|
||||
RaceLogIdentifierImpl identifier = new RaceLogIdentifierImpl(raceLogInformation.getIdentifierTemplate(), getName(), fleet);
|
||||
previouslyLinkedRace.detachRaceLog(identifier);
|
||||
getRaceColumnListeners().notifyListenersAboutTrackedRaceUnlinked(this, fleet, previouslyLinkedRace);
|
||||
}
|
||||
@@ -152,16 +149,46 @@ public abstract class AbstractRaceColumn extends SimpleAbstractRaceColumn implem
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogInformation getRaceLogInformation() {
|
||||
return raceLogInformation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrReloadRaceLogInformation(RaceLogInformation information, Fleet fleetImpl) {
|
||||
synchronized(raceLogs) {
|
||||
raceLogInformation = information;
|
||||
RaceLogStore store = information.getStore();
|
||||
HashSet<RaceLogEventVisitor> listeners = new HashSet<RaceLogEventVisitor>();
|
||||
RaceLog raceLogAvailable = raceLogs.get(fleetImpl);
|
||||
if (raceLogAvailable != null) {
|
||||
store.removeListenersAddedByStoreFrom(raceLogAvailable);
|
||||
listeners = raceLogAvailable.removeAllListeners();
|
||||
raceLogs.remove(fleetImpl);
|
||||
}
|
||||
|
||||
RaceLogIdentifier identifier = raceLogInformation.getIdentifierTemplate().compileRaceLogIdentifier(fleetImpl);
|
||||
RaceLog raceLog = store.getRaceLog(identifier, /*ignoreCache*/ true);
|
||||
|
||||
if (listeners.isEmpty()) {
|
||||
RaceColumnRaceLogReplicator listener = new RaceColumnRaceLogReplicator(this, identifier);
|
||||
raceLog.addListener(listener);
|
||||
} else {
|
||||
raceLog.addAllListeners(listeners);
|
||||
}
|
||||
raceLogs.put(fleetImpl, raceLog);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When deserializing, replication listeners are registered on all race logs.
|
||||
*/
|
||||
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
|
||||
ois.defaultReadObject();
|
||||
|
||||
for (Entry<Fleet, RaceLog> entry : raceLogs.entrySet()) {
|
||||
Fleet fleet = entry.getKey();
|
||||
RaceLog raceLog = entry.getValue();
|
||||
raceLog.addListener(new RaceColumnRaceLogReplicator(this, raceLogsIdentifierTemplate.compileRaceLogIdentifier(fleet)));
|
||||
raceLog.addListener(new RaceColumnRaceLogReplicator(this, raceLogInformation.getIdentifierTemplate().compileRaceLogIdentifier(fleet)));
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -180,4 +180,13 @@ public class MetaLeaderboardColumn extends SimpleAbstractRaceColumn implements R
|
||||
public RaceLogIdentifier getRaceLogIdentifier(Fleet fleet) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogInformation getRaceLogInformation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOrReloadRaceLogInformation(RaceLogInformation raceLogInformation, Fleet fleetImpl) {
|
||||
}
|
||||
}
|
||||
+2
@@ -34,4 +34,6 @@ public interface RaceLogIdentifierTemplate extends Serializable {
|
||||
* @param resolver the resolver that resolves this template, either for {@link Leaderboard} or for {@link Regatta}.
|
||||
*/
|
||||
void resolve(RaceLogIdentifierTemplateResolver resolver);
|
||||
|
||||
String getRaceColumnName();
|
||||
}
|
||||
@@ -34,4 +34,5 @@ public interface RaceLogInformation {
|
||||
* and {@link Fleet}
|
||||
*/
|
||||
RaceLog getRaceLog(RaceColumn raceColumn, Fleet fleet);
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.sap.sailing.domain.racelog;
|
||||
|
||||
public interface RaceLogStore {
|
||||
|
||||
RaceLog getRaceLog(RaceLogIdentifier identifier);
|
||||
RaceLog getRaceLog(RaceLogIdentifier identifier, boolean ignoreCache);
|
||||
|
||||
void removeListenersAddedByStoreFrom(RaceLog raceLogAvailable);
|
||||
|
||||
}
|
||||
+5
-1
@@ -11,7 +11,11 @@ public enum EmptyRaceLogStore implements RaceLogStore {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public RaceLog getRaceLog(RaceLogIdentifier identifier) {
|
||||
public RaceLog getRaceLog(RaceLogIdentifier identifier, boolean ignoreCache) {
|
||||
return new RaceLogImpl(UUID.randomUUID().toString(), identifier.getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListenersAddedByStoreFrom(RaceLog raceLogAvailable) {
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class RaceLogInformationImpl implements RaceLogInformation {
|
||||
|
||||
@Override
|
||||
public RaceLog getRaceLog(RaceColumn raceColumn, Fleet fleet) {
|
||||
return store.getRaceLog(identifierTemplate.compileRaceLogIdentifier(fleet));
|
||||
return store.getRaceLog(identifierTemplate.compileRaceLogIdentifier(fleet), false);
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -32,4 +32,9 @@ public class RaceLogOnLeaderboardIdentifier implements RaceLogIdentifierTemplate
|
||||
return leaderboardName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRaceColumnName() {
|
||||
return raceColumnName;
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -32,4 +32,9 @@ public class RaceLogOnRegattaIdentifier implements RaceLogIdentifierTemplate {
|
||||
return regattaName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRaceColumnName() {
|
||||
return raceColumnName;
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -17,6 +17,12 @@ interface AdminConsoleResources extends ClientBundle {
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/edit.png")
|
||||
ImageResource editIcon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/import.png")
|
||||
ImageResource importIcon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/reload.png")
|
||||
ImageResource reloadIcon();
|
||||
|
||||
@Source("com/sap/sailing/gwt/ui/client/images/link.png")
|
||||
ImageResource linkIcon();
|
||||
|
||||
|
||||
+16
@@ -492,6 +492,8 @@ public class LeaderboardConfigPanel extends FormPanel implements SelectedLeaderb
|
||||
editRaceColumnOfLeaderboard(object);
|
||||
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_UNLINK.equals(value)) {
|
||||
unlinkRaceColumnFromTrackedRace(object.getA().getRaceColumnName(), object.getB());
|
||||
} else if (LeaderboardRaceConfigImagesBarCell.ACTION_REFRESH_RACELOG.equals(value)) {
|
||||
refreshRaceLog(object.getA(), object.getB());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -675,6 +677,20 @@ public class LeaderboardConfigPanel extends FormPanel implements SelectedLeaderb
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void refreshRaceLog(final RaceColumnDTO raceColumnDTO, final FleetDTO fleet) {
|
||||
final String selectedLeaderboardName = getSelectedLeaderboardName();
|
||||
sailingService.reloadRaceLog(selectedLeaderboardName, raceColumnDTO, fleet, new AsyncCallback<Void>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
errorReporter.reportError(caught.getMessage());
|
||||
}
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
Window.alert(stringMessages.raceLogReloaded());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void removeRaceColumn(final RaceColumnDTO raceColumnDTO) {
|
||||
final String selectedLeaderboardName = getSelectedLeaderboardName();
|
||||
|
||||
+2
@@ -11,6 +11,7 @@ public class LeaderboardRaceConfigImagesBarCell extends ImagesBarCell {
|
||||
public static final String ACTION_REMOVE = "ACTION_REMOVE";
|
||||
public static final String ACTION_UNLINK = "ACTION_UNLINK";
|
||||
public static final String ACTION_EDIT = "ACTION_EDIT";
|
||||
public final static String ACTION_REFRESH_RACELOG = "ACTION_REFRESH_RACE_LOG";
|
||||
private final StringMessages stringMessages;
|
||||
private final SelectedLeaderboardProvider selectedLeaderboardProvider;
|
||||
private static AdminConsoleResources resources = GWT.create(AdminConsoleResources.class);
|
||||
@@ -31,6 +32,7 @@ public class LeaderboardRaceConfigImagesBarCell extends ImagesBarCell {
|
||||
// race columns cannot be removed from a regatta leaderboard; they need to be removed from the regatta instead
|
||||
result.add(new ImageSpec(ACTION_REMOVE, stringMessages.actionRaceRemove(), makeImagePrototype(resources.removeIcon())));
|
||||
}
|
||||
result.add(new ImageSpec(ACTION_REFRESH_RACELOG, stringMessages.refreshRaceLog(), makeImagePrototype(resources.reloadIcon())));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+4
@@ -21,7 +21,9 @@ import com.sap.sailing.domain.common.RegattaIdentifier;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.IncrementalOrFullLeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnInSeriesDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceDTO;
|
||||
import com.sap.sailing.domain.common.dto.RegattaCreationParametersDTO;
|
||||
@@ -315,4 +317,6 @@ public interface SailingService extends RemoteService {
|
||||
void stopAllReplicas();
|
||||
|
||||
void stopSingleReplicaInstance(String identifier);
|
||||
|
||||
void reloadRaceLog(String selectedLeaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet);
|
||||
}
|
||||
+5
@@ -21,7 +21,9 @@ import com.sap.sailing.domain.common.RegattaNameAndRaceName;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.domain.common.dto.CompetitorDTO;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.IncrementalOrFullLeaderboardDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnInSeriesDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceDTO;
|
||||
import com.sap.sailing.domain.common.dto.RegattaCreationParametersDTO;
|
||||
@@ -435,6 +437,9 @@ public interface SailingServiceAsync {
|
||||
void stopAllReplicas(AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void stopSingleReplicaInstance(String identifier, AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void reloadRaceLog(String selectedLeaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet,
|
||||
AsyncCallback<Void> asyncCallback);
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -689,4 +689,6 @@ public interface StringMessages extends Messages {
|
||||
String earlyStarters();
|
||||
String noMoreRacingToday();
|
||||
String furtherSignalsAshore();
|
||||
String refreshRaceLog();
|
||||
String raceLogReloaded();
|
||||
}
|
||||
+3
-1
@@ -681,4 +681,6 @@ flags=Flags
|
||||
lastUpdate=Last update
|
||||
noMoreRacingToday=No more racing today
|
||||
furtherSignalsAshore=Further signals ashore
|
||||
earlyStarters=Early starters
|
||||
earlyStarters=Early starters
|
||||
refreshRaceLog=Refresh race log
|
||||
raceLogReloaded=RaceLog successfully reloaded from database
|
||||
+3
-1
@@ -679,4 +679,6 @@ raceIsScheduled=Start angesetzt
|
||||
raceIsFinished=Beendet
|
||||
raceIsFinishing=Zieleinlauf
|
||||
raceIsRunning=Rennen läuft
|
||||
earlyStarters=Frühstarter
|
||||
earlyStarters=Frühstarter
|
||||
refreshRaceLog=RaceLog neu laden
|
||||
raceLogReloaded=RaceLog wurde neu geladen
|
||||
+5
@@ -3109,4 +3109,9 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadRaceLog(String selectedLeaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet) {
|
||||
getService().reloadRaceLog(selectedLeaderboardName, raceColumnDTO, fleet);
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 912 B |
@@ -32,6 +32,8 @@ import com.sap.sailing.domain.common.RegattaIdentifier;
|
||||
import com.sap.sailing.domain.common.RegattaName;
|
||||
import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.domain.common.impl.Util.Pair;
|
||||
import com.sap.sailing.domain.common.impl.Util.Triple;
|
||||
import com.sap.sailing.domain.common.media.MediaTrack;
|
||||
@@ -523,4 +525,6 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
|
||||
|
||||
Collection<MediaTrack> getAllMediaTracks();
|
||||
|
||||
void reloadRaceLog(String selectedLeaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet);
|
||||
|
||||
}
|
||||
+18
@@ -54,6 +54,7 @@ import com.sap.sailing.domain.common.ScoringSchemeType;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.WindSource;
|
||||
import com.sap.sailing.domain.common.dto.FleetDTO;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.domain.common.dto.RegattaCreationParametersDTO;
|
||||
import com.sap.sailing.domain.common.dto.SeriesCreationParametersDTO;
|
||||
import com.sap.sailing.domain.common.impl.Util;
|
||||
@@ -81,6 +82,7 @@ import com.sap.sailing.domain.persistence.MongoRaceLogStoreFactory;
|
||||
import com.sap.sailing.domain.persistence.media.DBMediaTrack;
|
||||
import com.sap.sailing.domain.persistence.media.MediaDB;
|
||||
import com.sap.sailing.domain.persistence.media.MediaDBFactory;
|
||||
import com.sap.sailing.domain.racelog.RaceLog;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStore;
|
||||
import com.sap.sailing.domain.swisstimingadapter.Race;
|
||||
import com.sap.sailing.domain.swisstimingadapter.SailMasterConnector;
|
||||
@@ -1957,4 +1959,20 @@ public class RacingEventServiceImpl implements RacingEventService, RegattaListen
|
||||
return "RacingEventService: " + this.hashCode() + " Build: " + BuildVersion.getBuildVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadRaceLog(String selectedLeaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet) {
|
||||
Leaderboard leaderboard = getLeaderboardByName(selectedLeaderboardName);
|
||||
if (leaderboard != null) {
|
||||
RaceColumn raceColumn = leaderboard.getRaceColumnByName(raceColumnDTO.getName());
|
||||
if (raceColumn != null) {
|
||||
Fleet fleetImpl = raceColumn.getFleetByName(fleet.getName());
|
||||
RaceLog racelog = raceColumn.getRaceLog(fleetImpl);
|
||||
if (racelog != null) {
|
||||
raceColumn.setOrReloadRaceLogInformation(raceColumn.getRaceLogInformation(), fleetImpl);
|
||||
logger.info("Reloaded race log for fleet " + fleetImpl + " for race column " + raceColumn.getName() + " for leaderboard " + leaderboard.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user