Bug 4158: Implemented clearing of RaceLogs and RegattaLogs on clearState

This commit is contained in:
Steffen Schaefer committed 2017-05-31 10:15:26 +02:00
1 parent 69efe204d1
commit a499f075f1
10 files changed
+50

No files matched your search

@@ -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);
@@ -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) {
@@ -67,4 +67,10 @@ public class MongoRaceLogStoreImpl implements RaceLogStore {
raceLogCache.put(identifier, raceLog);
}
@Override
public void clear() {
mongoObjectFactory.removeAllRaceLogs();
raceLogCache.clear();
}
}
@@ -49,4 +49,10 @@ public class MongoRegattaLogStoreImpl implements RegattaLogStore {
addListener(identifier, regattaLog);
regattaLogCache.put(identifier, regattaLog);
}
@Override
public void clear() {
mongoObjectFactory.removeAllRegattaLogs();
regattaLogCache.clear();
}
}