Date: Thu, 23 Jun 2016 13:18:34 +0200
Subject: [PATCH 18/36] Adjusted JavaDoc of Action classes
---
.../communication/event/GetCompetitionFormatRacesAction.java | 2 +-
.../communication/event/news/GetEventOverviewNewsAction.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
index e515991e659..7479b838571 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetCompetitionFormatRacesAction.java
@@ -20,7 +20,7 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
* {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure.
*
*
- * The {@link ResultWithTTL results} time to live
+ * The {@link ResultWithTTL result's} time to live
* {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
* state} using a duration of 1 minute for currently running events.
*
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
index 04272c223d8..98ab881102a 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
@@ -26,7 +26,7 @@ import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
* {@link #GetEventOverviewNewsAction(UUID, int) limited}.
*
*
- * The {@link ResultWithTTL results} time to live is 2 minutes for currently running events.
+ * The {@link ResultWithTTL result's} time to live is 2 minutes for currently running events.
*
*
* NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty
From d0b906f7696fce7fdf635814ffa04d7f144ed229 Mon Sep 17 00:00:00 2001
From: Benjamin Barth
Date: Thu, 23 Jun 2016 13:19:20 +0200
Subject: [PATCH 19/36] Added JavaDoc to GetEventStatisticsAction class
---
.../statistics/GetEventStatisticsAction.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java
index 345c5dfe4df..0cf3d1ccbd2 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/statistics/GetEventStatisticsAction.java
@@ -11,6 +11,16 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetEventStatisticsAction(UUID) given event-id}, using a {@link StatisticsCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetEventStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -18,6 +28,12 @@ public class GetEventStatisticsAction implements SailingAction
Date: Thu, 23 Jun 2016 13:36:44 +0200
Subject: [PATCH 20/36] Added JavaDoc to GetLiveRacesForEventAction class
---
.../event/GetLiveRacesForEventAction.java | 24 ++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
index a8a33ee4bbc..a7e88c7bb85 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
@@ -7,12 +7,28 @@ import com.sap.sailing.domain.base.Event;
import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.server.EventActionUtil;
-import com.sap.sailing.gwt.home.server.LiveRaceCalculator;
import com.sap.sailing.gwt.home.server.EventActionUtil.CalculationWithEvent;
+import com.sap.sailing.gwt.home.server.LiveRaceCalculator;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the live races section for the
+ * {@link #GetLiveRacesForEventAction(UUID) given event-id}, using a {@link LiveRaceCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal
+ * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the event.
+ *
+ *
+ * NOTE: Because there can only be live races in currently running events, this action returns an empty
+ * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
+ *
+ */
public class GetLiveRacesForEventAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -21,6 +37,12 @@ public class GetLiveRacesForEventAction implements SailingAction
Date: Thu, 23 Jun 2016 13:41:55 +0200
Subject: [PATCH 21/36] Adjusted JavaDoc of GetEventOverviewNewsAction class
---
.../communication/event/news/GetEventOverviewNewsAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
index 98ab881102a..c1a02e2ac47 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/news/GetEventOverviewNewsAction.java
@@ -31,7 +31,7 @@ import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
*
* NOTE: Because the news ticker section is only shown in currently running events, this action returns an empty
* {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
- * state-dependent} time to live, if the {@link Event} for the given id is not currently runnning.
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
*
*/
public class GetEventOverviewNewsAction implements SailingAction>>, IsClientCacheable {
From b1947fe7abda2c7a077d8c066df015fc3450607a Mon Sep 17 00:00:00 2001
From: Benjamin Barth
Date: Thu, 23 Jun 2016 13:44:43 +0200
Subject: [PATCH 22/36] Adjusted JavaDoc to GetLiveRacesForEventAction class
---
.../home/communication/event/GetLiveRacesForEventAction.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
index a7e88c7bb85..bf97c14c2b9 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForEventAction.java
@@ -41,7 +41,7 @@ public class GetLiveRacesForEventAction implements SailingAction
Date: Thu, 23 Jun 2016 13:44:56 +0200
Subject: [PATCH 23/36] Added JavaDoc to GetLiveRacesForRegattaAction class
---
.../event/GetLiveRacesForRegattaAction.java | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java
index a112a3ce858..ebee5ed0bf5 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetLiveRacesForRegattaAction.java
@@ -7,12 +7,28 @@ import com.sap.sailing.domain.base.Event;
import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.server.EventActionUtil;
-import com.sap.sailing.gwt.home.server.LiveRaceCalculator;
import com.sap.sailing.gwt.home.server.EventActionUtil.CalculationWithEvent;
+import com.sap.sailing.gwt.home.server.LiveRaceCalculator;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the live races section for the
+ * {@link #GetLiveRacesForRegattaAction(UUID, String) given event-id and regatta name}, using a
+ * {@link LiveRaceCalculator} to prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is calculated using the {@link LiveRaceCalculator}'s internal
+ * {@link com.sap.sailing.gwt.home.server.RaceRefreshCalculator}, which is called for every race in the regatta.
+ *
+ *
+ * NOTE: Because there can only be live races in currently running events, this action returns an empty
+ * {@link ResultWithTTL result} with a {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState)
+ * state-dependent} time to live, if the {@link Event} for the given id is not currently running.
+ *
+ */
public class GetLiveRacesForRegattaAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -21,7 +37,13 @@ public class GetLiveRacesForRegattaAction implements SailingAction
Date: Thu, 23 Jun 2016 13:47:08 +0200
Subject: [PATCH 24/36] Added JavaDoc to GetSeriesStatisticsAction class
---
.../event/GetSeriesStatisticsAction.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java
index 798a0030ff6..cdf42083f65 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetSeriesStatisticsAction.java
@@ -6,12 +6,23 @@ import com.google.gwt.core.shared.GwtIncompatible;
import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.communication.event.statistics.EventStatisticsDTO;
+import com.sap.sailing.gwt.home.communication.event.statistics.GetEventStatisticsAction;
import com.sap.sailing.gwt.home.server.EventActionUtil;
import com.sap.sailing.gwt.home.server.StatisticsCalculator;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetSeriesStatisticsAction(UUID) given series-id}, using a {@link StatisticsCalculator} to prepare the
+ * appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetSeriesStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID seriesId;
@@ -19,6 +30,12 @@ public class GetSeriesStatisticsAction implements SailingAction
Date: Thu, 23 Jun 2016 14:45:56 +0200
Subject: [PATCH 25/36] Added JavaDoc to GetRegattaStatisticsAction class
---
.../event/GetRegattaStatisticsAction.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java
index a535f468449..91bb37fb0ff 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaStatisticsAction.java
@@ -12,6 +12,16 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the statistics sections for the
+ * {@link #GetRegattaStatisticsAction(UUID) given event- and regatta-id}, using a {@link StatisticsCalculator} to prepare
+ * the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 5 minutes.
+ *
+ */
public class GetRegattaStatisticsAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -20,6 +30,12 @@ public class GetRegattaStatisticsAction implements SailingAction
Date: Thu, 23 Jun 2016 15:12:33 +0200
Subject: [PATCH 26/36] Added JavaDoc to GetRegattaListViewAction class
---
.../event/GetRegattaListViewAction.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java
index 988f09cf788..5b2ab095212 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaListViewAction.java
@@ -9,13 +9,24 @@ import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.communication.regatta.RegattaWithProgressDTO;
import com.sap.sailing.gwt.home.server.EventActionUtil;
-import com.sap.sailing.gwt.home.server.LeaderboardContext;
import com.sap.sailing.gwt.home.server.EventActionUtil.LeaderboardCallback;
+import com.sap.sailing.gwt.home.server.LeaderboardContext;
import com.sap.sse.common.Duration;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown on the event overview or regattas page for the
+ * {@link #GetRegattaListViewAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 3 minutes for currently running events.
+ *
+ */
public class GetRegattaListViewAction implements SailingAction>>,
IsClientCacheable {
private UUID eventId;
@@ -24,6 +35,12 @@ public class GetRegattaListViewAction implements SailingAction
Date: Thu, 23 Jun 2016 15:24:15 +0200
Subject: [PATCH 27/36] Added JavaDoc to GetMediaForEventAction class
---
.../communication/media/GetMediaForEventAction.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java
index 1d8f165e52b..068c4662fad 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/media/GetMediaForEventAction.java
@@ -15,6 +15,12 @@ import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
import com.sap.sse.shared.media.ImageDescriptor;
import com.sap.sse.shared.media.VideoDescriptor;
+/**
+ *
+ * {@link SailingAction} implementation to load images and videos to be shown on the media page for the
+ * {@link #GetMediaForEventAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ */
public class GetMediaForEventAction implements SailingAction, IsClientCacheable {
private UUID eventId;
@@ -23,6 +29,12 @@ public class GetMediaForEventAction implements SailingAction, IsClient
private GetMediaForEventAction() {
}
+ /**
+ * Creates a {@link GetMediaForEventAction} instance for the given event-id.
+ *
+ * @param eventId
+ * {@link UUID} of the event to load media for
+ */
public GetMediaForEventAction(UUID eventId) {
this.eventId = eventId;
}
From fae45d7b8d8cd97011802d49914595d8a3db3568 Mon Sep 17 00:00:00 2001
From: Benjamin Barth
Date: Thu, 23 Jun 2016 15:26:46 +0200
Subject: [PATCH 28/36] Added JavaDoc to GetFinishedRacesAction class
---
.../event/GetFinishedRacesAction.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
index ee5a8df3853..c172a7d24a1 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetFinishedRacesAction.java
@@ -12,6 +12,18 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
import com.sap.sse.gwt.dispatch.shared.commands.SortedSetResult;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in the finished races section for the
+ * {@link #GetFinishedRacesAction(UUID, String) given event- and regatta-id}, using a {@link RaceListDataCalculator} to
+ * prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 5 minutes for currently running events.
+ *
+ */
public class GetFinishedRacesAction implements SailingAction>>,
IsClientCacheable {
@@ -22,6 +34,12 @@ public class GetFinishedRacesAction implements SailingAction
Date: Thu, 23 Jun 2016 15:42:00 +0200
Subject: [PATCH 29/36] Added JavaDoc to GetMiniLeaderbordAction class
---
.../GetMiniLeaderbordAction.java | 32 +++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java
index 5d52c29be34..63e3009e902 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniLeaderbordAction.java
@@ -3,12 +3,24 @@ package com.sap.sailing.gwt.home.communication.event.minileaderboard;
import java.util.UUID;
import com.google.gwt.core.shared.GwtIncompatible;
+import com.sap.sailing.domain.base.Event;
import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.server.EventActionUtil;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the event overview
+ * page) for the {@link #GetMiniLeaderbordAction(UUID, String) given event-id and leaderboard name}, where the amount of
+ * loaded entries can optionally be {@link #GetMiniLeaderbordAction(UUID, String, int) limited}.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes
+ * otherwise.
+ *
+ */
public class GetMiniLeaderbordAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
private String leaderboardName;
@@ -18,10 +30,30 @@ public class GetMiniLeaderbordAction implements SailingAction
Date: Thu, 23 Jun 2016 15:42:09 +0200
Subject: [PATCH 30/36] Added JavaDoc to GetMiniOverallLeaderbordAction class
---
.../GetMiniOverallLeaderbordAction.java | 31 +++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java
index d45f934f47d..2cc74bd6d58 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/minileaderboard/GetMiniOverallLeaderbordAction.java
@@ -9,6 +9,17 @@ import com.sap.sailing.gwt.home.server.EventActionUtil;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown in compact leaderboard (e.g. on the series overview
+ * page) for the {@link #GetMiniOverallLeaderbordAction(UUID) given series-id}, where the amount of loaded entries can
+ * optionally be {@link #GetMiniOverallLeaderbordAction(UUID, int) limited}.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 1 minute for currently running events, 2 minutes
+ * otherwise.
+ *
+ */
public class GetMiniOverallLeaderbordAction implements SailingAction>, IsClientCacheable {
private UUID seriesId;
private int limit = 0;
@@ -17,10 +28,26 @@ public class GetMiniOverallLeaderbordAction implements SailingAction
Date: Thu, 23 Jun 2016 15:45:46 +0200
Subject: [PATCH 31/36] Added JavaDoc to GetRegattaWithProgressAction class
---
.../event/GetRegattaWithProgressAction.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java
index 6b461b9ee75..f8ac271c946 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattaWithProgressAction.java
@@ -7,10 +7,23 @@ import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.communication.regatta.RegattaWithProgressDTO;
import com.sap.sailing.gwt.home.server.EventActionUtil;
+import com.sap.sailing.gwt.home.server.RaceCompetitionFormatDataCalculator;
import com.sap.sse.common.Duration;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown on the regatta overview page for the
+ * {@link #GetRegattaWithProgressAction(UUID, String) given event- and regatta-id}, using a
+ * {@link RaceCompetitionFormatDataCalculator} to prepare the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live
+ * {@link EventActionUtil#getEventStateDependentTTL(SailingDispatchContext, UUID, Duration) depends on the event's
+ * state} using a duration of 5 minutes for currently running events.
+ *
+ */
public class GetRegattaWithProgressAction implements SailingAction>, IsClientCacheable {
private UUID eventId;
@@ -20,6 +33,12 @@ public class GetRegattaWithProgressAction implements SailingAction
Date: Thu, 23 Jun 2016 15:50:32 +0200
Subject: [PATCH 32/36] Added JavaDoc to GetRecentEventsAction class
---
.../communication/start/GetRecentEventsAction.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
index 1084608c5ad..64cd78cb6d0 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/start/GetRecentEventsAction.java
@@ -15,6 +15,12 @@ import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ListResult;
import com.sap.sse.gwt.dispatch.shared.exceptions.DispatchException;
+/**
+ *
+ * {@link SailingAction} implementation to load recent events to be shown in the event list overview, where
+ * the amount of loaded entries can be {@link #GetRecentEventsAction(int) limited}.
+ *
+ */
public class GetRecentEventsAction implements SailingAction>, IsClientCacheable {
private int limit;
@@ -22,6 +28,12 @@ public class GetRecentEventsAction implements SailingAction
Date: Thu, 23 Jun 2016 15:58:35 +0200
Subject: [PATCH 33/36] Added JavaDoc to GetRegattasAndLiveRacesForEventAction
class
---
...GetRegattasAndLiveRacesForEventAction.java | 20 +++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java
index bfdd248db4a..3a1c3acfff4 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/communication/event/GetRegattasAndLiveRacesForEventAction.java
@@ -13,15 +13,25 @@ import com.sap.sailing.gwt.home.communication.SailingAction;
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
import com.sap.sailing.gwt.home.communication.eventview.RegattaMetadataDTO;
import com.sap.sailing.gwt.home.server.EventActionUtil;
-import com.sap.sailing.gwt.home.server.LeaderboardContext;
-import com.sap.sailing.gwt.home.server.RaceContext;
import com.sap.sailing.gwt.home.server.EventActionUtil.LeaderboardCallback;
import com.sap.sailing.gwt.home.server.EventActionUtil.RaceCallback;
+import com.sap.sailing.gwt.home.server.LeaderboardContext;
+import com.sap.sailing.gwt.home.server.RaceContext;
import com.sap.sailing.gwt.server.HomeServiceUtil;
import com.sap.sse.common.Duration;
import com.sap.sse.gwt.dispatch.shared.caching.IsClientCacheable;
import com.sap.sse.gwt.dispatch.shared.commands.ResultWithTTL;
+/**
+ *
+ * {@link SailingAction} implementation to load data to be shown on the mobile event overview page for the
+ * {@link #GetRegattasAndLiveRacesForEventAction(UUID) given event-id}, preparing the appropriate data structure.
+ *
+ *
+ * The {@link ResultWithTTL result's} time to live is 2 minutes for upcoming and currently running events,
+ * otherwise it {@link EventActionUtil#calculateTtlForNonLiveEvent(Event, EventState) depends on the event's state}.
+ *
+ */
public class GetRegattasAndLiveRacesForEventAction implements SailingAction>,
IsClientCacheable {
private UUID eventId;
@@ -30,6 +40,12 @@ public class GetRegattasAndLiveRacesForEventAction implements SailingAction
Date: Thu, 23 Jun 2016 19:48:09 +0200
Subject: [PATCH 34/36] fixing ArrayIndexOutOfBoundsException for empty
"series" name in case of FlexibleLeaderboard
Change-Id: I6986f8921315b248d57cabc449e40adb1ea95eab
---
.../multiregattalist/MultiRegattaListStepsBody.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
index 8c17c07a6b9..02b6dd8281e 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
@@ -101,7 +101,11 @@ public class MultiRegattaListStepsBody extends UIObject implements RequiresResiz
String[] tokens = seriesName.split(" ");
StringBuilder initials = new StringBuilder();
for (int i = 0; i < tokens.length; i++) {
- initials.append(tokens[i].charAt(0));
+ if (tokens[i].isEmpty()) {
+ initials.append('R');
+ } else {
+ initials.append(tokens[i].charAt(0));
+ }
}
return initials.toString();
}
From 22d52a2b08ff5a4a866f7e04415963344929406f Mon Sep 17 00:00:00 2001
From: Axel Uhl
Date: Thu, 23 Jun 2016 19:49:19 +0200
Subject: [PATCH 35/36] added comment
Change-Id: Ic86d139bebcc7d4bb8ebefbe2b8229b968748d19
---
.../partials/multiregattalist/MultiRegattaListStepsBody.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
index 02b6dd8281e..fe6c724afe0 100644
--- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
+++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/partials/multiregattalist/MultiRegattaListStepsBody.java
@@ -101,7 +101,7 @@ public class MultiRegattaListStepsBody extends UIObject implements RequiresResiz
String[] tokens = seriesName.split(" ");
StringBuilder initials = new StringBuilder();
for (int i = 0; i < tokens.length; i++) {
- if (tokens[i].isEmpty()) {
+ if (tokens[i].isEmpty()) { // this may happen, e.g., in case of a FlexibleLeaderboard that does not have a series
initials.append('R');
} else {
initials.append(tokens[i].charAt(0));
From 6054ad9010262d9c0633ee851f050b767037ec51 Mon Sep 17 00:00:00 2001
From: Axel Uhl
Date: Thu, 23 Jun 2016 20:09:13 +0200
Subject: [PATCH 36/36] dependent start time updates now correctly set the race
start time and notify listeners appropriately
Change-Id: I3f458c5dabf9da78581e786e35a01bc571d5d4cd
---
.../test/RaceLogAttachOnTrackedRaceTest.java | 4 +-
.../sailing/domain/test/TrackBasedTest.java | 22 +++++-
...rtTimeUpdateForDependentStartTimeTest.java | 78 +++++++++++++++++++
.../domain/test/mock/MockedTrackedRace.java | 3 +-
...ockedTrackedRaceWithStartTimeAndRanks.java | 3 +-
.../sailing/domain/tracking/TrackedRace.java | 4 +-
.../tracking/impl/DynamicTrackedRaceImpl.java | 42 +++++++++-
.../domain/tracking/impl/TrackedRaceImpl.java | 13 ++--
.../gwt/ui/test/MockedTrackedRace.java | 3 +-
.../server/masterdata/DummyTrackedRace.java | 3 +-
10 files changed, 159 insertions(+), 16 deletions(-)
create mode 100644 java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackedRaceStartTimeUpdateForDependentStartTimeTest.java
diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/RaceLogAttachOnTrackedRaceTest.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/RaceLogAttachOnTrackedRaceTest.java
index 109c3c3336c..221c11d3d66 100644
--- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/RaceLogAttachOnTrackedRaceTest.java
+++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/RaceLogAttachOnTrackedRaceTest.java
@@ -26,8 +26,10 @@ public class RaceLogAttachOnTrackedRaceTest {
private RaceLog raceLog;
@Override
- public void detachRaceLog(Serializable identifier) {
+ public RaceLog detachRaceLog(Serializable identifier) {
+ final RaceLog result = this.raceLog;
this.raceLog = null;
+ return result;
}
@Override
diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackBasedTest.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackBasedTest.java
index 19a0138cafe..6dcd56beed5 100755
--- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackBasedTest.java
+++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackBasedTest.java
@@ -121,6 +121,26 @@ public abstract class TrackBasedTest {
*/
public static DynamicTrackedRaceImpl createTestTrackedRace(String regattaName, String raceName, String boatClassName,
Iterable competitors, TimePoint timePointForFixes, boolean useMarkPassingCalculator) {
+ return createTestTrackedRace(regattaName, raceName, boatClassName, competitors, timePointForFixes, useMarkPassingCalculator,
+ mock(RaceLogResolver.class));
+ }
+ /**
+ * Creates a simple two-lap upwind-downwind course for a race/event with given name and boat class name with the
+ * competitors specified. The marks are laid out such that the upwind/downwind leg detection should be alright. The
+ * start line equals the finish line and the leeward gate. Wind is coming from the north. A single wind fix with
+ * bearing 180deg (from=0deg) is added to the {@link WindSourceType#WEB} wind track using
+ * timePointForFixes as time point. The leeward gate is located at N54.4680424, E10.234451 and
+ * N54.4680424, E10.24. The windward mark is located at N54.48, E10.24.
+ * @param timePointForFixes
+ * a wind fix will be inserted into the {@link WindSourceType#WEB} wind track which is aligned with the
+ * course layout; the value of this parameter will be used as the time stamp for this wind fix. Using a
+ * time that is reasonably within the race time (mark passing times or whatever is collected for the
+ * tracked race returned by this method) is important because otherwise confidences of wind readouts may
+ * be ridiculously low.
+ * @param useMarkPassingCalculator whether or not to use the internal mark passing calculator
+ */
+ public static DynamicTrackedRaceImpl createTestTrackedRace(String regattaName, String raceName, String boatClassName,
+ Iterable competitors, TimePoint timePointForFixes, boolean useMarkPassingCalculator, RaceLogResolver raceLogResolver) {
BoatClassImpl boatClass = new BoatClassImpl(boatClassName, /* typicallyStartsUpwind */ true);
Regatta regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, EmptyRegattaLogStore.INSTANCE,
RegattaImpl.getDefaultName(regattaName, boatClass.getName()), boatClass, /*startDate*/ null, /*endDate*/ null, /* trackedRegattaRegistry */ null,
@@ -143,7 +163,7 @@ public abstract class TrackBasedTest {
EmptyGPSFixStore.INSTANCE, /* delayToLiveInMillis */ 0,
/* millisecondsOverWhichToAverageWind */ 30000, /* millisecondsOverWhichToAverageSpeed */ 30000,
/* delay for wind estimation cache invalidation */ 0, useMarkPassingCalculator,
- OneDesignRankingMetric::new, mock(RaceLogResolver.class));
+ OneDesignRankingMetric::new, raceLogResolver);
// in this simplified artificial course, the top mark is exactly north of the right leeward gate
DegreePosition topPosition = new DegreePosition(54.48, 10.24);
TimePoint afterTheRace = new MillisecondsTimePoint(timePointForFixes.asMillis() + 36000000); // 10h after the fix timed
diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackedRaceStartTimeUpdateForDependentStartTimeTest.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackedRaceStartTimeUpdateForDependentStartTimeTest.java
new file mode 100644
index 00000000000..af8f1c0cee5
--- /dev/null
+++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/TrackedRaceStartTimeUpdateForDependentStartTimeTest.java
@@ -0,0 +1,78 @@
+package com.sap.sailing.domain.test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Collections;
+
+import org.junit.Test;
+
+import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
+import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
+import com.sap.sailing.domain.abstractlog.race.RaceLog;
+import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
+import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
+import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
+import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
+import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
+import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
+import com.sap.sailing.domain.base.Competitor;
+import com.sap.sailing.domain.tracking.StartTimeChangedListener;
+import com.sap.sailing.domain.tracking.TrackedRace;
+import com.sap.sse.common.Duration;
+import com.sap.sse.common.TimePoint;
+import com.sap.sse.common.impl.MillisecondsTimePoint;
+
+public class TrackedRaceStartTimeUpdateForDependentStartTimeTest extends TrackBasedTest {
+ @Test
+ public void testStartTimeUpdateForRaceWithDependentStartTime() {
+ final Competitor hasso = createCompetitor("Hasso");
+ final RaceLog r1RaceLog = new RaceLogImpl("r1RaceLog");
+ final RaceLog r2RaceLog = new RaceLogImpl("r2RaceLog");
+ final RaceLogResolver raceLogResolver = new RaceLogResolver() {
+ @Override
+ public RaceLog resolve(SimpleRaceLogIdentifier identifier) {
+ if (identifier.getRaceColumnName().equals("R1")) {
+ return r1RaceLog;
+ } else if (identifier.getRaceColumnName().equals("R2")) {
+ return r2RaceLog;
+ }
+ return null;
+ }
+ };
+ final TrackedRace r1 = createTestTrackedRace("Regatta", "R1", "J/70", Collections.singleton(hasso),
+ MillisecondsTimePoint.now(), /* useMarkPassingCalculator */ false, raceLogResolver);
+ final TrackedRace r2 = createTestTrackedRace("Regatta", "R2", "J/70", Collections.singleton(hasso),
+ MillisecondsTimePoint.now(), /* useMarkPassingCalculator */ false, raceLogResolver);
+ r1.attachRaceLog(r1RaceLog);
+ r2.attachRaceLog(r2RaceLog);
+ final TimePoint[] r1StartTime = new TimePoint[1];
+ final TimePoint[] r2StartTime = new TimePoint[1];
+ r1.addStartTimeChangedListener(new StartTimeChangedListener() {
+ @Override
+ public void startTimeChanged(TimePoint newTimePoint) throws MalformedURLException, IOException {
+ r1StartTime[0] = newTimePoint;
+ }
+ });
+ r2.addStartTimeChangedListener(new StartTimeChangedListener() {
+ @Override
+ public void startTimeChanged(TimePoint newTimePoint) throws MalformedURLException, IOException {
+ r2StartTime[0] = newTimePoint;
+ }
+ });
+ final AbstractLogEventAuthor author = new LogEventAuthorImpl("Axel", 0);
+ final Duration startTimeDiff = Duration.ONE_MINUTE;
+ r2RaceLog.add(new RaceLogDependentStartTimeEventImpl(MillisecondsTimePoint.now(), author, /* pass */ 0,
+ new SimpleRaceLogIdentifierImpl(r1.getTrackedRegatta().getRegatta().getName(), "R1", "Default"), startTimeDiff));
+ assertNull(r2StartTime[0]);
+ final TimePoint r1StartTimeToSet = MillisecondsTimePoint.now();
+ r1RaceLog.add(new RaceLogStartTimeEventImpl(r1StartTimeToSet, author, /* pass */ 0, r1StartTimeToSet));
+ assertNotNull(r1StartTime[0]);
+ assertEquals(r1StartTimeToSet, r1StartTime[0]);
+ assertNotNull(r2StartTime[0]);
+ assertEquals(r1StartTimeToSet.plus(startTimeDiff), r2StartTime[0]);
+ }
+}
diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRace.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRace.java
index 1847ac93970..0112fbe217d 100755
--- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRace.java
+++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRace.java
@@ -814,7 +814,8 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
- public void detachRaceLog(Serializable identifier) {
+ public RaceLog detachRaceLog(Serializable identifier) {
+ return null;
}
@Override
diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRaceWithStartTimeAndRanks.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRaceWithStartTimeAndRanks.java
index 7dc874fd299..c358d39f6ff 100755
--- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRaceWithStartTimeAndRanks.java
+++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/mock/MockedTrackedRaceWithStartTimeAndRanks.java
@@ -457,7 +457,8 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
}
@Override
- public void detachRaceLog(Serializable identifier) {
+ public RaceLog detachRaceLog(Serializable identifier) {
+ return null;
}
@Override
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/TrackedRace.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/TrackedRace.java
index 98fd18ed4bb..314ef2c2fbe 100755
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/TrackedRace.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/TrackedRace.java
@@ -700,8 +700,10 @@ public interface TrackedRace extends Serializable, IsManagedByCache {
*/
private Map competitorResultsFromRaceLog;
+ /**
+ * When one or more race logs are attached, changes in those race logs, or in case of dependent start
+ * times even changes in other race logs, may impact this race's start time. This listener receives those start
+ * time changes, also those from races that this race's start time depends upon, and triggers an update of
+ * this race's start time caches. The field is transient, therefore needs no serialization support but needs
+ * to be restored during at the time of de-serialization.
+ */
+ private transient RaceStateChangedListener raceStateBasedStartTimeChangedListener;
+
public DynamicTrackedRaceImpl(TrackedRegatta trackedRegatta, RaceDefinition race, Iterable sidelines,
WindStore windStore, GPSFixStore gpsFixStore, long delayToLiveInMillis,
long millisecondsOverWhichToAverageWind, long millisecondsOverWhichToAverageSpeed,
@@ -95,6 +107,7 @@ DynamicTrackedRace, GPSTrackListener {
super(trackedRegatta, race, sidelines, windStore, gpsFixStore, delayToLiveInMillis,
millisecondsOverWhichToAverageWind, millisecondsOverWhichToAverageSpeed,
delayForCacheInvalidationOfWindEstimation, useInternalMarkPassingAlgorithm, rankingMetricConstructor, raceLogResolver);
+ raceStateBasedStartTimeChangedListener = createRaceStateStartTimeChangeListener();
this.competitorResultsFromRaceLog = new HashMap<>();
this.logListener = new DynamicTrackedRaceLogListener(this);
if (markPassingCalculator != null) {
@@ -126,6 +139,7 @@ DynamicTrackedRace, GPSTrackListener {
*/
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
ois.defaultReadObject();
+ raceStateBasedStartTimeChangedListener = createRaceStateStartTimeChangeListener();
listeners = new HashSet();
logListener = new DynamicTrackedRaceLogListener(this);
courseDesignChangedListeners = new HashSet<>();
@@ -141,6 +155,19 @@ DynamicTrackedRace, GPSTrackListener {
return this;
}
+ private RaceStateChangedListener createRaceStateStartTimeChangeListener() {
+ return new BaseRaceStateChangedListener() {
+ @Override
+ public void onStartTimeChanged(ReadonlyRaceState state) {
+ final TimePoint oldStartTime = getStartOfRace();
+ updateStartOfRaceCacheFields();
+ if (!Util.equalsWithNull(oldStartTime, getStartOfRace())) {
+ onStartTimeChangedByRaceCommittee(getStartOfRace());
+ }
+ }
+ };
+ }
+
/**
* {@link #raceIsKnownToStartUpwind} (see also {@link #raceIsKnownToStartUpwind()}) is initialized based on the race's
* {@link RaceDefinition#getBoatClass()} boat class's {@link BoatClass#typicallyStartsUpwind()} result. It can be changed
@@ -957,15 +984,24 @@ DynamicTrackedRace, GPSTrackListener {
public void attachRaceLog(RaceLog raceLog) {
logListener.addTo(raceLog);
super.attachRaceLog(raceLog);
+ getRaceState(raceLog).addChangedListener(raceStateBasedStartTimeChangedListener);
}
@Override
- public void detachRaceLog(Serializable identifier) {
- RaceLog attachedRaceLog = attachedRaceLogs.get(identifier);
+ public RaceLog detachRaceLog(Serializable identifier) {
+ final RaceLog attachedRaceLog = attachedRaceLogs.get(identifier);
if (attachedRaceLog != null) {
logListener.removeFrom(attachedRaceLog);
}
- super.detachRaceLog(identifier);
+ final RaceLog raceLogDetached = super.detachRaceLog(identifier);
+ assert raceLogDetached == attachedRaceLog;
+ synchronized (raceStates) {
+ final ReadonlyRaceState raceState = raceStates.remove(attachedRaceLog);
+ if (raceState != null) {
+ raceState.removeChangedListener(raceStateBasedStartTimeChangedListener);
+ }
+ }
+ return attachedRaceLog;
}
@Override
diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/TrackedRaceImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/TrackedRaceImpl.java
index 060984ac3a4..43f0001d3ef 100644
--- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/TrackedRaceImpl.java
+++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/tracking/impl/TrackedRaceImpl.java
@@ -403,7 +403,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
* must be established again after de-serialization by invoking {@link #setRaceLogResolver}.
*/
private transient RaceLogResolver raceLogResolver;
-
+
/**
* Constructs the tracked race with one-design ranking.
*/
@@ -565,7 +565,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
logger.log(Level.SEVERE, "Waiting for loading from stores to finish was interrupted", e);
}
}
-
+
@Override
public RankingMetric getRankingMetric() {
return rankingMetric;
@@ -905,7 +905,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
* and not {@link Object}.
*/
private final String updateStartOfRaceCacheFieldsMonitor = "";
- private void updateStartOfRaceCacheFields() {
+ protected void updateStartOfRaceCacheFields() {
synchronized (updateStartOfRaceCacheFieldsMonitor) {
TimePoint newStartTime = null;
TimePoint newStartTimeWithoutInferenceFromStartMarkPassings = null;
@@ -3513,7 +3513,7 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
return !attachedRaceExecutionOrderProviders.isEmpty();
}
- private ReadonlyRaceState getRaceState(RaceLog raceLog) {
+ protected ReadonlyRaceState getRaceState(RaceLog raceLog) {
ReadonlyRaceState result;
synchronized (raceStates) {
result = raceStates.get(raceLog);
@@ -3539,10 +3539,11 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
}
@Override
- public void detachRaceLog(Serializable identifier) {
- this.attachedRaceLogs.remove(identifier);
+ public RaceLog detachRaceLog(Serializable identifier) {
+ final RaceLog raceLog = this.attachedRaceLogs.remove(identifier);
updateStartOfRaceCacheFields();
updateStartAndEndOfTracking(/* waitForGPSFixesToLoad */ false);
+ return raceLog;
}
@Override
diff --git a/java/com.sap.sailing.gwt.ui.test/src/com/sap/sailing/gwt/ui/test/MockedTrackedRace.java b/java/com.sap.sailing.gwt.ui.test/src/com/sap/sailing/gwt/ui/test/MockedTrackedRace.java
index f5ca8e23a18..983309c7b80 100755
--- a/java/com.sap.sailing.gwt.ui.test/src/com/sap/sailing/gwt/ui/test/MockedTrackedRace.java
+++ b/java/com.sap.sailing.gwt.ui.test/src/com/sap/sailing/gwt/ui/test/MockedTrackedRace.java
@@ -572,7 +572,8 @@ public class MockedTrackedRace implements DynamicTrackedRace {
}
@Override
- public void detachRaceLog(Serializable identifier) {
+ public RaceLog detachRaceLog(Serializable identifier) {
+ return null;
}
@Override
diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/masterdata/DummyTrackedRace.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/masterdata/DummyTrackedRace.java
index 38f8ffe8aee..4c871914bdc 100755
--- a/java/com.sap.sailing.server/src/com/sap/sailing/server/masterdata/DummyTrackedRace.java
+++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/masterdata/DummyTrackedRace.java
@@ -448,7 +448,8 @@ public class DummyTrackedRace extends TrackedRaceWithWindEssentials {
}
@Override
- public void detachRaceLog(Serializable identifier) {
+ public RaceLog detachRaceLog(Serializable identifier) {
+ return null;
}
@Override