mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-17 01:31:01 +00:00
fixing bug 3448: trigger event when regatta log events are added and use to invalidate leaderboard DTO cache
Change-Id: Ib4a91d1ab8d58e07a845852cffd0f99d59b29544
This commit is contained in:
1 parent
5a5a74075b
commit
fe1bf844a8
5 files changed
+22
-1
No files matched your search
@@ -3,6 +3,7 @@ package com.sap.sailing.domain.base;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.leaderboard.ResultDiscardingRule;
|
||||
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
@@ -37,6 +38,8 @@ public interface RaceColumnListener extends Serializable {
|
||||
void resultDiscardingRuleChanged(ResultDiscardingRule oldDiscardingRule, ResultDiscardingRule newDiscardingRule);
|
||||
|
||||
void raceLogEventAdded(RaceColumn raceColumn, RaceLogIdentifier raceLogIdentifier, RaceLogEvent event);
|
||||
|
||||
default void regattaLogEventAdded(RaceColumn raceColumn, RegattaLogEvent event) {};
|
||||
|
||||
/**
|
||||
* A listener can use this to specify that it must not be serialized together with other listeners.
|
||||
|
||||
+6
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.domain.base.impl;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
@@ -94,6 +95,11 @@ public interface RaceColumnListenerWithDefaultAction extends RaceColumnListener
|
||||
defaultAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
default void regattaLogEventAdded(RaceColumn raceColumn, RegattaLogEvent event) {
|
||||
defaultAction();
|
||||
}
|
||||
|
||||
@Override
|
||||
default boolean isTransient() {
|
||||
return false;
|
||||
|
||||
@@ -504,6 +504,11 @@ public class RegattaImpl extends NamedImpl implements Regatta, RaceColumnListene
|
||||
raceColumnListeners.notifyListenersAboutRaceLogEventAdded(raceColumn, raceLogIdentifier, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void regattaLogEventAdded(RaceColumn raceColumn, RegattaLogEvent event) {
|
||||
raceColumnListeners.notifyListenersAboutRegattaLogEventAdded(raceColumn, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScoringScheme getScoringScheme() {
|
||||
return scoringScheme;
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ public class LeaderboardCacheManager {
|
||||
|
||||
@Override
|
||||
public void trackedRaceLinked(RaceColumn raceColumn, Fleet fleet, TrackedRace trackedRace) {
|
||||
removeFromCache(leaderboard);
|
||||
defaultAction();
|
||||
registerListener(leaderboard, trackedRace);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.RaceColumn;
|
||||
@@ -156,4 +157,10 @@ public class RaceColumnListeners implements Serializable {
|
||||
listener.raceLogEventAdded(raceColumn, raceLogIdentifier, event);
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyListenersAboutRegattaLogEventAdded(RaceColumn raceColumn, RegattaLogEvent event) {
|
||||
for (RaceColumnListener listener : getRaceColumnListeners()) {
|
||||
listener.regattaLogEventAdded(raceColumn, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user