added canSendRequests parameter to SailMasterConnectorImpl and refactored clients accordingly; fixed startTime

This commit is contained in:
Axel Uhl
2011-11-17 14:42:16 +01:00
parent 102c607b65
commit 3b40bc6773
18 changed files with 136 additions and 69 deletions
@@ -217,16 +217,17 @@ public class SwissTimingAdapterPersistenceImpl implements SwissTimingAdapterPers
for (Race newRace : availableRaces) {
storeRace(newRace);
}
} else if(message.getRaceID() != null && cachedRaces.containsKey(message.getRaceID()) == false) {
} else if (message.getRaceID() != null && !cachedRaces.containsKey(message.getRaceID())) {
// ah, we found a new raceID which is not in the list of known races
// in order to have a more intelligent conflict resolver mechanism we will forward the resolution to a special thread later on
boolean simpleResolution = true;
if(simpleResolution) {
if (simpleResolution) {
// first check if the missing race has been created in the mean time
Race checkRace = getRace(message.getRaceID());
if(checkRace != null) {
cachedRaces.put(checkRace.getRaceID(), checkRace);
Race raceFromDB = getRace(message.getRaceID());
if (raceFromDB != null) {
cachedRaces.put(raceFromDB.getRaceID(), raceFromDB);
} else {
logger.info("Didn't find race "+message.getRaceID()+" in race DB. Adding it.");
Race newRace = SwissTimingFactory.INSTANCE.createRace(message.getRaceID(), null, null);
storeRace(newRace);
cachedRaces.put(newRace.getRaceID(), newRace);