mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 12:03:58 +00:00
Bug 4158: Implemented clearing of RaceLogs and RegattaLogs on clearState
This commit is contained in:
1 parent
69efe204d1
commit
a499f075f1
10 files changed
+50
No files matched your search
+4
@@ -144,7 +144,11 @@ public interface MongoObjectFactory {
|
||||
|
||||
void removeRaceLog(RaceLogIdentifier identifier);
|
||||
|
||||
void removeAllRaceLogs();
|
||||
|
||||
void removeRegattaLog(RegattaLikeIdentifier identifier);
|
||||
|
||||
void removeAllRegattaLogs();
|
||||
|
||||
void storeResultUrl(String resultProviderName, URL url);
|
||||
|
||||
|
||||
+10
@@ -1355,6 +1355,11 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
storeRaceLogIdentifier(identifier, query);
|
||||
getRaceLogCollection().remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllRaceLogs() {
|
||||
getRaceLogCollection().drop();;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeRegattaLog(RegattaLikeIdentifier identifier) {
|
||||
@@ -1362,6 +1367,11 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
addRegattaLikeIdentifier(identifier, query);
|
||||
getRegattaLogCollection().remove(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeAllRegattaLogs() {
|
||||
getRegattaLogCollection().drop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void storeResultUrl(String resultProviderName, URL url) {
|
||||
|
||||
+6
@@ -67,4 +67,10 @@ public class MongoRaceLogStoreImpl implements RaceLogStore {
|
||||
raceLogCache.put(identifier, raceLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
mongoObjectFactory.removeAllRaceLogs();
|
||||
raceLogCache.clear();
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -49,4 +49,10 @@ public class MongoRegattaLogStoreImpl implements RegattaLogStore {
|
||||
addListener(identifier, regattaLog);
|
||||
regattaLogCache.put(identifier, regattaLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
mongoObjectFactory.removeAllRegattaLogs();
|
||||
regattaLogCache.clear();
|
||||
}
|
||||
}
|
||||
+4
@@ -43,6 +43,10 @@ public class RegattaLogAttachOnTrackedRaceTest {
|
||||
@Override
|
||||
public void addImportedRegattaLog(RegattaLog regattaLog, RegattaLikeIdentifier identifier) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
}
|
||||
|
||||
private class MyMockedTrackedRace extends MockedTrackedRace {
|
||||
|
||||
@@ -19,5 +19,10 @@ public interface RaceLogStore {
|
||||
* Adds the mongo listener to the raceLog and adds raceLog to cache.
|
||||
*/
|
||||
void addImportedRaceLog(RaceLog raceLog, RaceLogIdentifier identifier);
|
||||
|
||||
/**
|
||||
* For Testing purposes only! Deletes all stored RaceLogs.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
}
|
||||
+4
@@ -27,4 +27,8 @@ public enum EmptyRaceLogStore implements RaceLogStore {
|
||||
@Override
|
||||
public void addImportedRaceLog(RaceLog raceLog, RaceLogIdentifier identifier) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
}
|
||||
@@ -17,4 +17,9 @@ public interface RegattaLogStore {
|
||||
* Adds the mongo listener to the regatta log and adds regatta log to cache.
|
||||
*/
|
||||
void addImportedRegattaLog(RegattaLog regattaLog, RegattaLikeIdentifier identifier);
|
||||
|
||||
/**
|
||||
* For Testing purposes only! Deletes all stored RegattaLogs.
|
||||
*/
|
||||
void clear();
|
||||
}
|
||||
+4
@@ -22,4 +22,8 @@ public enum EmptyRegattaLogStore implements RegattaLogStore {
|
||||
@Override
|
||||
public void addImportedRegattaLog(RegattaLog regattaLog, RegattaLikeIdentifier identifier) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
}
|
||||
}
|
||||
+2
@@ -733,6 +733,8 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
|
||||
// TODO clear user store? See bug 2430.
|
||||
this.competitorStore.clear();
|
||||
this.windStore.clear();
|
||||
getRaceLogStore().clear();
|
||||
getRegattaLogStore().clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user