1dd765880201475b4301f769a2b3f45916e4f04b
java/com.sap.sailing.domain.persistence/src/com/sap/sailing/domain/persistence/racelog/tracking/impl/MongoSensorFixStoreImpl.java
| ... | ... | @@ -258,7 +258,7 @@ public class MongoSensorFixStoreImpl extends MongoFixHandler implements MongoSen |
| 258 | 258 | for (FixT fix : fixes) { |
| 259 | 259 | for (FixReceivedListener<FixT> listener : listenersToInform) { |
| 260 | 260 | final Iterable<Triple<RegattaAndRaceIdentifier, Boolean, Duration>> racesWithManeuverChangeFromListener = |
| 261 | - listener.fixReceived(device, fix, returnManeuverChanges, returnLiveDelay, filterByRegattaAndEventEndDate); |
|
| 261 | + listener.fixReceived(device, fix, returnManeuverChanges, returnLiveDelay); |
|
| 262 | 262 | Util.addAll(racesWithManeuverChangeFromListener, raceWithChangedManeuver); |
| 263 | 263 | } |
| 264 | 264 | } |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/CreateAndTrackWithRaceLogTest.java
| ... | ... | @@ -8,7 +8,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; |
| 8 | 8 | |
| 9 | 9 | import java.io.FileNotFoundException; |
| 10 | 10 | import java.io.IOException; |
| 11 | -import java.io.Serializable; |
|
| 12 | 11 | import java.net.MalformedURLException; |
| 13 | 12 | import java.net.URISyntaxException; |
| 14 | 13 | import java.net.UnknownHostException; |
| ... | ... | @@ -39,7 +38,6 @@ import com.sap.sailing.domain.base.BoatClass; |
| 39 | 38 | import com.sap.sailing.domain.base.Competitor; |
| 40 | 39 | import com.sap.sailing.domain.base.CompetitorWithBoat; |
| 41 | 40 | import com.sap.sailing.domain.base.DomainFactory; |
| 42 | -import com.sap.sailing.domain.base.Event; |
|
| 43 | 41 | import com.sap.sailing.domain.base.Fleet; |
| 44 | 42 | import com.sap.sailing.domain.base.RaceColumn; |
| 45 | 43 | import com.sap.sailing.domain.base.Regatta; |
| ... | ... | @@ -54,7 +52,6 @@ import com.sap.sailing.domain.common.CompetitorRegistrationType; |
| 54 | 52 | import com.sap.sailing.domain.common.DeviceIdentifier; |
| 55 | 53 | import com.sap.sailing.domain.common.racelog.tracking.NotDenotedForRaceLogTrackingException; |
| 56 | 54 | import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl; |
| 57 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 58 | 55 | import com.sap.sailing.domain.leaderboard.RegattaLeaderboard; |
| 59 | 56 | import com.sap.sailing.domain.leaderboard.impl.HighPoint; |
| 60 | 57 | import com.sap.sailing.domain.persistence.MongoObjectFactory; |
| ... | ... | @@ -97,18 +94,6 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper { |
| 97 | 94 | private RaceLogTrackingAdapter adapter; |
| 98 | 95 | private Regatta regatta; |
| 99 | 96 | private SensorFixStore sensorFixStore; |
| 100 | - private final EventResolver dummyEventResolver = new EventResolver() { |
|
| 101 | - @Override |
|
| 102 | - public Event getEvent(Serializable id) { |
|
| 103 | - return null; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - @Override |
|
| 107 | - public Iterable<Event> getAllEvents() { |
|
| 108 | - return Collections.emptySet(); |
|
| 109 | - } |
|
| 110 | - }; |
|
| 111 | - |
|
| 112 | 97 | private long time = 0; |
| 113 | 98 | |
| 114 | 99 | @BeforeEach |
| ... | ... | @@ -239,7 +224,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper { |
| 239 | 224 | TrackedRace race = trackAndGetRace(column); |
| 240 | 225 | assertNotNull(race); |
| 241 | 226 | RaceLogFixTrackerManager raceLogFixTrackerManager = new RaceLogFixTrackerManager((DynamicTrackedRace) race, |
| 242 | - sensorFixStore, null, /* removeOutliersFromCompetitorTracks */ false, dummyEventResolver); |
|
| 227 | + sensorFixStore, null, /* removeOutliersFromCompetitorTracks */ false); |
|
| 243 | 228 | raceLogFixTrackerManager.waitForTracker(); |
| 244 | 229 | race.waitForLoadingToFinish(); |
| 245 | 230 | addFixes1(race, comp1, dev1); |
| ... | ... | @@ -315,7 +300,7 @@ public class CreateAndTrackWithRaceLogTest extends RaceLogTrackingTestHelper { |
| 315 | 300 | TrackedRace race = trackAndGetRace(column); |
| 316 | 301 | assertNotNull(race); |
| 317 | 302 | RaceLogFixTrackerManager raceLogFixTrackerManager = new RaceLogFixTrackerManager((DynamicTrackedRace) race, |
| 318 | - sensorFixStore, null, /* removeOutliersFromCompetitorTracks */ false, dummyEventResolver); |
|
| 303 | + sensorFixStore, null, /* removeOutliersFromCompetitorTracks */ false); |
|
| 319 | 304 | raceLogFixTrackerManager.waitForTracker(); |
| 320 | 305 | race.waitForLoadingToFinish(); |
| 321 | 306 | addFixes1(race, comp1, dev1); |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/DeviceMappingsAndSensorFixStoreLockingTest.java
| ... | ... | @@ -45,7 +45,7 @@ public class DeviceMappingsAndSensorFixStoreLockingTest extends AbstractGPSFixSt |
| 45 | 45 | } catch (Exception e) { |
| 46 | 46 | throw new RuntimeException(e); |
| 47 | 47 | } |
| 48 | - store.addListener((device, fix, returnManeuverChanges, returnLiveDelay, filterByRegattaAndEventEndDate) -> { |
|
| 48 | + store.addListener((device, fix, returnManeuverChanges, returnLiveDelay) -> { |
|
| 49 | 49 | return null; |
| 50 | 50 | }, deviceIdentifier); |
| 51 | 51 | } |
| ... | ... | @@ -59,7 +59,7 @@ public class DeviceMappingsAndSensorFixStoreLockingTest extends AbstractGPSFixSt |
| 59 | 59 | Map<RegattaLogDeviceMappingEvent<WithID>, MultiTimeRange> newlyCoveredTimeRanges) { |
| 60 | 60 | } |
| 61 | 61 | }; |
| 62 | - store.addListener((dev, fix, returnManeuverChanges, returnLiveDelay, filterByRegattaAndEventEndDate)-> { |
|
| 62 | + store.addListener((dev, fix, returnManeuverChanges, returnLiveDelay)-> { |
|
| 63 | 63 | try { |
| 64 | 64 | barrier.await(); |
| 65 | 65 | } catch (Exception e) { |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/GPSFixStoreListenerTest.java
| ... | ... | @@ -42,7 +42,7 @@ public class GPSFixStoreListenerTest extends AbstractGPSFixStoreTest { |
| 42 | 42 | barrier.await(100, TimeUnit.MILLISECONDS); |
| 43 | 43 | // During iteration in the main thread this causes a modification that makes the iterator throw a |
| 44 | 44 | // ConcurrentModificationException on next() |
| 45 | - store.addListener((DeviceIdentifier device, GPSFixMoving fix, boolean returnManeuverChanges, boolean returnLiveDelay, boolean filterByRegattaAndEventEndDate) -> { |
|
| 45 | + store.addListener((DeviceIdentifier device, GPSFixMoving fix, boolean returnManeuverChanges, boolean returnLiveDelay) -> { |
|
| 46 | 46 | return null; |
| 47 | 47 | }, device); |
| 48 | 48 | barrier.await(100, TimeUnit.MILLISECONDS); |
| ... | ... | @@ -71,7 +71,7 @@ public class GPSFixStoreListenerTest extends AbstractGPSFixStoreTest { |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | @Override |
| 74 | - public Iterable<Triple<RegattaAndRaceIdentifier, Boolean, Duration>> fixReceived(DeviceIdentifier device, GPSFixMoving fix, boolean returnManeuverChanges, boolean returnLiveDelay, boolean filterByRegattaAndEventEndDate) { |
|
| 74 | + public Iterable<Triple<RegattaAndRaceIdentifier, Boolean, Duration>> fixReceived(DeviceIdentifier device, GPSFixMoving fix, boolean returnManeuverChanges, boolean returnLiveDelay) { |
|
| 75 | 75 | try { |
| 76 | 76 | barrier.await(100, TimeUnit.MILLISECONDS); |
| 77 | 77 | } catch (TimeoutException e) { |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/RaceLogFixTrackerManagerTest.java
| ... | ... | @@ -2,7 +2,6 @@ package com.sap.sailing.domain.racelogtracking.test.impl; |
| 2 | 2 | |
| 3 | 3 | import static org.mockito.Mockito.mock; |
| 4 | 4 | |
| 5 | -import java.io.Serializable; |
|
| 6 | 5 | import java.net.UnknownHostException; |
| 7 | 6 | import java.util.Arrays; |
| 8 | 7 | import java.util.Collections; |
| ... | ... | @@ -29,7 +28,6 @@ import com.sap.sailing.domain.base.BoatClass; |
| 29 | 28 | import com.sap.sailing.domain.base.Competitor; |
| 30 | 29 | import com.sap.sailing.domain.base.Course; |
| 31 | 30 | import com.sap.sailing.domain.base.DomainFactory; |
| 32 | -import com.sap.sailing.domain.base.Event; |
|
| 33 | 31 | import com.sap.sailing.domain.base.Mark; |
| 34 | 32 | import com.sap.sailing.domain.base.RaceDefinition; |
| 35 | 33 | import com.sap.sailing.domain.base.Sideline; |
| ... | ... | @@ -40,7 +38,6 @@ import com.sap.sailing.domain.base.impl.RegattaImpl; |
| 40 | 38 | import com.sap.sailing.domain.base.impl.WaypointImpl; |
| 41 | 39 | import com.sap.sailing.domain.common.CompetitorRegistrationType; |
| 42 | 40 | import com.sap.sailing.domain.common.DeviceIdentifier; |
| 43 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 44 | 41 | import com.sap.sailing.domain.persistence.PersistenceFactory; |
| 45 | 42 | import com.sap.sailing.domain.persistence.racelog.tracking.impl.MongoSensorFixStoreImpl; |
| 46 | 43 | import com.sap.sailing.domain.racelog.RaceLogAndTrackedRaceResolver; |
| ... | ... | @@ -80,19 +77,6 @@ public class RaceLogFixTrackerManagerTest { |
| 80 | 77 | protected final AbstractLogEventAuthor author = new LogEventAuthorImpl("author", 0); |
| 81 | 78 | private DynamicTrackedRace trackedRace; |
| 82 | 79 | |
| 83 | - private final EventResolver dummyEventResolver = new EventResolver() { |
|
| 84 | - @Override |
|
| 85 | - public Event getEvent(Serializable id) { |
|
| 86 | - return null; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - @Override |
|
| 90 | - public Iterable<Event> getAllEvents() { |
|
| 91 | - return Collections.emptySet(); |
|
| 92 | - } |
|
| 93 | - }; |
|
| 94 | - |
|
| 95 | - |
|
| 96 | 80 | @BeforeEach |
| 97 | 81 | public void setUp() throws UnknownHostException, MongoException { |
| 98 | 82 | raceLog = new RaceLogImpl("racelog"); |
| ... | ... | @@ -132,7 +116,7 @@ public class RaceLogFixTrackerManagerTest { |
| 132 | 116 | Class<? extends RegattaLogDeviceMappingEvent<?>> eventType) { |
| 133 | 117 | throw new IllegalArgumentException("Unknown event type"); |
| 134 | 118 | } |
| 135 | - }, /* removeOutliersFromCompetitorTracks */ true, dummyEventResolver); |
|
| 119 | + }, /* removeOutliersFromCompetitorTracks */ true); |
|
| 136 | 120 | raceLogFixTrackerManager.stop(/* preemptive */ false, /* willBeRemoved */ false); |
| 137 | 121 | } |
| 138 | 122 | |
| ... | ... | @@ -151,7 +135,7 @@ public class RaceLogFixTrackerManagerTest { |
| 151 | 135 | Class<? extends RegattaLogDeviceMappingEvent<?>> eventType) { |
| 152 | 136 | throw new IllegalArgumentException("Unknown event type"); |
| 153 | 137 | } |
| 154 | - }, /* removeOutliersFromCompetitorTracks */ true, dummyEventResolver); |
|
| 138 | + }, /* removeOutliersFromCompetitorTracks */ true); |
|
| 155 | 139 | trackedRace.attachRaceLog(raceLog2); |
| 156 | 140 | raceLogFixTrackerManager.stop(/* preemptive */ false, /* willBeRemoved */ false); |
| 157 | 141 | } |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/SensorFixStoreAndLoadTest.java
| ... | ... | @@ -52,7 +52,6 @@ import com.sap.sailing.domain.base.BoatClass; |
| 52 | 52 | import com.sap.sailing.domain.base.Competitor; |
| 53 | 53 | import com.sap.sailing.domain.base.Course; |
| 54 | 54 | import com.sap.sailing.domain.base.DomainFactory; |
| 55 | -import com.sap.sailing.domain.base.Event; |
|
| 56 | 55 | import com.sap.sailing.domain.base.Mark; |
| 57 | 56 | import com.sap.sailing.domain.base.RaceDefinition; |
| 58 | 57 | import com.sap.sailing.domain.base.Sideline; |
| ... | ... | @@ -70,7 +69,6 @@ import com.sap.sailing.domain.common.tracking.GPSFixMoving; |
| 70 | 69 | import com.sap.sailing.domain.common.tracking.SensorFix; |
| 71 | 70 | import com.sap.sailing.domain.common.tracking.impl.DoubleVectorFixImpl; |
| 72 | 71 | import com.sap.sailing.domain.common.tracking.impl.GPSFixMovingImpl; |
| 73 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 74 | 72 | import com.sap.sailing.domain.persistence.PersistenceFactory; |
| 75 | 73 | import com.sap.sailing.domain.persistence.impl.CollectionNames; |
| 76 | 74 | import com.sap.sailing.domain.persistence.racelog.tracking.impl.MongoSensorFixStoreImpl; |
| ... | ... | @@ -447,16 +445,6 @@ public class SensorFixStoreAndLoadTest { |
| 447 | 445 | } |
| 448 | 446 | throw new IllegalArgumentException("Unknown event type"); |
| 449 | 447 | } |
| 450 | - }, new EventResolver() { |
|
| 451 | - @Override |
|
| 452 | - public Event getEvent(Serializable id) { |
|
| 453 | - return null; |
|
| 454 | - } |
|
| 455 | - |
|
| 456 | - @Override |
|
| 457 | - public Iterable<Event> getAllEvents() { |
|
| 458 | - return Collections.emptySet(); |
|
| 459 | - } |
|
| 460 | 448 | }, /* removeOutliersFromCompetitorTracks */ false); |
| 461 | 449 | } |
| 462 | 450 |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/SensorFixStoreTest.java
| ... | ... | @@ -211,7 +211,7 @@ public class SensorFixStoreTest { |
| 211 | 211 | FixReceivedListener<DoubleVectorFix> listener = mockFixReceivedListener(); |
| 212 | 212 | store.addListener(listener, device); |
| 213 | 213 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 214 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 214 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | @Test |
| ... | ... | @@ -221,8 +221,8 @@ public class SensorFixStoreTest { |
| 221 | 221 | store.addListener(listener1, device); |
| 222 | 222 | store.addListener(listener2, device); |
| 223 | 223 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 224 | - Mockito.verify(listener1, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 225 | - Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 224 | + Mockito.verify(listener1, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 225 | + Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | @Test |
| ... | ... | @@ -240,7 +240,7 @@ public class SensorFixStoreTest { |
| 240 | 240 | store.addListener(listener1, device); |
| 241 | 241 | store.addListener(listener2, device2); |
| 242 | 242 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 243 | - Mockito.verify(listener1, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 243 | + Mockito.verify(listener1, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 244 | 244 | Mockito.verifyNoInteractions(listener2); |
| 245 | 245 | } |
| 246 | 246 | |
| ... | ... | @@ -250,8 +250,8 @@ public class SensorFixStoreTest { |
| 250 | 250 | store.addListener(listener, device); |
| 251 | 251 | DoubleVectorFix doubleVectorFix1 = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 252 | 252 | DoubleVectorFix doubleVectorFix2 = addBravoFix(device, FIX_TIMESTAMP2, FIX_RIDE_HEIGHT2); |
| 253 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix1, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 254 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 253 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix1, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 254 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 255 | 255 | Mockito.verifyNoMoreInteractions(listener); |
| 256 | 256 | } |
| 257 | 257 | |
| ... | ... | @@ -279,7 +279,7 @@ public class SensorFixStoreTest { |
| 279 | 279 | store.addListener(listener, device); |
| 280 | 280 | store.removeListener(listener, device2); |
| 281 | 281 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 282 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 282 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | @Test |
| ... | ... | @@ -289,8 +289,8 @@ public class SensorFixStoreTest { |
| 289 | 289 | store.addListener(listener, device2); |
| 290 | 290 | DoubleVectorFix doubleVectorFix1 = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 291 | 291 | DoubleVectorFix doubleVectorFix2 = addBravoFix(device2, FIX_TIMESTAMP2, FIX_RIDE_HEIGHT2); |
| 292 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix1, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 293 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device2, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 292 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device, doubleVectorFix1, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 293 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device2, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 294 | 294 | Mockito.verifyNoMoreInteractions(listener); |
| 295 | 295 | } |
| 296 | 296 | |
| ... | ... | @@ -313,7 +313,7 @@ public class SensorFixStoreTest { |
| 313 | 313 | store.removeListener(listener, device); |
| 314 | 314 | addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 315 | 315 | DoubleVectorFix doubleVectorFix2 = addBravoFix(device2, FIX_TIMESTAMP2, FIX_RIDE_HEIGHT2); |
| 316 | - Mockito.verify(listener, Mockito.times(1)).fixReceived(device2, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 316 | + Mockito.verify(listener, Mockito.times(1)).fixReceived(device2, doubleVectorFix2, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 317 | 317 | Mockito.verifyNoMoreInteractions(listener); |
| 318 | 318 | } |
| 319 | 319 | |
| ... | ... | @@ -325,7 +325,7 @@ public class SensorFixStoreTest { |
| 325 | 325 | store.addListener(listener2, device); |
| 326 | 326 | store.removeListener(listener1); |
| 327 | 327 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 328 | - Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 328 | + Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 329 | 329 | Mockito.verifyNoMoreInteractions(listener2); |
| 330 | 330 | Mockito.verifyNoInteractions(listener1); |
| 331 | 331 | } |
| ... | ... | @@ -338,7 +338,7 @@ public class SensorFixStoreTest { |
| 338 | 338 | store.addListener(listener2, device); |
| 339 | 339 | store.removeListener(listener1, device); |
| 340 | 340 | DoubleVectorFix doubleVectorFix = addBravoFix(device, FIX_TIMESTAMP, FIX_RIDE_HEIGHT); |
| 341 | - Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
|
| 341 | + Mockito.verify(listener2, Mockito.times(1)).fixReceived(device, doubleVectorFix, /* returnManeuverChanges */ false, /* returnLiveDelay */ false); |
|
| 342 | 342 | Mockito.verifyNoMoreInteractions(listener2); |
| 343 | 343 | Mockito.verifyNoInteractions(listener1); |
| 344 | 344 | } |
java/com.sap.sailing.domain.racelogtrackingadapter.test/src/com/sap/sailing/domain/racelogtracking/test/impl/TrackedRaceLoadsFixesTest.java
| ... | ... | @@ -2,7 +2,6 @@ package com.sap.sailing.domain.racelogtracking.test.impl; |
| 2 | 2 | |
| 3 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 4 | 4 | |
| 5 | -import java.io.Serializable; |
|
| 6 | 5 | import java.net.UnknownHostException; |
| 7 | 6 | import java.util.ArrayList; |
| 8 | 7 | import java.util.Arrays; |
| ... | ... | @@ -27,7 +26,6 @@ import com.sap.sailing.domain.base.BoatClass; |
| 27 | 26 | import com.sap.sailing.domain.base.Competitor; |
| 28 | 27 | import com.sap.sailing.domain.base.Course; |
| 29 | 28 | import com.sap.sailing.domain.base.DomainFactory; |
| 30 | -import com.sap.sailing.domain.base.Event; |
|
| 31 | 29 | import com.sap.sailing.domain.base.Mark; |
| 32 | 30 | import com.sap.sailing.domain.base.RaceDefinition; |
| 33 | 31 | import com.sap.sailing.domain.base.impl.CourseImpl; |
| ... | ... | @@ -36,7 +34,6 @@ import com.sap.sailing.domain.base.impl.WaypointImpl; |
| 36 | 34 | import com.sap.sailing.domain.common.DeviceIdentifier; |
| 37 | 35 | import com.sap.sailing.domain.common.tracking.GPSFix; |
| 38 | 36 | import com.sap.sailing.domain.common.tracking.GPSFixMoving; |
| 39 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 40 | 37 | import com.sap.sailing.domain.racelogtracking.impl.SmartphoneImeiIdentifierImpl; |
| 41 | 38 | import com.sap.sailing.domain.racelogtracking.impl.fixtracker.FixLoaderAndTracker; |
| 42 | 39 | import com.sap.sailing.domain.racelogtracking.test.AbstractGPSFixStoreTest; |
| ... | ... | @@ -65,18 +62,6 @@ public class TrackedRaceLoadsFixesTest extends AbstractGPSFixStoreTest { |
| 65 | 62 | |
| 66 | 63 | private RaceDefinition raceDefinition; |
| 67 | 64 | |
| 68 | - private final EventResolver dummyEventResolver = new EventResolver() { |
|
| 69 | - @Override |
|
| 70 | - public Event getEvent(Serializable id) { |
|
| 71 | - return null; |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - @Override |
|
| 75 | - public Iterable<Event> getAllEvents() { |
|
| 76 | - return Collections.emptySet(); |
|
| 77 | - } |
|
| 78 | - }; |
|
| 79 | - |
|
| 80 | 65 | @BeforeEach |
| 81 | 66 | public void setUp() throws UnknownHostException, MongoException { |
| 82 | 67 | Map<Competitor, Boat> competitorsAndBoats = new HashMap<>(); |
| ... | ... | @@ -101,7 +86,7 @@ public class TrackedRaceLoadsFixesTest extends AbstractGPSFixStoreTest { |
| 101 | 86 | final DynamicTrackedRaceImpl trackedRace = createDynamicTrackedRace(boatClass, raceDefinition); |
| 102 | 87 | trackedRace.setStartOfTrackingReceived(new MillisecondsTimePoint(1000)); |
| 103 | 88 | trackedRace.setEndOfTrackingReceived(new MillisecondsTimePoint(2000)); |
| 104 | - new FixLoaderAndTracker(trackedRace, store, null, dummyEventResolver, /* removeOutliersFromCompetitorTracks */ false); |
|
| 89 | + new FixLoaderAndTracker(trackedRace, store, null, /* removeOutliersFromCompetitorTracks */ false); |
|
| 105 | 90 | trackedRace.attachRaceLog(raceLog); |
| 106 | 91 | trackedRace.attachRegattaLog(regattaLog); |
| 107 | 92 | trackedRace.waitForLoadingToFinish(); |
| ... | ... | @@ -140,7 +125,7 @@ public class TrackedRaceLoadsFixesTest extends AbstractGPSFixStoreTest { |
| 140 | 125 | } |
| 141 | 126 | store.storeFixes(device, fixes, /* returnManeuverUpdate */ false, /* returnLiveDelay */ false, /* filterByRegattaAndEventEndDate */ false); |
| 142 | 127 | DynamicTrackedRace trackedRace = createDynamicTrackedRace(boatClass, raceDefinition); |
| 143 | - new FixLoaderAndTracker(trackedRace, store, null, dummyEventResolver, /* removeOutliersFromCompetitorTracks */ false); |
|
| 128 | + new FixLoaderAndTracker(trackedRace, store, null, /* removeOutliersFromCompetitorTracks */ false); |
|
| 144 | 129 | raceLog.add(new RaceLogStartOfTrackingEventImpl(TimePoint.BeginningOfTime, author, 0)); |
| 145 | 130 | trackedRace.attachRaceLog(raceLog); |
| 146 | 131 | trackedRace.attachRegattaLog(regattaLog); |
| ... | ... | @@ -533,7 +518,7 @@ public class TrackedRaceLoadsFixesTest extends AbstractGPSFixStoreTest { |
| 533 | 518 | DynamicTrackedRace trackedRace = createDynamicTrackedRace(boatClass, raceDefinition); |
| 534 | 519 | trackedRace.attachRaceLog(raceLog); |
| 535 | 520 | trackedRace.attachRegattaLog(regattaLog); |
| 536 | - new FixLoaderAndTracker(trackedRace, store, null, dummyEventResolver, /* removeOutliersFromCompetitorTracks */ false); |
|
| 521 | + new FixLoaderAndTracker(trackedRace, store, null, /* removeOutliersFromCompetitorTracks */ false); |
|
| 537 | 522 | for(Consumer<DynamicTrackedRace> afterTrackingStarted : afterTrackingStartedConsumers) { |
| 538 | 523 | trackedRace.waitForLoadingToFinish(); |
| 539 | 524 | afterTrackingStarted.accept(trackedRace); |
java/com.sap.sailing.domain.racelogtrackingadapter/src/com/sap/sailing/domain/racelogtracking/impl/fixtracker/FixLoaderAndTracker.java
| ... | ... | @@ -19,7 +19,6 @@ import java.util.function.Consumer; |
| 19 | 19 | import java.util.logging.Level; |
| 20 | 20 | import java.util.logging.Logger; |
| 21 | 21 | |
| 22 | -import com.sap.sailing.domain.abstractlog.race.RaceLogEvent; |
|
| 23 | 22 | import com.sap.sailing.domain.abstractlog.regatta.MappingEventVisitor; |
| 24 | 23 | import com.sap.sailing.domain.abstractlog.regatta.RegattaLog; |
| 25 | 24 | import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEventVisitor; |
| ... | ... | @@ -31,16 +30,8 @@ import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogDeviceMapping |
| 31 | 30 | import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogDeviceMarkMappingEvent; |
| 32 | 31 | import com.sap.sailing.domain.base.Boat; |
| 33 | 32 | import com.sap.sailing.domain.base.Competitor; |
| 34 | -import com.sap.sailing.domain.base.CourseArea; |
|
| 35 | -import com.sap.sailing.domain.base.Event; |
|
| 36 | -import com.sap.sailing.domain.base.EventListener; |
|
| 37 | -import com.sap.sailing.domain.base.Fleet; |
|
| 38 | 33 | import com.sap.sailing.domain.base.Mark; |
| 39 | -import com.sap.sailing.domain.base.RaceColumn; |
|
| 40 | -import com.sap.sailing.domain.base.RaceColumnListener; |
|
| 41 | 34 | import com.sap.sailing.domain.base.Regatta; |
| 42 | -import com.sap.sailing.domain.base.Venue; |
|
| 43 | -import com.sap.sailing.domain.base.VenueListener; |
|
| 44 | 35 | import com.sap.sailing.domain.common.DeviceIdentifier; |
| 45 | 36 | import com.sap.sailing.domain.common.RegattaAndRaceIdentifier; |
| 46 | 37 | import com.sap.sailing.domain.common.TrackedRaceStatusEnum; |
| ... | ... | @@ -48,16 +39,6 @@ import com.sap.sailing.domain.common.tracking.DoubleVectorFix; |
| 48 | 39 | import com.sap.sailing.domain.common.tracking.GPSFix; |
| 49 | 40 | import com.sap.sailing.domain.common.tracking.GPSFixMoving; |
| 50 | 41 | import com.sap.sailing.domain.common.tracking.SensorFix; |
| 51 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 52 | -import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard; |
|
| 53 | -import com.sap.sailing.domain.leaderboard.HasCourseAreas; |
|
| 54 | -import com.sap.sailing.domain.leaderboard.HasCourseAreasListener; |
|
| 55 | -import com.sap.sailing.domain.leaderboard.Leaderboard; |
|
| 56 | -import com.sap.sailing.domain.leaderboard.LeaderboardGroup; |
|
| 57 | -import com.sap.sailing.domain.leaderboard.LeaderboardGroupListener; |
|
| 58 | -import com.sap.sailing.domain.leaderboard.RegattaLeaderboard; |
|
| 59 | -import com.sap.sailing.domain.leaderboard.ResultDiscardingRule; |
|
| 60 | -import com.sap.sailing.domain.racelog.RaceLogIdentifier; |
|
| 61 | 42 | import com.sap.sailing.domain.racelog.tracking.FixReceivedListener; |
| 62 | 43 | import com.sap.sailing.domain.racelog.tracking.SensorFixMapper; |
| 63 | 44 | import com.sap.sailing.domain.racelog.tracking.SensorFixStore; |
| ... | ... | @@ -194,27 +175,6 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 194 | 175 | |
| 195 | 176 | private AtomicBoolean stopRequested = new AtomicBoolean(false); |
| 196 | 177 | |
| 197 | - private final EventResolver eventResolver; |
|
| 198 | - |
|
| 199 | - /** |
|
| 200 | - * Caches the result of {@link #getEvents()} (which tells the events to which the {@link #trackedRace} is connected) |
|
| 201 | - * in the pair's {@link Pair#getB() second component} and remembers the result of |
|
| 202 | - * {@link EventResolver#getAllEvents()} from the time point when the cache contents were computed; gets invalidated |
|
| 203 | - * by any change to the leaderboard groups of any of the events in the cache, or when the {@link #trackedRace} is |
|
| 204 | - * attached or detached from any of the leaderboard columns of any of those leaderboards contained in any of those |
|
| 205 | - * leaderboard groups, or if the set of leaderboards in one of those leaderboard groups changes, or if the set of |
|
| 206 | - * all events known by the {@link #eventResolver} changes. |
|
| 207 | - */ |
|
| 208 | - private Pair<Iterable<Event>, Iterable<Event>> eventsCache; |
|
| 209 | - |
|
| 210 | - /** |
|
| 211 | - * Subscribed to {@link EventResolver#getAllEvents() all events} returned from the {@link #eventResolver} the last |
|
| 212 | - * time the {@link #eventsCache} was filled. Those are the ones kept in the {@link Pair#getA() first component} of |
|
| 213 | - * the {@link #eventsCache}. Subscribes recursively to all the {@link LeaderboardGroup}s inside those events, and |
|
| 214 | - * inside those to their {@link Leaderboard}s. |
|
| 215 | - */ |
|
| 216 | - private EventResolverListener eventResolverListener; |
|
| 217 | - |
|
| 218 | 178 | private final AbstractRaceChangeListener raceChangeListener = new AbstractRaceChangeListener() { |
| 219 | 179 | @Override |
| 220 | 180 | public void startOfTrackingChanged(TimePoint oldStartOfTracking, TimePoint newStartOfTracking) { |
| ... | ... | @@ -247,8 +207,7 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 247 | 207 | private final FixReceivedListener<Timed> listener = new FixReceivedListener<Timed>() { |
| 248 | 208 | @Override |
| 249 | 209 | public Iterable<Triple<RegattaAndRaceIdentifier, Boolean, Duration>> fixReceived(DeviceIdentifier device, |
| 250 | - Timed fix, boolean returnManeuverChanges, boolean returnLiveDelay, |
|
| 251 | - boolean filterByRegattaAndEventEndDate) { |
|
| 210 | + Timed fix, boolean returnManeuverChanges, boolean returnLiveDelay) { |
|
| 252 | 211 | final Set<RegattaAndRaceIdentifier> maneuverChanged = new HashSet<>(); |
| 253 | 212 | final Map<RegattaAndRaceIdentifier, Duration> delayToLive = new HashMap<>(); |
| 254 | 213 | if (!preemptiveStopRequested.get() && trackedRace.getStartOfTracking() != null) { |
| ... | ... | @@ -280,8 +239,7 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 280 | 239 | SensorFixMapper<SensorFix, DynamicSensorFixTrack<Competitor, SensorFix>, Competitor> mapper = sensorFixMapperFactory |
| 281 | 240 | .createCompetitorMapper((Class<? extends RegattaLogDeviceMappingEvent<?>>) event.getClass()); |
| 282 | 241 | DynamicSensorFixTrack<Competitor, SensorFix> track = mapper.getTrack(trackedRace, competitor); |
| 283 | - if (track != null && trackedRace.isWithinStartAndEndOfTracking(fix.getTimePoint()) |
|
| 284 | - && (!filterByRegattaAndEventEndDate || !excludedByRegattaOrEventsEndDates(fix.getTimePoint()))) { |
|
| 242 | + if (track != null && trackedRace.isWithinStartAndEndOfTracking(fix.getTimePoint())) { |
|
| 285 | 243 | mapper.addFix(track, (DoubleVectorFix) fix); |
| 286 | 244 | if (returnLiveDelay) { |
| 287 | 245 | delayToLive.put(trackedRace.getRaceIdentifier(), new MillisecondsDurationImpl(trackedRace.getDelayToLiveInMillis())); |
| ... | ... | @@ -373,8 +331,7 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 373 | 331 | .getLastFixAtOrBefore(startOfTracking); |
| 374 | 332 | forceFix = (fixBeforeStartOfTracking == null |
| 375 | 333 | || fixBeforeStartOfTracking.getTimePoint().before(timePoint)); |
| 376 | - } else if (endOfTracking != null && timePoint.after(endOfTracking) |
|
| 377 | - && (!filterByRegattaAndEventEndDate || !excludedByRegattaOrEventsEndDates(fix.getTimePoint()))) { |
|
| 334 | + } else if (endOfTracking != null && timePoint.after(endOfTracking)) { |
|
| 378 | 335 | // check if it is closer to the end of the tracking interval |
| 379 | 336 | GPSFix fixAfterEndOfTracking = markTrack |
| 380 | 337 | .getFirstFixAtOrAfter(endOfTracking); |
| ... | ... | @@ -395,9 +352,7 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 395 | 352 | markTrack.unlockAfterRead(); |
| 396 | 353 | } |
| 397 | 354 | } |
| 398 | - if (!filterByRegattaAndEventEndDate || !excludedByRegattaOrEventsEndDates(fix.getTimePoint())) { |
|
| 399 | - trackedRace.recordFix(mark, (GPSFix) fix, /* only when in tracking interval */ !forceFix); |
|
| 400 | - } |
|
| 355 | + trackedRace.recordFix(mark, (GPSFix) fix, /* only when in tracking interval */ !forceFix); |
|
| 401 | 356 | if (returnLiveDelay) { |
| 402 | 357 | delayToLive.put(trackedRace.getRaceIdentifier(), new MillisecondsDurationImpl(trackedRace.getDelayToLiveInMillis())); |
| 403 | 358 | } |
| ... | ... | @@ -425,189 +380,6 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 425 | 380 | } |
| 426 | 381 | }; |
| 427 | 382 | |
| 428 | - private class EventResolverListener implements EventResolver.Listener, EventListener, LeaderboardGroupListener, |
|
| 429 | - RaceColumnListener, VenueListener, HasCourseAreasListener { |
|
| 430 | - private static final long serialVersionUID = 5441115548861230410L; |
|
| 431 | - |
|
| 432 | - private void invalidateCache() { |
|
| 433 | - for (final Event oneOfOldAllEvents : eventsCache.getA()) { |
|
| 434 | - removeAsListenerFrom(oneOfOldAllEvents); |
|
| 435 | - } |
|
| 436 | - eventsCache = null; |
|
| 437 | - } |
|
| 438 | - |
|
| 439 | - private void removeAsListenerFrom(Event oneOfOldAllEvents) { |
|
| 440 | - oneOfOldAllEvents.removeEventListener(this); |
|
| 441 | - oneOfOldAllEvents.getVenue().removeListener(this); |
|
| 442 | - for (final LeaderboardGroup leaderboardGroup : oneOfOldAllEvents.getLeaderboardGroups()) { |
|
| 443 | - leaderboardGroup.removeLeaderboardGroupListener(this); |
|
| 444 | - for (final Leaderboard leaderboard : leaderboardGroup.getLeaderboards()) { |
|
| 445 | - leaderboard.removeRaceColumnListener(this); |
|
| 446 | - leaderboard.removeCourseAreaChangeListener(this); |
|
| 447 | - } |
|
| 448 | - } |
|
| 449 | - } |
|
| 450 | - |
|
| 451 | - public void addAsListenerTo(Event event) { |
|
| 452 | - event.addEventListener(this); |
|
| 453 | - event.getVenue().addListener(this); |
|
| 454 | - for (final LeaderboardGroup leaderboardGroup : event.getLeaderboardGroups()) { |
|
| 455 | - leaderboardGroup.addLeaderboardGroupListener(this); |
|
| 456 | - for (final Leaderboard leaderboard : leaderboardGroup.getLeaderboards()) { |
|
| 457 | - leaderboard.addRaceColumnListener(this); |
|
| 458 | - leaderboard.addCourseAreaChangeListener(this); |
|
| 459 | - } |
|
| 460 | - } |
|
| 461 | - } |
|
| 462 | - |
|
| 463 | - @Override |
|
| 464 | - public void trackedRaceLinked(RaceColumn raceColumn, Fleet fleet, TrackedRace trackedRace) { |
|
| 465 | - if (trackedRace == FixLoaderAndTracker.this.trackedRace) { |
|
| 466 | - invalidateCache(); |
|
| 467 | - } |
|
| 468 | - } |
|
| 469 | - |
|
| 470 | - @Override |
|
| 471 | - public void trackedRaceUnlinked(RaceColumn raceColumn, Fleet fleet, TrackedRace trackedRace) { |
|
| 472 | - if (trackedRace == FixLoaderAndTracker.this.trackedRace) { |
|
| 473 | - invalidateCache(); |
|
| 474 | - } |
|
| 475 | - } |
|
| 476 | - |
|
| 477 | - @Override |
|
| 478 | - public void isMedalRaceChanged(RaceColumn raceColumn, boolean newIsMedalRace) { |
|
| 479 | - } |
|
| 480 | - |
|
| 481 | - @Override |
|
| 482 | - public void isFleetsCanRunInParallelChanged(RaceColumn raceColumn, boolean newIsFleetsCanRunInParallel) { |
|
| 483 | - } |
|
| 484 | - |
|
| 485 | - @Override |
|
| 486 | - public void isStartsWithZeroScoreChanged(RaceColumn raceColumn, boolean newIsStartsWithZeroScore) { |
|
| 487 | - } |
|
| 488 | - |
|
| 489 | - @Override |
|
| 490 | - public void isFirstColumnIsNonDiscardableCarryForwardChanged(RaceColumn raceColumn, |
|
| 491 | - boolean firstColumnIsNonDiscardableCarryForward) { |
|
| 492 | - } |
|
| 493 | - |
|
| 494 | - @Override |
|
| 495 | - public void hasSplitFleetContiguousScoringChanged(RaceColumn raceColumn, |
|
| 496 | - boolean hasSplitFleetContiguousScoring) { |
|
| 497 | - } |
|
| 498 | - |
|
| 499 | - @Override |
|
| 500 | - public void hasCrossFleetMergedRankingChanged(RaceColumn raceColumn, boolean hasCrossFleetMergedRanking) { |
|
| 501 | - } |
|
| 502 | - |
|
| 503 | - @Override |
|
| 504 | - public void oneAlwaysStaysOneChanged(RaceColumn raceColumn, boolean oneAlwaysStaysOne) { |
|
| 505 | - } |
|
| 506 | - |
|
| 507 | - @Override |
|
| 508 | - public void raceColumnAddedToContainer(RaceColumn raceColumn) { |
|
| 509 | - invalidateCache(); |
|
| 510 | - } |
|
| 511 | - |
|
| 512 | - @Override |
|
| 513 | - public void raceColumnRemovedFromContainer(RaceColumn raceColumn) { |
|
| 514 | - invalidateCache(); |
|
| 515 | - } |
|
| 516 | - |
|
| 517 | - @Override |
|
| 518 | - public void raceColumnMoved(RaceColumn raceColumn, int newIndex) { |
|
| 519 | - } |
|
| 520 | - |
|
| 521 | - @Override |
|
| 522 | - public void raceColumnNameChanged(RaceColumn raceColumn, String oldName, String newName) { |
|
| 523 | - } |
|
| 524 | - |
|
| 525 | - @Override |
|
| 526 | - public void factorChanged(RaceColumn raceColumn, Double oldFactor, Double newFactor) { |
|
| 527 | - } |
|
| 528 | - |
|
| 529 | - @Override |
|
| 530 | - public void competitorDisplayNameChanged(Competitor competitor, String oldDisplayName, String displayName) { |
|
| 531 | - } |
|
| 532 | - |
|
| 533 | - @Override |
|
| 534 | - public void resultDiscardingRuleChanged(ResultDiscardingRule oldDiscardingRule, |
|
| 535 | - ResultDiscardingRule newDiscardingRule) { |
|
| 536 | - } |
|
| 537 | - |
|
| 538 | - @Override |
|
| 539 | - public void maximumNumberOfDiscardsChanged(Integer oldMaximumNumberOfDiscards, |
|
| 540 | - Integer newMaximumNumberOfDiscards) { |
|
| 541 | - } |
|
| 542 | - |
|
| 543 | - @Override |
|
| 544 | - public void raceLogEventAdded(RaceColumn raceColumn, RaceLogIdentifier raceLogIdentifier, RaceLogEvent event) { |
|
| 545 | - } |
|
| 546 | - |
|
| 547 | - /** |
|
| 548 | - * This listener is transient and not to be serialized to a replica. The handling of fixes happens on the |
|
| 549 | - * primary instance of a replica set only. |
|
| 550 | - */ |
|
| 551 | - @Override |
|
| 552 | - public boolean isTransient() { |
|
| 553 | - return true; |
|
| 554 | - } |
|
| 555 | - |
|
| 556 | - @Override |
|
| 557 | - public void leaderboardAdded(LeaderboardGroup group, Leaderboard leaderboard) { |
|
| 558 | - invalidateCache(); |
|
| 559 | - leaderboard.addRaceColumnListener(this); |
|
| 560 | - leaderboard.addCourseAreaChangeListener(this); |
|
| 561 | - } |
|
| 562 | - |
|
| 563 | - @Override |
|
| 564 | - public void leaderboardRemoved(LeaderboardGroup group, Leaderboard leaderboard) { |
|
| 565 | - invalidateCache(); |
|
| 566 | - leaderboard.removeRaceColumnListener(this); |
|
| 567 | - leaderboard.removeCourseAreaChangeListener(this); |
|
| 568 | - } |
|
| 569 | - |
|
| 570 | - @Override |
|
| 571 | - public void eventAdded(Event event) { |
|
| 572 | - invalidateCache(); |
|
| 573 | - event.addEventListener(this); |
|
| 574 | - } |
|
| 575 | - |
|
| 576 | - @Override |
|
| 577 | - public void eventRemoved(Event event) { |
|
| 578 | - invalidateCache(); |
|
| 579 | - event.removeEventListener(this); |
|
| 580 | - } |
|
| 581 | - |
|
| 582 | - @Override |
|
| 583 | - public void leaderboardGroupAdded(Event event, LeaderboardGroup leaderboardGroup) { |
|
| 584 | - invalidateCache(); |
|
| 585 | - leaderboardGroup.addLeaderboardGroupListener(this); |
|
| 586 | - } |
|
| 587 | - |
|
| 588 | - @Override |
|
| 589 | - public void leaderboardGroupRemoved(Event event, LeaderboardGroup leaderboardGroup) { |
|
| 590 | - invalidateCache(); |
|
| 591 | - leaderboardGroup.removeLeaderboardGroupListener(this); |
|
| 592 | - } |
|
| 593 | - |
|
| 594 | - @Override |
|
| 595 | - public void courseAreaAdded(Venue venue, CourseArea courseArea) { |
|
| 596 | - invalidateCache(); |
|
| 597 | - } |
|
| 598 | - |
|
| 599 | - @Override |
|
| 600 | - public void courseAreaRemoved(Venue venue, CourseArea courseArea) { |
|
| 601 | - invalidateCache(); |
|
| 602 | - } |
|
| 603 | - |
|
| 604 | - @Override |
|
| 605 | - public void courseAreasChanged(HasCourseAreas hasCourseAreas, Iterable<CourseArea> oldCourseAreas, |
|
| 606 | - Iterable<CourseArea> newCourseAreas) { |
|
| 607 | - invalidateCache(); |
|
| 608 | - } |
|
| 609 | - } |
|
| 610 | - |
|
| 611 | 383 | /** |
| 612 | 384 | * @param comp |
| 613 | 385 | * The resolved competitor for wich a gpsfix was just recorded. |
| ... | ... | @@ -631,12 +403,10 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 631 | 403 | } |
| 632 | 404 | |
| 633 | 405 | public FixLoaderAndTracker(DynamicTrackedRace trackedRace, SensorFixStore sensorFixStore, |
| 634 | - SensorFixMapperFactory sensorFixMapperFactory, EventResolver eventResolver, boolean removeOutliersFromCompetitorTracks) { |
|
| 406 | + SensorFixMapperFactory sensorFixMapperFactory, boolean removeOutliersFromCompetitorTracks) { |
|
| 635 | 407 | this.sensorFixStore = sensorFixStore; |
| 636 | 408 | this.sensorFixMapperFactory = sensorFixMapperFactory; |
| 637 | 409 | this.trackedRace = trackedRace; |
| 638 | - this.eventResolver = eventResolver; |
|
| 639 | - this.eventResolverListener = new EventResolverListener(); |
|
| 640 | 410 | this.removeOutliersFromCompetitorTracks = removeOutliersFromCompetitorTracks; |
| 641 | 411 | startTracking(); |
| 642 | 412 | } |
| ... | ... | @@ -674,63 +444,6 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 674 | 444 | } |
| 675 | 445 | |
| 676 | 446 | /** |
| 677 | - * Finds the {@link Regatta} and zero or more {@link Event}s to which the {@link #trackedRace} belongs and checks |
|
| 678 | - * their {@link Regatta#getEndDate() regatta end date} and {@link Event#getEndDate() event end dates}. If an end |
|
| 679 | - * date is not set, this is ignored and does not lead to the time point being considered "excluded." If multiple |
|
| 680 | - * events are found, the time point must be excluded for all of them in order to be considered excluded. In other |
|
| 681 | - * words: if one event considers this time point "in" or doesn't define an end date that would explicitly exclude |
|
| 682 | - * it, the time point is implicitly considered "in" overall. |
|
| 683 | - */ |
|
| 684 | - private boolean excludedByRegattaOrEventsEndDates(TimePoint timePoint) { |
|
| 685 | - return (getRegatta() != null && getRegatta().getEndDate() != null && timePoint.after(getRegatta().getEndDate())) |
|
| 686 | - || !Util.isEmpty(Util.filter(getEvents(), event->event.getEndDate() == null || !timePoint.after(event.getEndDate()))); |
|
| 687 | - } |
|
| 688 | - |
|
| 689 | - private Regatta getRegatta() { |
|
| 690 | - return trackedRace.getTrackedRegatta().getRegatta(); |
|
| 691 | - } |
|
| 692 | - |
|
| 693 | - private Iterable<Event> getEvents() { |
|
| 694 | - final Iterable<Event> result; |
|
| 695 | - if (eventsCache != null) { |
|
| 696 | - result = eventsCache.getB(); |
|
| 697 | - } else { |
|
| 698 | - final Regatta regatta = getRegatta(); |
|
| 699 | - regatta.addCourseAreaChangeListener(eventResolverListener); |
|
| 700 | - final Iterable<Event> allEvents = eventResolver.getAllEvents(); |
|
| 701 | - for (final Event event : allEvents) { |
|
| 702 | - eventResolverListener.addAsListenerTo(event); // removal happens upon invalidation by the listener itself |
|
| 703 | - } |
|
| 704 | - result = Util.filter(eventResolver.getAllEvents(), event->isEventContainsRegatta(event, regatta)); |
|
| 705 | - eventsCache = new Pair<>(allEvents, result); |
|
| 706 | - } |
|
| 707 | - return result; |
|
| 708 | - } |
|
| 709 | - |
|
| 710 | - /** |
|
| 711 | - * For a {@code true} answer, the {@code event} must have a {@link Venue#getCourseAreas() course area} that |
|
| 712 | - * matches that of the {@code regatta} and where that event then has a leaderboard group with a |
|
| 713 | - * {@link RegattaLeaderboard} that refers to the {@code regatta}, or otherwise another type of leaderboard |
|
| 714 | - * such as a {@link FlexibleLeaderboard} that has the {@link #trackedRace} attached. |
|
| 715 | - */ |
|
| 716 | - private boolean isEventContainsRegatta(Event event, Regatta regatta) { |
|
| 717 | - boolean result = false; |
|
| 718 | - if (Util.containsAny(event.getVenue().getCourseAreas(), regatta.getCourseAreas())) { |
|
| 719 | - for (final LeaderboardGroup leaderboardGroup : event.getLeaderboardGroups()) { |
|
| 720 | - for (final Leaderboard leaderboard : leaderboardGroup.getLeaderboards()) { |
|
| 721 | - if ((leaderboard instanceof RegattaLeaderboard && ((RegattaLeaderboard) leaderboard).getRegatta() == regatta) |
|
| 722 | - || |
|
| 723 | - (leaderboard.hasTrackedRace(trackedRace))) { |
|
| 724 | - result = true; |
|
| 725 | - break; |
|
| 726 | - } |
|
| 727 | - } |
|
| 728 | - } |
|
| 729 | - } |
|
| 730 | - return result; |
|
| 731 | - } |
|
| 732 | - |
|
| 733 | - /** |
|
| 734 | 447 | * Loads fixes defined by the given mapping and {@link MultiTimeRange}. Only those fixes that are in the mapping |
| 735 | 448 | * time range are being loaded. |
| 736 | 449 | */ |
| ... | ... | @@ -1054,8 +767,6 @@ public class FixLoaderAndTracker implements TrackingDataLoader { |
| 1054 | 767 | } |
| 1055 | 768 | } |
| 1056 | 769 | sensorFixStore.removeListener(listener); |
| 1057 | - eventResolver.removeEventResolverListener(eventResolverListener); |
|
| 1058 | - getRegatta().removeCourseAreaChangeListener(eventResolverListener); |
|
| 1059 | 770 | } |
| 1060 | 771 | |
| 1061 | 772 | private void startTracking() { |
java/com.sap.sailing.domain.racelogtrackingadapter/src/com/sap/sailing/domain/racelogtracking/impl/fixtracker/RaceLogFixTrackerManager.java
| ... | ... | @@ -11,7 +11,6 @@ import com.sap.sailing.domain.abstractlog.race.impl.BaseRaceLogEventVisitor; |
| 11 | 11 | import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent; |
| 12 | 12 | import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogTrackingStateAnalyzer; |
| 13 | 13 | import com.sap.sailing.domain.common.racelog.tracking.RaceLogTrackingState; |
| 14 | -import com.sap.sailing.domain.leaderboard.EventResolver; |
|
| 15 | 14 | import com.sap.sailing.domain.racelog.tracking.SensorFixStore; |
| 16 | 15 | import com.sap.sailing.domain.racelogsensortracking.SensorFixMapperFactory; |
| 17 | 16 | import com.sap.sailing.domain.tracking.DynamicTrackedRace; |
| ... | ... | @@ -69,12 +68,8 @@ public class RaceLogFixTrackerManager implements TrackingDataLoader { |
| 69 | 68 | } |
| 70 | 69 | }; |
| 71 | 70 | |
| 72 | - private final EventResolver eventResolver; |
|
| 73 | - |
|
| 74 | 71 | public RaceLogFixTrackerManager(DynamicTrackedRace trackedRace, SensorFixStore sensorFixStore, |
| 75 | - SensorFixMapperFactory sensorFixMapperFactory, boolean removeOutliersFromCompetitorTracks, |
|
| 76 | - EventResolver eventResolver) { |
|
| 77 | - this.eventResolver = eventResolver; |
|
| 72 | + SensorFixMapperFactory sensorFixMapperFactory, boolean removeOutliersFromCompetitorTracks) { |
|
| 78 | 73 | this.removeOutliersFromCompetitorTracks = removeOutliersFromCompetitorTracks; |
| 79 | 74 | this.trackedRace = trackedRace; |
| 80 | 75 | this.sensorFixStore = sensorFixStore; |
| ... | ... | @@ -135,7 +130,7 @@ public class RaceLogFixTrackerManager implements TrackingDataLoader { |
| 135 | 130 | private synchronized void startTrackerIfNotAlreadyStarted() { |
| 136 | 131 | if (tracker == null) { |
| 137 | 132 | logger.fine("Starting fix tracker for TrackedRace: " + trackedRace.getRaceIdentifier()); |
| 138 | - tracker = new FixLoaderAndTracker(trackedRace, sensorFixStore, sensorFixMapperFactory, eventResolver, removeOutliersFromCompetitorTracks); |
|
| 133 | + tracker = new FixLoaderAndTracker(trackedRace, sensorFixStore, sensorFixMapperFactory, removeOutliersFromCompetitorTracks); |
|
| 139 | 134 | } |
| 140 | 135 | } |
| 141 | 136 |
java/com.sap.sailing.domain.racelogtrackingadapter/src/com/sap/sailing/domain/racelogtracking/impl/fixtracker/RegattaLogFixTrackerRegattaListener.java
| ... | ... | @@ -97,8 +97,7 @@ public class RegattaLogFixTrackerRegattaListener extends AbstractTrackedRegattaA |
| 97 | 97 | if (added) { |
| 98 | 98 | RaceLogFixTrackerManager trackerManager = new RaceLogFixTrackerManager( |
| 99 | 99 | (DynamicTrackedRace) trackedRace, racingEventServiceTracker.getInitializedService(0).getSensorFixStore(), |
| 100 | - sensorFixMapperFactory, /* removeOutliersFromCompetitorTracks */ true, |
|
| 101 | - /* eventResolver */ racingEventServiceTracker.getInitializedService(0)); |
|
| 100 | + sensorFixMapperFactory, /* removeOutliersFromCompetitorTracks */ true); |
|
| 102 | 101 | RaceLogFixTrackerManager oldInstance = dataTrackers.put(raceIdentifier, trackerManager); |
| 103 | 102 | if (oldInstance != null) { |
| 104 | 103 | oldInstance.stop(/* preemptive */ true, /* willBeRemoved */ false); |
java/com.sap.sailing.domain/src/com/sap/sailing/domain/racelog/tracking/FixReceivedListener.java
| ... | ... | @@ -23,10 +23,6 @@ public interface FixReceivedListener<FixT extends Timed> { |
| 23 | 23 | * if {@code true} then all listeners to which the fix is forwarded shall check to which races the fix |
| 24 | 24 | * maps and report the live delay for all those races as the third component of the resulting |
| 25 | 25 | * {@link Triple}s. |
| 26 | - * @param filterByRegattaAndEventEndDate |
|
| 27 | - * if {@code true}, the fix's {@link Timed#getTimePoint() time point} is matched against the end date of |
|
| 28 | - * any regatta and event that this listener is responsible for; then, fixes that are newer than these end |
|
| 29 | - * dates are dropped and not recorded |
|
| 30 | 26 | * @param returnManeuverUpdate |
| 31 | 27 | * if {@code true}, all listeners to which this fix is forwarded shall check whether the fix feeds into a |
| 32 | 28 | * competitor's track in the scope of a race where for that competitor the maneuver list has changed |
| ... | ... | @@ -39,5 +35,5 @@ public interface FixReceivedListener<FixT extends Timed> { |
| 39 | 35 | * mapping is currently ambiguous. |
| 40 | 36 | */ |
| 41 | 37 | Iterable<Triple<RegattaAndRaceIdentifier, Boolean, Duration>> fixReceived(DeviceIdentifier device, FixT fix, |
| 42 | - boolean returnManeuverChanges, boolean returnLiveDelay, boolean filterByRegattaAndEventEndDate); |
|
| 38 | + boolean returnManeuverChanges, boolean returnLiveDelay); |
|
| 43 | 39 | } |
java/com.sap.sailing.domain/src/com/sap/sailing/domain/racelog/tracking/SensorFixStore.java
| ... | ... | @@ -68,7 +68,7 @@ public interface SensorFixStore { |
| 68 | 68 | * @param filterByRegattaAndEventEndDate |
| 69 | 69 | * if {@code true}, then when forwarding this fix to this store's |
| 70 | 70 | * {@link #addListener(FixReceivedListener, DeviceIdentifier) listeners}, this parameter is passed on to |
| 71 | - * {@link FixReceivedListener#fixReceived(DeviceIdentifier, Timed, boolean, boolean, boolean)}. It leads |
|
| 71 | + * {@link FixReceivedListener#fixReceived(DeviceIdentifier, Timed, boolean, boolean)}. It leads |
|
| 72 | 72 | * to the fix's {@link Timed#getTimePoint() time point} being matched against the end date of any regatta |
| 73 | 73 | * and event that this listener is responsible for; then, fixes that are newer than these end dates are |
| 74 | 74 | * dropped and not recorded |
| ... | ... | @@ -95,7 +95,7 @@ public interface SensorFixStore { |
| 95 | 95 | * @param filterByRegattaAndEventEndDate |
| 96 | 96 | * if {@code true}, then when forwarding this fix to this store's |
| 97 | 97 | * {@link #addListener(FixReceivedListener, DeviceIdentifier) listeners}, this parameter is passed on to |
| 98 | - * {@link FixReceivedListener#fixReceived(DeviceIdentifier, Timed, boolean, boolean, boolean)}. It leads |
|
| 98 | + * {@link FixReceivedListener#fixReceived(DeviceIdentifier, Timed, boolean, boolean)}. It leads |
|
| 99 | 99 | * to the fix's {@link Timed#getTimePoint() time point} being matched against the end date of any regatta |
| 100 | 100 | * and event that this listener is responsible for; then, fixes that are newer than these end dates are |
| 101 | 101 | * dropped and not recorded |