Merge branch 'ubilabs--rcapp--bug-3118' into ubilabs--rcapp--master

This commit is contained in:
wagnst committed 2015-07-21 15:44:47 +02:00
commit 6576e700e9
112 files changed
+1049 -605

No files matched your search

@@ -7,10 +7,6 @@ import com.sap.sse.common.Util.Pair;
public interface PolarSheetsXYDiagramData extends Serializable {
List<Pair<Double, Double>> getPointsForAverageSpeedMovingAverage(Tack tack, LegType legType);
List<Pair<Double, Double>> getPointsForAverageConfidence(Tack tack, LegType legType);
List<Pair<Double, Double>> getPointsForAverageSpeedRegression(Tack tack, LegType legType);
}
@@ -14,30 +14,12 @@ public class PolarSheetsXYDiagramDataImpl implements PolarSheetsXYDiagramData {
PolarSheetsXYDiagramDataImpl() {
}
private Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> pointsForAverageSpeedMovingAverage;
private Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> pointsForAverageSpeedRegression;
private Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> pointsForAverageConfidence;
public PolarSheetsXYDiagramDataImpl(
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> movingAverageSpeedDataLists,
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> regressionSpeedDataLists,
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> averageConfidenceDataLists) {
pointsForAverageSpeedMovingAverage = movingAverageSpeedDataLists;
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> regressionSpeedDataLists) {
pointsForAverageSpeedRegression = regressionSpeedDataLists;
pointsForAverageConfidence = averageConfidenceDataLists;
}
@Override
public List<Pair<Double, Double>> getPointsForAverageSpeedMovingAverage(Tack tack, LegType legType) {
return pointsForAverageSpeedMovingAverage.get(new Pair<LegType, Tack>(legType, tack));
}
@Override
public List<Pair<Double, Double>> getPointsForAverageConfidence(Tack tack, LegType legType) {
return pointsForAverageConfidence.get(new Pair<LegType, Tack>(legType, tack));
}
@Override
@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.util.List;
import java.util.UUID;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.configuration.DeviceConfigurationMatcher;
import com.sap.sailing.domain.common.MarkType;
import com.sap.sailing.domain.common.PassingInstruction;
@@ -108,4 +109,6 @@ public interface SharedDomainFactory extends CompetitorFactory {
ControlPointWithTwoMarks getOrCreateControlPointWithTwoMarks(Serializable id, String name, Mark left, Mark right);
ControlPointWithTwoMarks getOrCreateControlPointWithTwoMarks(String id, String name, Mark left, Mark right);
RaceLogResolver getRaceLogResolver();
}
@@ -16,6 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CompetitorStore;
@@ -106,14 +107,18 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
private final Set<String> mayStartWithNoUpwindLeg;
private final RaceLogResolver raceLogResolver;
/**
* Uses a transient competitor store
* @param raceLogResolver TODO
*/
public SharedDomainFactoryImpl() {
this(new TransientCompetitorStoreImpl());
public SharedDomainFactoryImpl(RaceLogResolver raceLogResolver) {
this(new TransientCompetitorStoreImpl(), raceLogResolver);
}
public SharedDomainFactoryImpl(CompetitorStore competitorStore) {
public SharedDomainFactoryImpl(CompetitorStore competitorStore, RaceLogResolver raceLogResolver) {
this.raceLogResolver = raceLogResolver;
waypointCacheReferenceQueue = new ReferenceQueue<Waypoint>();
nationalityCache = new HashMap<String, Nationality>();
markCache = new HashMap<Serializable, Mark>();
@@ -386,4 +391,8 @@ public class SharedDomainFactoryImpl implements SharedDomainFactory {
return markCache.get(markIdCache.get(toStringRepresentationOfID));
}
@Override
public RaceLogResolver getRaceLogResolver() {
return raceLogResolver;
}
}
@@ -17,7 +17,7 @@ public class DomainFactoryTest {
@Before
public void before() {
com.sap.sailing.domain.base.DomainFactory baseDomainFactory = new com.sap.sailing.domain.base.impl.DomainFactoryImpl();
com.sap.sailing.domain.base.DomainFactory baseDomainFactory = new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null);
swissTimingDomainFactory = new com.sap.sailing.domain.swisstimingadapter.impl.DomainFactoryImpl(
baseDomainFactory);
}
@@ -63,7 +63,7 @@ public class CompetitorListenerTest extends AbstractSerializationTest {
@Before
public void setUp() {
baseDomainFactory = new DomainFactoryImpl();
baseDomainFactory = new DomainFactoryImpl((srlid)->null);
competitor = TrackBasedTest.createCompetitor("Hasso");
nationalityChanged = false;
whatChangedNationality = null;
@@ -251,7 +251,7 @@ public class CompetitorListenerTest extends AbstractSerializationTest {
@Test
public void testCompetitorSerializationLosesAllExternalListeners() throws ClassNotFoundException, IOException {
DomainFactory baseDomainFactory = new DomainFactoryImpl();
DomainFactory baseDomainFactory = new DomainFactoryImpl((srlid)->null);
DynamicCompetitor clonedCompetitor = cloneBySerialization(competitor, baseDomainFactory);
clonedCompetitor.setName("Dr. Hasso Plattner");
clonedCompetitor.getBoat().setSailId("POR 40");
@@ -80,7 +80,7 @@ public class CourseUpdateTest extends AbstractTracTracLiveTest {
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, SubscriberInitializationException, ParseException, CreateModelException {
super.setUp();
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null));
domainRegatta = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, EmptyRegattaLogStore.INSTANCE,
getTracTracRace(), /* trackedRegattaRegistry */ null);
trackedRegatta = new DynamicTrackedRegattaImpl(domainRegatta);
@@ -118,7 +118,7 @@ public class LeaderboardCourseChangeTest {
ThresholdBasedResultDiscardingRule rule = new ThresholdBasedResultDiscardingRuleImpl(ruleRaw);
Leaderboard leaderboard = new RegattaLeaderboardImpl(mockedRegatta, rule);
DomainFactory baseDomainFactory = new DomainFactoryImpl();
DomainFactory baseDomainFactory = new DomainFactoryImpl((srlid)->null);
LeaderboardDTO leaderboardDTO = leaderboard.getLeaderboardDTO(timePoint, raceColumnNames, false,
trackedRegattaRegistry, baseDomainFactory, /* fillNetPointsUncorrected */ false);
@@ -39,7 +39,7 @@ public class MultipleClassesInRegattaTest {
@Before
public void setUp() {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null));
}
@Test
@@ -59,7 +59,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
*/
@Test
public void testHashCodeOfSerializedPairIsConsistent() throws ClassNotFoundException, IOException {
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
final Throwable s1 = new Throwable();
final Throwable s2 = new Throwable();
com.sap.sse.common.Util.Pair<Throwable, Throwable> p =
@@ -91,7 +91,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
*/
@Test
public void testSerializingIntArray() throws ClassNotFoundException, IOException {
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
int[] intArray = new int[] { 5, 8 };
int[] clone = cloneBySerialization(intArray, receiverDomainFactory);
assertTrue(Arrays.equals(intArray, clone));
@@ -99,7 +99,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testSerializingEventWithLeaderboardGroups() throws ClassNotFoundException, IOException {
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
Event e = new EventImpl("Event Name", MillisecondsTimePoint.now(), MillisecondsTimePoint.now().plus(
Duration.ONE_DAY.times(10)), "At Home", /* is public */true, UUID.randomUUID());
LeaderboardGroup lg1 = new LeaderboardGroupImpl("LG1", "LG1 Description", /* displayName */ null, /* displayGroupsInReverseOrder */ false, Collections.<Leaderboard> emptyList());
@@ -117,7 +117,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
*/
@Test
public void testSerializingResultDiscardingRuleImpl() throws ClassNotFoundException, IOException {
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
ThresholdBasedResultDiscardingRuleImpl rdri = new ThresholdBasedResultDiscardingRuleImpl(new int[] { 5, 8 });
ThresholdBasedResultDiscardingRuleImpl clone = cloneBySerialization(rdri, receiverDomainFactory);
assertTrue(Arrays.equals(rdri.getDiscardIndexResultsStartingWithHowManyRaces(),
@@ -136,7 +136,7 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
final double FACTOR = 2.0;
overallLeaderboard.getRaceColumnByName("Test Leaderboard").setFactor(FACTOR);
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
LeaderboardGroup clone = cloneBySerialization(leaderboardGroup, receiverDomainFactory);
assertEquals(FACTOR, overallLeaderboard.getRaceColumnByName("Test Leaderboard").getFactor(), 0.00000001);
assertEquals(FACTOR, clone.getOverallLeaderboard().getRaceColumnByName("Test Leaderboard").getFactor(), 0.00000001);
@@ -144,8 +144,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testIdentityStabilityOfMarkSerialization() throws ClassNotFoundException, IOException {
DomainFactory senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
Mark sendersMark1 = senderDomainFactory.getOrCreateMark("TestBuoy1");
Mark receiversMark1 = cloneBySerialization(sendersMark1, receiverDomainFactory);
Mark receiversSecondCopyOfMark1 = cloneBySerialization(sendersMark1, receiverDomainFactory);
@@ -154,8 +154,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testIdentityStabilityOfWaypointSerialization() throws ClassNotFoundException, IOException {
DomainFactory senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
Mark sendersMark1 = senderDomainFactory.getOrCreateMark("TestBuoy1");
Waypoint sendersWaypoint1 = senderDomainFactory.createWaypoint(sendersMark1, /*passingInstruction*/null);
Waypoint receiversWaypoint1 = cloneBySerialization(sendersWaypoint1, receiverDomainFactory);
@@ -165,8 +165,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testIdentityStabilityOfBoatClassSerialization() throws ClassNotFoundException, IOException {
DomainFactory senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
BoatClass sendersBoatClass1 = senderDomainFactory.getOrCreateBoatClass("49er", /* typicallyStartsUpwind */ true);
BoatClass receiversBoatClass1 = cloneBySerialization(sendersBoatClass1, receiverDomainFactory);
BoatClass receiversSecondCopyOfBoatClass1 = cloneBySerialization(sendersBoatClass1, receiverDomainFactory);
@@ -175,8 +175,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testIdentityStabilityOfNationalitySerialization() throws ClassNotFoundException, IOException {
DomainFactory senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
Nationality sendersNationality1 = senderDomainFactory.getOrCreateNationality("GER");
Nationality receiversNationality1 = cloneBySerialization(sendersNationality1, receiverDomainFactory);
Nationality receiversSecondCopyOfNationality1 = cloneBySerialization(sendersNationality1, receiverDomainFactory);
@@ -185,8 +185,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void testIdentityStabilityOfCompetitorSerialization() throws ClassNotFoundException, IOException {
DomainFactory senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
DomainFactory senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
String competitorName = "Tina Maximiliane Lutz";
Competitor sendersCompetitor1 = new CompetitorImpl(123, competitorName, Color.RED, null, null, new TeamImpl("STG", Collections.singleton(
new PersonImpl(competitorName, senderDomainFactory.getOrCreateNationality("GER"),
@@ -201,8 +201,8 @@ public class OfflineSerializationTest extends AbstractSerializationTest {
@Test
public void ensureSameObjectWrittenTwiceComesOutIdentical() throws ClassNotFoundException, IOException {
final DomainFactoryImpl senderDomainFactory = new DomainFactoryImpl();
DomainFactory receiverDomainFactory = new DomainFactoryImpl();
final DomainFactoryImpl senderDomainFactory = new DomainFactoryImpl((srlid)->null);
DomainFactory receiverDomainFactory = new DomainFactoryImpl((srlid)->null);
Nationality n = senderDomainFactory.getOrCreateNationality("GER");
Object[] copies = cloneManyBySerialization(receiverDomainFactory, n, n);
assertEquals(2, copies.length);
@@ -86,7 +86,7 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
@Before
public void setUp() throws MalformedURLException, IOException, InterruptedException, URISyntaxException, ParseException, SubscriberInitializationException, CreateModelException {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null));
// keep superclass implementation from automatically setting up for a Weymouth event and force subclasses
// to select a race
}
@@ -219,7 +219,7 @@ public abstract class OnlineTracTracBasedTest extends AbstractTracTracLiveTest {
throws FileNotFoundException, MalformedURLException, URISyntaxException, SubscriberInitializationException, CreateModelException {
super.setUp(paramUrl, liveUri, storedUri);
if (domainFactory == null) {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null));
}
domainEvent = domainFactory.getOrCreateDefaultRegatta(EmptyRaceLogStore.INSTANCE, EmptyRegattaLogStore.INSTANCE,
getTracTracRace(), /* trackedRegattaRegistry */ null);
@@ -38,7 +38,7 @@ public class UnicodeCharactersInCompetitorNamesTest {
@Before
public void setUp() {
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl());
domainFactory = new DomainFactoryImpl(new com.sap.sailing.domain.base.impl.DomainFactoryImpl((srlid)->null));
}
public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException, CreateModelException, SubscriberInitializationException {
@@ -23,6 +23,7 @@ import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.RegattaListener;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -75,6 +76,7 @@ import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.WindTrackImpl;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -985,4 +987,9 @@ public class MockedTrackedRace implements DynamicTrackedRace {
public RankingMetric getRankingMetric() {
return null;
}
@Override
public IsManagedByCache<SharedDomainFactory> resolve(SharedDomainFactory domainFactory) {
return this;
}
}
@@ -14,6 +14,7 @@ import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -57,6 +58,7 @@ import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -646,4 +648,9 @@ public class MockedTrackedRaceWithStartTimeAndRanks implements TrackedRace {
@Override
public void detachRaceExecutionOrderProvider(RaceExecutionOrderProvider raceExecutionOrderProvider) {
}
@Override
public IsManagedByCache<SharedDomainFactory> resolve(SharedDomainFactory domainFactory) {
return this;
}
}
@@ -31,7 +31,7 @@ public interface DomainFactory extends SharedDomainFactory {
* the <code>RacingEventService.getBaseDomainFactory()</code> instead which should be the single instance used
* by all other services linked to the <code>RacingEventService</code>.
*/
static DomainFactory INSTANCE = new DomainFactoryImpl();
static DomainFactory INSTANCE = new DomainFactoryImpl((srlid)->null);
MarkPassing createMarkPassing(TimePoint timePoint, Waypoint waypoint, Competitor competitor);
@@ -8,6 +8,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CompetitorStore;
import com.sap.sailing.domain.base.DomainFactory;
@@ -67,12 +68,12 @@ public class DomainFactoryImpl extends SharedDomainFactoryImpl implements Domain
/**
* Uses a transient competitor store
*/
public DomainFactoryImpl() {
super(new TransientCompetitorStoreImpl());
public DomainFactoryImpl(RaceLogResolver raceLogResolver) {
super(new TransientCompetitorStoreImpl(), raceLogResolver);
}
public DomainFactoryImpl(CompetitorStore competitorStore) {
super(competitorStore);
public DomainFactoryImpl(CompetitorStore competitorStore, RaceLogResolver raceLogResolver) {
super(competitorStore, raceLogResolver);
}
@Override
@@ -1670,8 +1670,9 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
result.estimatedTimeToNextWaypointInSeconds = estimatedTimeToNextMarkInSeconds==null?null:estimatedTimeToNextMarkInSeconds.asSeconds();
result.timeInMilliseconds = time.asMillis();
result.finished = trackedLeg.hasFinishedLeg(timePoint);
final TimePoint legFinishTime = trackedLeg.getFinishTime();
result.correctedTotalTime = trackedLeg.hasStartedLeg(timePoint) ? trackedLeg.getTrackedLeg().getTrackedRace().getRankingMetric().getCorrectedTime(trackedLeg.getCompetitor(),
trackedLeg.hasFinishedLeg(timePoint) ? trackedLeg.getFinishTime() : timePoint, cache) : null;
trackedLeg.hasFinishedLeg(timePoint) ? legFinishTime : timePoint, cache) : null;
// fetch the leg gap in own corrected time from the ranking metric
final Duration gapToLeaderInOwnTime = trackedLeg.getTrackedLeg().getTrackedRace().getRankingMetric().
getLegGapToLegLeaderInOwnTime(trackedLeg, timePoint, rankingInfo, cache);
@@ -1721,8 +1722,8 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race
case TACK:
case JIBE:
case PENALTY_CIRCLE:
if (!maneuver.getTimePoint().before(startOfLeg) && (!trackedLeg.hasFinishedLeg(timePoint) ||
maneuver.getTimePoint().before(trackedLeg.getFinishTime()))) {
if (!maneuver.getTimePoint().before(startOfLeg) && (legFinishTime == null || legFinishTime.after(timePoint) ||
maneuver.getTimePoint().before(legFinishTime))) {
if (maneuver.getManeuverLoss() != null) {
result.numberOfManeuvers.put(maneuver.getType(),
result.numberOfManeuvers.get(maneuver.getType()) + 1);
@@ -1,6 +1,7 @@
package com.sap.sailing.domain.leaderboard.impl;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import com.sap.sailing.domain.base.Competitor;
@@ -43,7 +44,7 @@ public class PerSeriesResultDiscardingRuleImpl implements ResultDiscardingRule {
}
private Iterable<RaceColumn> getColumnsToConsiderInSeries(Series series, Iterable<RaceColumn> allRaceColumnsToConsider) {
Set<RaceColumn> result = new HashSet<>();
Set<RaceColumn> result = new LinkedHashSet<>();
for (RaceColumn seriesColumn : series.getRaceColumns()) {
if (Util.contains(allRaceColumnsToConsider, seriesColumn)) {
result.add(seriesColumn);
@@ -23,6 +23,8 @@ import com.sap.sailing.domain.base.Event;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.configuration.DeviceConfiguration;
import com.sap.sailing.domain.base.configuration.DeviceConfigurationMatcher;
import com.sap.sailing.domain.common.RaceIdentifier;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.RegattaIdentifier;
@@ -62,10 +64,11 @@ public class TopLevelMasterData implements Serializable {
private final Set<WindTrackMasterData> windTrackMasterData;
private final Map<LeaderboardGroup, Set<Event>> eventForLeaderboardGroup;
private final Map<DeviceIdentifier, Set<GPSFix>> raceLogTrackingFixes;
private final Map<DeviceConfigurationMatcher, DeviceConfiguration> deviceConfigurations;
public TopLevelMasterData(final Set<LeaderboardGroup> groupsToExport, final Iterable<Event> allEvents,
final Map<String, Regatta> regattaForRaceIdString, final Collection<MediaTrack> allMediaTracks,
GPSFixStore gpsFixStore, boolean exportWind) {
GPSFixStore gpsFixStore, boolean exportWind, Map<DeviceConfigurationMatcher, DeviceConfiguration> deviceConfigurations) {
this.raceIdStringsForRegatta = convertToRaceIdStringsForRegattaMap(regattaForRaceIdString);
this.leaderboardGroups = groupsToExport;
this.raceLogTrackingFixes = getAllRelevantRaceLogTrackingFixes(gpsFixStore);
@@ -74,6 +77,7 @@ public class TopLevelMasterData implements Serializable {
} else {
this.windTrackMasterData = new HashSet<WindTrackMasterData>();
}
this.deviceConfigurations = deviceConfigurations;
this.eventForLeaderboardGroup = createEventMap(groupsToExport, allEvents);
this.filteredMediaTracks = new HashSet<MediaTrack>();
filterMediaTracks(allMediaTracks, this.filteredMediaTracks);
@@ -344,4 +348,8 @@ public class TopLevelMasterData implements Serializable {
public Map<DeviceIdentifier, Set<GPSFix>> getRaceLogTrackingFixes() {
return raceLogTrackingFixes;
}
public Map<DeviceConfigurationMatcher, DeviceConfiguration> getDeviceConfigurations() {
return deviceConfigurations;
}
}
@@ -8,6 +8,7 @@ import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.base.SpeedWithBearingWithConfidence;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.common.Bearing;
@@ -51,36 +52,6 @@ public interface PolarDataService {
SpeedWithConfidence<Void> getSpeed(BoatClass boatClass, Speed windSpeed, Bearing trueWindAngle)
throws NotEnoughDataHasBeenAddedException;
/**
*
* @param boatClass
* @param windSpeed
* @param legType
* Should be {@link LegType#UPWIND} or {@link LegType#DOWNWIND}, there is no information for other
* courses yet. Use getSpeed for the desired angle to get rawer information on other courses for now.
* @param tack
* Polar data can vary depending on the tack the boat is on.
* @param useRegressionForSpeed TODO
* @return The estimated average speed of a boat for the supplied parameters with the estimated average bearing to
* the true wind and a confidence which consists of the confidences of the wind speed, and boat speed sources (50%)
* and a confidence calculated using the amount of underlying fixes (50%). 0 <= confidence < 1<br/>
* A value with zero confidence doesn't have any significance!<br/>
* <br/>
*
* The bearing is somewhere between -179 to +180<br/>
* <br/>
*
* Get the speed using returnValue.getObject()<br/>
* <br/>
*
* Returns null if the leg type is not up or downwind.
*
* @throws NotEnoughDataHasBeenAddedException
* If there is not enough data to supply a value with some kind of significance.
*/
SpeedWithBearingWithConfidence<Void> getAverageSpeedWithBearing(BoatClass boatClass, Speed windSpeed,
LegType legType, Tack tack, boolean useRegressionForSpeed) throws NotEnoughDataHasBeenAddedException;
/**
* Generates a polar sheet for given races and settings using the provided executor for the worker threads. This
@@ -242,5 +213,9 @@ public interface PolarDataService {
*/
void unregisterListener(BoatClass boatClass, PolarsChangedListener listener);
void registerDomainFactory(DomainFactory domainFactory);
void unregisterDomainFactory(DomainFactory domainFactory);
}
@@ -593,7 +593,9 @@ public abstract class AbstractRankingMetric implements RankingMetric {
* For each leg the total windward distance sailed is limited to the leg's windward distance at its
* {@link TrackedLeg#getReferenceTimePoint() reference time point}. This ensures that significantly "overstaying" the lay lines
* doesn't let a competitor rank better than one who already passed the mark but traveled little windward distance in
* the next leg.
* the next leg.<p>
*
* If mark positions along the way are not known, the windward distance of those legs will be counted as 0.
*
* @param timePoint needed to determine <code>competitor</code>'s position at that time point; note that the
* time point for wind approximation is taken to be a reference time point selected based on the mark passings
@@ -620,7 +622,7 @@ public abstract class AbstractRankingMetric implements RankingMetric {
if (estimatedPosition != null) {
final Distance windwardDistanceFromLegStart = trackedLeg.getWindwardDistanceFromLegStart(estimatedPosition, cache);
final Distance legWindwardDistance = trackedLeg.getWindwardDistance(cache);
if (legWindwardDistance.compareTo(windwardDistanceFromLegStart) < 0) {
if (legWindwardDistance != null && legWindwardDistance.compareTo(windwardDistanceFromLegStart) < 0) {
d = d.add(legWindwardDistance);
} else {
// if the competitor is currently at the mark rounding, the windward distance within the leg may
@@ -632,7 +634,10 @@ public abstract class AbstractRankingMetric implements RankingMetric {
}
break;
} else {
d = d.add(trackedLeg.getWindwardDistance(cache));
final Distance legWindwardDistance = trackedLeg.getWindwardDistance(cache);
if (legWindwardDistance != null) {
d = d.add(legWindwardDistance);
}
}
}
}
@@ -17,6 +17,7 @@ import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -46,6 +47,7 @@ import com.sap.sailing.domain.ranking.RankingMetric;
import com.sap.sailing.domain.ranking.RankingMetric.RankingInfo;
import com.sap.sailing.domain.tracking.impl.TrackedRaceImpl;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -64,7 +66,7 @@ import com.sap.sse.common.Util;
* @author Axel Uhl (d043530)
*
*/
public interface TrackedRace extends Serializable {
public interface TrackedRace extends Serializable, IsManagedByCache<SharedDomainFactory> {
final long MAX_TIME_BETWEEN_START_AND_FIRST_MARK_PASSING_IN_MILLISECONDS = 30000;
final long DEFAULT_LIVE_DELAY_IN_MILLISECONDS = 5000;
@@ -454,27 +454,30 @@ public class TrackedLegImpl implements TrackedLeg {
Distance getWindwardDistance(final Position pos1, final Position pos2, TimePoint at, WindPositionMode windPositionMode, WindLegTypeAndLegBearingCache cache) {
Distance result;
try {
final LegType legType = cache.getLegType(this, at);
if (legType != LegType.REACHING) { // upwind or downwind
final Position effectivePosition = getEffectiveWindPosition(
() -> pos1.translateGreatCircle(pos1.getBearingGreatCircle(pos2), pos1.getDistance(pos2).scale(0.5)),
at, windPositionMode);
Wind wind = getTrackedRace().getWind(effectivePosition, at);
if (wind == null) {
result = pos2.alongTrackDistance(pos1, cache.getLegBearing(this, at));
if (pos1 == null || pos2 == null) {
result = null;
} else {
try {
final LegType legType = cache.getLegType(this, at);
if (legType != LegType.REACHING) { // upwind or downwind
final Position effectivePosition = getEffectiveWindPosition(() -> pos1.translateGreatCircle(
pos1.getBearingGreatCircle(pos2), pos1.getDistance(pos2).scale(0.5)), at, windPositionMode);
Wind wind = getTrackedRace().getWind(effectivePosition, at);
if (wind == null) {
result = pos2.alongTrackDistance(pos1, cache.getLegBearing(this, at));
} else {
Position projectionToLineThroughPos2 = pos1.projectToLineThrough(pos2, wind.getBearing());
result = pos2.alongTrackDistance(projectionToLineThroughPos2,
legType == LegType.UPWIND ? wind.getFrom() : wind.getBearing());
}
} else {
Position projectionToLineThroughPos2 = pos1.projectToLineThrough(pos2, wind.getBearing());
result = pos2.alongTrackDistance(projectionToLineThroughPos2,
legType == LegType.UPWIND ? wind.getFrom() : wind.getBearing());
// reaching leg, return distance projected onto leg's bearing
result = pos2.alongTrackDistance(pos1, cache.getLegBearing(this, at));
}
} else {
// reaching leg, return distance projected onto leg's bearing
} catch (NoWindException e) {
// no wind information; use along-track distance as fallback
result = pos2.alongTrackDistance(pos1, cache.getLegBearing(this, at));
}
} catch (NoWindException e) {
// no wind information; use along-track distance as fallback
result = pos2.alongTrackDistance(pos1, cache.getLegBearing(this, at));
}
return result;
}
@@ -350,7 +350,7 @@ public class TrackedLegOfCompetitorImpl implements TrackedLegOfCompetitor {
if (startPos != null) {
Distance d = getTrackedLeg().getAbsoluteWindwardDistance(startPos, endPos, to,
WindPositionMode.EXACT, cache);
result = d.inTime(to.asMillis() - start.getTimePoint().asMillis());
result = d == null ? null : d.inTime(to.asMillis() - start.getTimePoint().asMillis());
}
}
}
@@ -54,6 +54,7 @@ import com.sap.sailing.domain.base.CourseListener;
import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithBearingWithConfidence;
import com.sap.sailing.domain.base.SpeedWithConfidence;
@@ -134,6 +135,7 @@ import com.sap.sailing.domain.tracking.WindStore;
import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Timed;
@@ -1022,14 +1024,16 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
&& timePoint.compareTo(markPassings.last().getTimePoint()) > 0) {
// competitor has finished race at or before the requested time point; use time point of crossing the finish line
end = markPassings.last().getTimePoint();
} else if ((trackedLegOfCompetitor=getTrackedLeg(competitor, timePoint)) == null ||
(!trackedLegOfCompetitor.hasFinishedLeg(getEndOfTracking())
&& ((getEndOfTracking() != null && timePoint.after(getEndOfTracking()))
|| getStatus().getStatus() == TrackedRaceStatusEnum.FINISHED))) {
// If the race is no longer tracking and hence no more data can be expected, and the competitor
// hasn't finished a leg after the requested time point, no valid distance traveled can be determined
// for the competitor in this race the the time point requested
end = null;
} else {
final TimePoint endOfTracking = getEndOfTracking();
if ((trackedLegOfCompetitor=getTrackedLeg(competitor, timePoint)) == null ||
(endOfTracking != null && !trackedLegOfCompetitor.hasFinishedLeg(endOfTracking)
&& (timePoint.after(endOfTracking) || getStatus().getStatus() == TrackedRaceStatusEnum.FINISHED))) {
// If the race is no longer tracking and hence no more data can be expected, and the competitor
// hasn't finished a leg after the requested time point, no valid distance traveled can be determined
// for the competitor in this race the the time point requested
end = null;
}
}
if (end == null) {
result = null;
@@ -3692,4 +3696,14 @@ public abstract class TrackedRaceImpl extends TrackedRaceWithWindEssentials impl
public void setRaceLogResolver(RaceLogResolver raceLogResolver) {
this.raceLogResolver = raceLogResolver;
}
/**
* When given the opportunity to resolve after de-serialization, grabs the {@link RaceLogResolver} from the
* {@link SharedDomainFactory} because the field is transient and needs filling after de-serialization.
*/
@Override
public IsManagedByCache<SharedDomainFactory> resolve(SharedDomainFactory domainFactory) {
this.raceLogResolver = domainFactory.getRaceLogResolver();
return this;
}
}
@@ -17,6 +17,7 @@ import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -63,6 +64,7 @@ import com.sap.sailing.domain.tracking.WindTrack;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.WindTrackImpl;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -783,4 +785,9 @@ public class MockedTrackedRace implements DynamicTrackedRace {
@Override
public void attachRaceExecutionProvider(RaceExecutionOrderProvider raceExecutionOrderProvider) {
}
@Override
public IsManagedByCache<SharedDomainFactory> resolve(SharedDomainFactory domainFactory) {
return this;
}
}
@@ -3,6 +3,7 @@
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart"/>
<listEntry value="com.sap.sailing.gwt.ui.RaceBoard"/>
@@ -71,7 +72,7 @@
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir &quot;${project_loc:com.sap.sailing.gwt.ui}/.tmp/gwt-work&quot; -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/EmbeddedMapAndWindChart com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Desktop com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -workDir &quot;${project_loc:com.sap.sailing.gwt.ui}/.tmp/gwt-work&quot; -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/EmbeddedMapAndWindChart com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Desktop com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard com.sap.sailing.gwt.ui.EmbeddedMapAndWindChart"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx3072m"/>
</launchConfiguration>
+76 -76
View File
@@ -1,76 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.gwt.ui.RaceBoard"/>
<listEntry value="com.sap.sailing.gwt.ui.DataMining"/>
<listEntry value="com.sap.sailing.gwt.ui.LeaderboardEditing"/>
<listEntry value="com.sap.sailing.gwt.ui.Spectator"/>
<listEntry value="com.sap.sailing.gwt.regattaoverview.RegattaOverview"/>
<listEntry value="com.sap.sailing.gwt.ui.PolarSheets"/>
<listEntry value="com.sap.sailing.gwt.ui.Leaderboard"/>
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
<listEntry value="com.sap.sailing.gwt.AutoPlay"/>
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
<listEntry value="com.sap.sailing.gwt.home.Home"/>
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.gwt.ui"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;com.sap.sailing.gwt.ui&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.theme/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.googlecode.java-diff-utils/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.json.simple/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.expeditionconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.udpconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.mongodb/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.operationaltransformation/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.replication/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.geocoding/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.gwt.ui&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -Dgwt-usearchives=false -Dgwt.persistentunitcache=false"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="com.google.gdt.eclipse.suite.webapp">
<booleanAttribute key="com.google.gdt.eclipse.core.RUN_SERVER" value="false"/>
<stringAttribute key="com.google.gdt.eclipse.suiteMainTypeProcessor.PREVIOUSLY_SET_MAIN_TYPE_NAME" value="com.google.gwt.dev.GWTShell"/>
<booleanAttribute key="com.google.gdt.eclipse.suiteWarArgumentProcessor.IS_WAR_FROM_PROJECT_PROPERTIES" value="true"/>
<booleanAttribute key="com.google.gwt.eclipse.core.CODE_SERVER_PORT_AUTO" value="true"/>
<listAttribute key="com.google.gwt.eclipse.core.ENTRY_POINT_MODULES">
<listEntry value="com.sap.sailing.gwt.ui.RaceBoard"/>
<listEntry value="com.sap.sailing.gwt.ui.DataMining"/>
<listEntry value="com.sap.sailing.gwt.ui.LeaderboardEditing"/>
<listEntry value="com.sap.sailing.gwt.ui.Spectator"/>
<listEntry value="com.sap.sailing.gwt.regattaoverview.RegattaOverview"/>
<listEntry value="com.sap.sailing.gwt.ui.PolarSheets"/>
<listEntry value="com.sap.sailing.gwt.ui.Leaderboard"/>
<listEntry value="com.sap.sailing.gwt.ui.Simulator"/>
<listEntry value="com.sap.sailing.gwt.ui.YoutubePopup"/>
<listEntry value="com.sap.sailing.gwt.AutoPlay"/>
<listEntry value="com.sap.sailing.gwt.ui.AdminConsole"/>
<listEntry value="com.sap.sailing.gwt.home.Home"/>
<listEntry value="com.sap.sailing.gwt.ui.VideoPopup"/>
</listAttribute>
<stringAttribute key="com.google.gwt.eclipse.core.URL" value="/gwt/Home.html"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.sap.sailing.gwt.ui"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="false"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6&quot; javaProject=&quot;com.sap.sailing.gwt.ui&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.gwt.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.theme/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.googlecode.java-diff-utils/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.json.simple/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.server/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.expeditionconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.declination/resources&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.udpconnector/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.mongodb/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.swisstimingadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.operationaltransformation/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.replication/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.domain.tractracadapter.persistence/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/org.moxieapps.gwt.highcharts/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.geocoding/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sailing.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.datamining.shared/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.google.gwt.osgi/lib/gwt-user.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#13;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;com.sap.sailing.gwt.ui&quot;/&gt;&#13;&#10;&lt;/runtimeClasspathEntry&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security.ui/src/main/java&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.gwt.adminconsole/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/com.sap.sse.security.common/src&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#13;&#10;"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="com.google.gwt.eclipse.core.moduleClasspathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-nosuperDevMode -incremental -war &quot;${project_loc:com.sap.sailing.gwt.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort auto -startupUrl /gwt/Home.html com.sap.sailing.gwt.home.Home -startupUrl /gwt/AdminConsole.html com.sap.sailing.gwt.ui.AdminConsole -startupUrl /gwt/LeaderboardEditing.html com.sap.sailing.gwt.ui.LeaderboardEditing -startupUrl /gwt/Leaderboard.html com.sap.sailing.gwt.ui.Leaderboard -startupUrl /gwt/Spectator.html com.sap.sailing.gwt.ui.Spectator -startupUrl /gwt/RaceBoard.html com.sap.sailing.gwt.ui.RaceBoard -startupUrl /gwt/PolarSheets.html com.sap.sailing.gwt.ui.PolarSheets -startupUrl /gwt/RegattaOverview.html com.sap.sailing.gwt.regattaoverview.RegattaOverview -startupUrl /gwt/DataMining.html com.sap.sailing.gwt.ui.DataMining -startupUrl /gwt/Simulator.html com.sap.sailing.gwt.ui.Simulator -startupUrl /gwt/VideoPopup.html com.sap.sailing.gwt.ui.VideoPopup com.sap.sailing.gwt.home.Home com.sap.sailing.gwt.ui.AdminConsole com.sap.sailing.gwt.AutoPlay com.sap.sailing.gwt.ui.YoutubePopup com.sap.sailing.gwt.ui.Simulator com.sap.sailing.gwt.ui.Leaderboard com.sap.sailing.gwt.ui.PolarSheets com.sap.sailing.gwt.regattaoverview.RegattaOverview com.sap.sailing.gwt.ui.Spectator com.sap.sailing.gwt.ui.LeaderboardEditing com.sap.sailing.gwt.ui.DataMining com.sap.sailing.gwt.ui.RaceBoard"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sailing.gwt.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx2048m -Dgwt-usearchives=false -Dgwt.persistentunitcache=false"/>
</launchConfiguration>
@@ -133,12 +133,6 @@ public abstract class AbstractEventActivity<PLACE extends AbstractEventPlace> ex
return getRaceViewerURL(leaderboard.name, raceIdentifier);
}
@Override
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
return EntryPointLinkFactory
.createRaceBoardLink(createRaceBoardLinkParameters(regattaName, regattaName, trackedRaceName));
}
public String getRaceViewerURL(String leaderboardName, RegattaAndRaceIdentifier raceIdentifier) {
return EntryPointLinkFactory
.createRaceBoardLink(createRaceBoardLinkParameters(leaderboardName, raceIdentifier.getRegattaName(), raceIdentifier.getRaceName()));
@@ -6,6 +6,7 @@ import com.google.gwt.place.shared.Place;
import com.google.gwt.safehtml.shared.SafeUri;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.IsWidget;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.dto.RaceDTO;
import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
import com.sap.sailing.gwt.home.client.place.event.regatta.AbstractEventRegattaPlace;
@@ -56,7 +57,7 @@ public interface EventView<PLACE extends AbstractEventPlace, PRES extends EventV
String getRaceViewerURL(StrippedLeaderboardDTO leaderboard, RaceDTO race);
String getRaceViewerURL(String regattaName, String trackedRaceName);
String getRaceViewerURL(String leaderboardName, RegattaAndRaceIdentifier raceIdentifier);
PlaceNavigation<RegattaRacesPlace> getRegattaRacesNavigation(String regattaName);
PlaceNavigation<AbstractEventRegattaPlace> getRegattaNavigation(String regattaName);
@@ -38,7 +38,7 @@ public class RegattaCompetitionSeries extends Composite {
RegattaCompetitionFleet competitionFleet = new RegattaCompetitionFleet(fleet);
for (RaceListRaceDTO race : fleet.getRaces()) {
boolean tracked = race.getTrackingState() == RaceTrackingState.TRACKED_VALID_DATA;
String raceViewerUrl = tracked ? presenter.getRaceViewerURL(race.getRegattaName(), race.getTrackedRaceName()) : null;
String raceViewerUrl = tracked ? presenter.getRaceViewerURL(race.getRegattaName(), race.getRegattaAndRaceIdentifier()) : null;
competitionFleet.addRace(race, raceViewerUrl);
}
containerUi.add(competitionFleet);
@@ -514,7 +514,7 @@ public class RaceListColumnFactory {
} else {
String styleNames = data.getViewState() == RaceViewState.FINISHED ? analyseRaceStyle : watchNowStyle;
String text = data.getViewState() == RaceViewState.FINISHED ? I18N.analyseRace() : I18N_UBI.watchNow();
String raceViewerURL = presenter.getRaceViewerURL(data.getRegattaName(), data.getTrackedRaceName());
String raceViewerURL = presenter.getRaceViewerURL(data.getLeaderboardName(), data.getRegattaAndRaceIdentifier());
sb.append(TEMPLATE.raceViewerLinkButton(styleNames, text, raceViewerURL));
}
}
@@ -75,8 +75,8 @@ public class UpdatesBoxItem extends Widget {
placeNavigation = presenter.getRegattaLeaderboardNavigation(((LeaderboardNewsEntryDTO) entry).getLeaderboardName());
} else if(entry instanceof AbstractRaceNewsEntryDTO) {
AbstractRaceNewsEntryDTO raceEntry = (AbstractRaceNewsEntryDTO) entry;
if(raceEntry.getTrackedRaceName() != null) {
directLink = presenter.getRaceViewerURL(raceEntry.getRegattaName(), raceEntry.getTrackedRaceName());
if(raceEntry.getRegattaAndRaceIdentfier() != null) {
directLink = presenter.getRaceViewerURL(raceEntry.getLeaderboardName(), raceEntry.getRegattaAndRaceIdentfier());
}
}
if(placeNavigation != null) {
@@ -254,6 +254,7 @@ public class WindPanel extends FormPanel implements RegattasDisplayer, WindShowe
igtimiWindImportRootPanel.add(contentPanel);
contentPanel.add(new Label(stringMessages.seeIgtimiTabForAccountSettings()));
final CheckBox correctByDeclination = new CheckBox(stringMessages.declinationCheckbox());
correctByDeclination.setValue(true); // by default this is desirable because the Igtimi connector reads uncorrected magnetic values
final Button importButton = new Button(stringMessages.importWindFromIgtimi());
final HTML resultReport = new HTML();
importButton.addClickHandler(new ClickHandler() {
@@ -407,7 +407,7 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
List<String> getLeaderboardGroupNamesFromRemoteServer(String host);
UUID importMasterData(String host, String[] groupNames, boolean override, boolean compress, boolean exportWind);
UUID importMasterData(String host, String[] groupNames, boolean override, boolean compress, boolean exportWind, boolean exportDeviceConfigurations);
DataImportProgress getImportOperationProgress(UUID id);
@@ -518,7 +518,7 @@ public interface SailingServiceAsync extends BuildVersionRetriever, FileStorageM
void getRegattaLog(String leaderboardName, AsyncCallback<RegattaLogDTO> callback);
void importMasterData(String host, String[] names, boolean override, boolean compress, boolean exportWind,
AsyncCallback<UUID> asyncCallback);
boolean exportDeviceConfigurations, AsyncCallback<UUID> asyncCallback);
void getImportOperationProgress(UUID id, AsyncCallback<DataImportProgress> asyncCallback);
@@ -1050,6 +1050,8 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages, c
String ratio();
String importWind();
String importWindTooltip();
String importDeviceConfigurations();
String importDeviceConfigurationsTooltip();
String authorName();
String authorPriority();
String removeDenotation();
@@ -1018,6 +1018,8 @@ showAddedScores=Show added scores for each entry in leaderboard
ratio=ratio
importWind=Import Wind
importWindTooltip=Unchecking this option will drastically lower the amount of data transfered.
importDeviceConfigurations=Import Device Configurations
importDeviceConfigurationsTooltip=Checking this will import ALL device configurations on the remote server.
authorName=Author name
authorPriority=Author priority
removeDenotation=Remove Denotation
@@ -1319,4 +1321,4 @@ degreesToWind={0}° to wind
miniLeeaderboardLegendText=Shows the points along with the number of races per competitor
currentOfTotal={0,number}/{1,number}
noFinishedRaces=There are no finished races yet
racesOverview=Races overview
racesOverview=Races overview
@@ -1014,6 +1014,8 @@ showAddedScores=Addierte Punkte für jeden Eintrag im Leaderboard anzeigen
ratio=Verhältnis
importWind=Wind importieren
importWindTooltip=Diese Option zu deselektieren führt zu einer wesentlich kleineren übertragenen Datenmenge.
importDeviceConfigurations=Device Configurations importieren
importDeviceConfigurationsTooltip=ALLE device configurations werden importiert.
authorName=Benutzername
authorPriority=Benutzer-Priorität
removeDenotation=Markierung entfernen
@@ -1309,4 +1311,4 @@ degreesToWind={0}° zum Wind
miniLeeaderboardLegendText=Es werden die Punkte und die Anzahl Rennen je Team angezeigt
currentOfTotal={0,number}/{1,number}
noFinishedRaces=Es wurden noch keine Wettfahrten beendet.
racesOverview=Wettfahrtübersicht
racesOverview=Wettfahrtübersicht
@@ -974,6 +974,8 @@ showAddedScores=Показать добавленные очки для кажд
ratio=коэффициент
importWind=Имопрт данных о ветре
importWindTooltip=Снятие флажка с этой опции значительно снизит объем передаваемых данных.
importDeviceConfigurations=Конфигурации Импорт устройств
importDeviceConfigurationsTooltip=Все конфигурации устройства ввозятся.
authorName=Имя автора
authorPriority=Приоритет автора
removeDenotation=Remove Denotation
@@ -1256,4 +1258,4 @@ degreesToWind={0}° to wind
miniLeeaderboardLegendText=Shows points along with the number of races per competitor
currentOfTotal={0,number}/{1,number}
noFinishedRaces=There are no finished races yet
racesOverview=Races overview
racesOverview=Races overview
@@ -52,7 +52,7 @@ public class RotateAndTranslateCoordinateSystem implements CoordinateSystem {
@Override
public Position getPosition(LatLng p) {
final Position mapped = new DegreePosition(p.getLatitude(), p.getLongitude());
return mapped.getTargetCoordinates(zeroZero, equator, /* targetOrigin */ ZERO_ZERO, /* targetEquatorBearing */ EQUATOR_BEARING);
return mapped.getTargetCoordinates(/* local origin */ ZERO_ZERO, /* local equator bearing */ EQUATOR_BEARING, zeroZero, equator);
}
@Override
@@ -55,6 +55,7 @@ public class MasterDataImportPanel extends VerticalPanel {
private final LeaderboardGroupsRefresher leaderboardGroupsRefresher;
private CheckBox compressSwitch;
private CheckBox exportWindSwitch;
private CheckBox exportDeviceConfigsSwitch;
private TextBox filterBox;
public MasterDataImportPanel(StringMessages stringMessages, SailingServiceAsync sailingService,
@@ -131,8 +132,9 @@ public class MasterDataImportPanel extends VerticalPanel {
boolean override = overrideSwitch.getValue();
boolean compress = compressSwitch.getValue();
boolean exportWind = exportWindSwitch.getValue();
boolean exportDeviceConfigs = exportDeviceConfigsSwitch.getValue();
sailingService.importMasterData(currentHost, groupNames, override, compress, exportWind,
new AsyncCallback<UUID>() {
exportDeviceConfigs, new AsyncCallback<UUID>() {
@Override
public void onFailure(Throwable caught) {
@@ -341,6 +343,11 @@ public class MasterDataImportPanel extends VerticalPanel {
exportWindSwitch.setTitle(stringMessages.importWindTooltip());
exportWindSwitch.setValue(true);
contentPanel.add(exportWindSwitch);
exportDeviceConfigsSwitch = new CheckBox(stringMessages.importDeviceConfigurations());
exportDeviceConfigsSwitch.setTitle(stringMessages.importDeviceConfigurationsTooltip());
exportDeviceConfigsSwitch.setValue(false);
contentPanel.add(exportDeviceConfigsSwitch);
importLeaderboardGroupsButton = new Button(stringMessages.importSelectedLeaderboardGroups());
importLeaderboardGroupsButton.setEnabled(false);
@@ -4,12 +4,9 @@ import java.util.List;
import org.moxieapps.gwt.highcharts.client.AxisTitle;
import org.moxieapps.gwt.highcharts.client.Chart;
import org.moxieapps.gwt.highcharts.client.PlotLine;
import org.moxieapps.gwt.highcharts.client.Point;
import org.moxieapps.gwt.highcharts.client.Series;
import org.moxieapps.gwt.highcharts.client.Series.Type;
import org.moxieapps.gwt.highcharts.client.plotOptions.Marker;
import org.moxieapps.gwt.highcharts.client.plotOptions.SplinePlotOptions;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -58,33 +55,14 @@ public class PolarSheetsXYDiagramPopupPanel extends DialogBox {
}
private void addSpeedAndConfidenceSeriesForTackAndLegType(PolarSheetsXYDiagramData result, Tack tack, LegType legType, boolean showByDefault) {
Point[] pointsForUpwindStarboardAverageSpeedMovingAverage = toPointArray(result.getPointsForAverageSpeedMovingAverage(tack, legType));
Series speedSeriesMovingAverage = chart.createSeries();
speedSeriesMovingAverage.setName(tack + " " + legType + " Speed - MovingAverage");
speedSeriesMovingAverage.setPoints(pointsForUpwindStarboardAverageSpeedMovingAverage);
chart.addSeries(speedSeriesMovingAverage, false, false);
Point[] pointsForUpwindStarboardAverageSpeedRegression = toPointArray(result.getPointsForAverageSpeedRegression(tack, legType));
Series speedSeriesRegression = chart.createSeries();
speedSeriesRegression.setName(tack + " " + legType + " Speed - Regression");
speedSeriesRegression.setPoints(pointsForUpwindStarboardAverageSpeedRegression);
chart.addSeries(speedSeriesRegression, false, false);
Point[] pointsForUpwindStarboardAverageConfidence = toPointArray(result.getPointsForAverageConfidence(tack, legType));
Series confidenceSeries = chart
.createSeries()
.setYAxis(1)
.setType(Series.Type.SPLINE)
.setPlotOptions(
new SplinePlotOptions().setColor("#AA4643").setMarker(new Marker().setEnabled(false))
.setDashStyle(PlotLine.DashStyle.SHORT_DOT));
confidenceSeries.setName(tack + " " + legType + " Confidence");
confidenceSeries.setPoints(pointsForUpwindStarboardAverageConfidence);
chart.addSeries(confidenceSeries, false, false);
if (!showByDefault) {
speedSeriesRegression.setVisible(false, false);
confidenceSeries.setVisible(false, false);
}
}
@@ -61,10 +61,10 @@ import com.sap.sailing.domain.abstractlog.AbstractLog;
import com.sap.sailing.domain.abstractlog.AbstractLogEvent;
import com.sap.sailing.domain.abstractlog.MultiLogAnalyzer;
import com.sap.sailing.domain.abstractlog.impl.AllEventsOfTypeFinder;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.AbortingFlagFinder;
@@ -4395,7 +4395,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
@Override
public UUID importMasterData(final String urlAsString, final String[] groupNames, final boolean override,
final boolean compress, final boolean exportWind) {
final boolean compress, final boolean exportWind, final boolean exportDeviceConfigurations) {
final UUID importOperationId = UUID.randomUUID();
getService().createOrUpdateDataImportProgressWithReplication(importOperationId, 0.0, "Initializing", 0.0);
// Create a progress indicator for as long as the server gets data from the other server.
@@ -4412,7 +4412,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
int port = hostnameAndPort.getB();
String query;
try {
query = createLeaderboardQuery(groupNames, compress, exportWind);
query = createLeaderboardQuery(groupNames, compress, exportWind, exportDeviceConfigurations);
} catch (UnsupportedEncodingException e1) {
throw new RuntimeException(e1);
}
@@ -4502,14 +4502,15 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
return 0;
}
private String createLeaderboardQuery(String[] groupNames, boolean compress, boolean exportWind)
private String createLeaderboardQuery(String[] groupNames, boolean compress, boolean exportWind, boolean exportDeviceConfigurations)
throws UnsupportedEncodingException {
StringBuffer queryStringBuffer = new StringBuffer("");
for (int i = 0; i < groupNames.length; i++) {
String encodedGroupName = URLEncoder.encode(groupNames[i], "UTF-8");
queryStringBuffer.append("names[]=" + encodedGroupName + "&");
}
queryStringBuffer.append(String.format("compress=%s&exportWind=%s", compress, exportWind));
queryStringBuffer.append(String.format("compress=%s&exportWind=%s&exportDeviceConfigs=%s", compress,
exportWind, exportDeviceConfigurations));
return queryStringBuffer.toString();
}
@@ -5585,45 +5586,20 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
@Override
public PolarSheetsXYDiagramData createXYDiagramForBoatClass(String boatClassName) {
BoatClass boatClass = getService().getBaseDomainFactory().getOrCreateBoatClass(boatClassName);
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> movingAverageSpeedDataLists = new HashMap<>();
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> regressionSpeedDataLists = new HashMap<>();
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> averageConfidenceDataLists = new HashMap<>();
for (LegType legType : new LegType[] { LegType.UPWIND, LegType.DOWNWIND }) {
for (Tack tack : new Tack[] { Tack.PORT, Tack.STARBOARD }) {
movingAverageSpeedDataLists.put(new Pair<LegType, Tack>(legType, tack),
new ArrayList<Pair<Double, Double>>());
regressionSpeedDataLists.put(new Pair<LegType, Tack>(legType, tack),
new ArrayList<Pair<Double, Double>>());
averageConfidenceDataLists.put(new Pair<LegType, Tack>(legType, tack),
new ArrayList<Pair<Double, Double>>());
}
}
for (double windInKnots = 0.1; windInKnots < 30; windInKnots = windInKnots + 0.1) {
for (LegType legType : new LegType[] { LegType.UPWIND, LegType.DOWNWIND }) {
for (Tack tack : new Tack[] { Tack.PORT, Tack.STARBOARD }) {
try {
SpeedWithBearingWithConfidence<Void> averageUpwindStarboardMovingAverage = getService()
.getPolarDataService().getAverageSpeedWithBearing(boatClass,
new KnotSpeedImpl(windInKnots), legType, tack, false);
movingAverageSpeedDataLists.get(new Pair<LegType, Tack>(legType, tack)).add(
new Pair<Double, Double>(windInKnots, averageUpwindStarboardMovingAverage.getObject()
.getKnots()));
averageConfidenceDataLists.get(new Pair<LegType, Tack>(legType, tack)).add(
new Pair<Double, Double>(windInKnots, averageUpwindStarboardMovingAverage
.getConfidence()));
} catch (NotEnoughDataHasBeenAddedException e) {
// Do not add a point to the result
}
for (Tack tack : new Tack[] { Tack.PORT, Tack.STARBOARD }) {
try {
SpeedWithBearingWithConfidence<Void> averageUpwindStarboardRegression = getService()
.getPolarDataService().getAverageSpeedWithBearing(boatClass,
new KnotSpeedImpl(windInKnots), legType, tack, true);
new KnotSpeedImpl(windInKnots), legType, tack);
regressionSpeedDataLists.get(new Pair<LegType, Tack>(legType, tack)).add(
new Pair<Double, Double>(windInKnots, averageUpwindStarboardRegression.getObject()
@@ -5635,8 +5611,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
}
}
PolarSheetsXYDiagramData data = new PolarSheetsXYDiagramDataImpl(movingAverageSpeedDataLists,
regressionSpeedDataLists, averageConfidenceDataLists);
PolarSheetsXYDiagramData data = new PolarSheetsXYDiagramDataImpl(regressionSpeedDataLists);
return data;
}
@@ -1,5 +1,6 @@
package com.sap.sailing.gwt.ui.shared.dispatch.event;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.gwt.ui.shared.race.FlagStateDTO;
import com.sap.sailing.gwt.ui.shared.race.RaceMetadataDTO;
import com.sap.sailing.gwt.ui.shared.race.RaceProgressDTO;
@@ -15,8 +16,8 @@ public class LiveRaceDTO extends RaceMetadataDTO<SimpleWindDTO> {
private LiveRaceDTO() {
}
public LiveRaceDTO(String regattaName, String raceName) {
super(regattaName, raceName);
public LiveRaceDTO(String leaderboardName, RegattaAndRaceIdentifier regattaAndRaceIdentifier, String raceName) {
super(leaderboardName, regattaAndRaceIdentifier, raceName);
}
public FlagStateDTO getFlagState() {
@@ -100,6 +100,10 @@ public class RaceContext {
return !LeaderboardNameConstants.DEFAULT_FLEET_NAME.equals(fleet.getName());
}
public String getLeaderboardName() {
return leaderboard.getName();
}
public String getRegattaName() {
if (leaderboard instanceof RegattaLeaderboard) {
Regatta regatta = ((RegattaLeaderboard) leaderboard).getRegatta();
@@ -333,7 +337,7 @@ public class RaceContext {
// and special flags states indicating how the postponed/canceled races will be continued
if (isLiveOrOfPublicInterest()) {
// the start time is always given for live races
LiveRaceDTO liveRaceDTO = new LiveRaceDTO(getRegattaName(), raceColumn.getName());
LiveRaceDTO liveRaceDTO = new LiveRaceDTO(getLeaderboardName(), trackedRace != null ? trackedRace.getRaceIdentifier(): null, raceColumn.getName());
fillRaceData(liveRaceDTO);
liveRaceDTO.setFlagState(getFlagStateOrNull());
liveRaceDTO.setProgress(getProgressOrNull());
@@ -348,7 +352,7 @@ public class RaceContext {
// and special flags states indicating how the postponed/canceled races will be continued
if (getLiveRaceViewState() == RaceViewState.FINISHED) {
// the start time is always given for live races
RaceListRaceDTO liveRaceDTO = new RaceListRaceDTO(getRegattaName(), raceColumn.getName());
RaceListRaceDTO liveRaceDTO = new RaceListRaceDTO(getLeaderboardName(), trackedRace != null ? trackedRace.getRaceIdentifier(): null, raceColumn.getName());
fillRaceData(liveRaceDTO);
liveRaceDTO.setDuration(getDurationOrNull());
liveRaceDTO.setWinner(getWinnerOrNull());
@@ -436,7 +440,6 @@ public class RaceContext {
private void fillRaceData(RaceMetadataDTO<?> dto) {
dto.setViewState(getLiveRaceViewState());
dto.setRegattaDisplayName(getRegattaDisplayName());
dto.setTrackedRaceName(trackedRace != null ? trackedRace.getRaceIdentifier().getRaceName() : null);
dto.setTrackingState(getRaceTrackingState());
dto.setFleet(getFleetMetadataOrNull());
dto.setStart(getStartTimeAsDate());
@@ -1,5 +1,6 @@
package com.sap.sailing.gwt.ui.shared.dispatch.event;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.gwt.ui.shared.race.RaceMetadataDTO;
import com.sap.sailing.gwt.ui.shared.race.wind.WindStatisticsDTO;
import com.sap.sse.common.Duration;
@@ -15,9 +16,9 @@ public class RaceListRaceDTO extends RaceMetadataDTO<WindStatisticsDTO> {
@SuppressWarnings("unused")
private RaceListRaceDTO() {
}
public RaceListRaceDTO(String regattaName, String raceName) {
super(regattaName, raceName);
public RaceListRaceDTO(String leaderboardName, RegattaAndRaceIdentifier regattaAndRaceIdentifier, String raceName) {
super(leaderboardName, regattaAndRaceIdentifier, raceName);
}
public Duration getDuration() {
@@ -3,21 +3,21 @@ package com.sap.sailing.gwt.ui.shared.dispatch.news;
import java.util.Date;
import com.google.gwt.core.shared.GwtIncompatible;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
public abstract class AbstractRaceNewsEntryDTO extends NewsEntryDTO {
private String regattaName;
private String trackedRaceName;
private String leaderboardName;
private RegattaAndRaceIdentifier regattaAndRaceIdentfier;
private String boatClass;
protected AbstractRaceNewsEntryDTO() {
}
@GwtIncompatible
public AbstractRaceNewsEntryDTO(String regattaName, String trackedRaceName, String raceTitle, String boatClass, Date timestamp) {
public AbstractRaceNewsEntryDTO(String leaderboardName, RegattaAndRaceIdentifier regattaAndRaceIdentifier, String raceTitle, String boatClass, Date timestamp) {
super(raceTitle, timestamp, null);
this.regattaName = regattaName;
this.trackedRaceName = trackedRaceName;
this.leaderboardName = leaderboardName;
this.boatClass = boatClass;
}
@@ -26,19 +26,11 @@ public abstract class AbstractRaceNewsEntryDTO extends NewsEntryDTO {
return boatClass;
}
public String getRegattaName() {
return regattaName;
public String getLeaderboardName() {
return leaderboardName;
}
public void setRegattaName(String regattaName) {
this.regattaName = regattaName;
}
public String getTrackedRaceName() {
return trackedRaceName;
}
public void setTrackedRaceName(String trackedRaceName) {
this.trackedRaceName = trackedRaceName;
public RegattaAndRaceIdentifier getRegattaAndRaceIdentfier() {
return regattaAndRaceIdentfier;
}
}
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.dispatch.news;
import java.util.Date;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.gwt.ui.client.StringMessages;
public class RaceCompetitorNewsEntryDTO extends AbstractRaceNewsEntryDTO {
@@ -17,8 +18,8 @@ public class RaceCompetitorNewsEntryDTO extends AbstractRaceNewsEntryDTO {
private RaceCompetitorNewsEntryDTO() {
}
public RaceCompetitorNewsEntryDTO(String regattaName, String trackedRaceName, String raceTitle, String boatClass, Date timestamp, String competitorName, Type type) {
super(regattaName, trackedRaceName, raceTitle, boatClass, timestamp);
public RaceCompetitorNewsEntryDTO(String leaderboardName, RegattaAndRaceIdentifier regattaAndRaceIdentifier, String raceTitle, String boatClass, Date timestamp, String competitorName, Type type) {
super(leaderboardName, regattaAndRaceIdentifier, raceTitle, boatClass, timestamp);
this.competitorName = competitorName;
this.type = type;
}
@@ -2,6 +2,7 @@ package com.sap.sailing.gwt.ui.shared.race;
import java.util.Date;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.dispatch.DTO;
import com.sap.sailing.gwt.ui.shared.race.wind.AbstractWindDTO;
@@ -56,10 +57,11 @@ public abstract class RaceMetadataDTO<WIND extends AbstractWindDTO> implements D
TRACKED_VALID_DATA // tracking is connected and all required data for displaying the race viewer is available
}
private String leaderboardName;
private RegattaAndRaceIdentifier regattaAndRaceIdentifier;
private String regattaName;
private String regattaDisplayName;
private String raceName;
private String trackedRaceName;
private FleetMetadataDTO fleet;
private Date start;
private String courseArea;
@@ -72,8 +74,10 @@ public abstract class RaceMetadataDTO<WIND extends AbstractWindDTO> implements D
protected RaceMetadataDTO() {
}
public RaceMetadataDTO(String regattaName, String raceName) {
this.regattaName = regattaName;
public RaceMetadataDTO(String leaderboardName, RegattaAndRaceIdentifier regattaAndRaceIdentifier, String raceName) {
this.leaderboardName = leaderboardName;
this.regattaAndRaceIdentifier = regattaAndRaceIdentifier;
this.regattaName = leaderboardName;
this.raceName = raceName;
}
@@ -81,6 +85,10 @@ public abstract class RaceMetadataDTO<WIND extends AbstractWindDTO> implements D
return regattaName;
}
public String getLeaderboardName() {
return leaderboardName;
}
public String getRaceName() {
return raceName;
}
@@ -141,14 +149,6 @@ public abstract class RaceMetadataDTO<WIND extends AbstractWindDTO> implements D
this.trackingState = trackingState;
}
public String getTrackedRaceName() {
return trackedRaceName;
}
public void setTrackedRaceName(String trackedRaceName) {
this.trackedRaceName = trackedRaceName;
}
public WIND getWind() {
return wind;
}
@@ -165,6 +165,10 @@ public abstract class RaceMetadataDTO<WIND extends AbstractWindDTO> implements D
this.regattaDisplayName = regattaDisplayName;
}
public RegattaAndRaceIdentifier getRegattaAndRaceIdentifier() {
return regattaAndRaceIdentifier;
}
@Override
public int compareTo(RaceMetadataDTO<WIND> o) {
Date thisStart = getStart();
@@ -36,7 +36,7 @@ public class StoreCompetitorTest extends AbstractMongoDBTest {
@Before
public void setUp() {
// clear the domainFactory competitor store for a clean start:
domainFactory = new DomainFactoryImpl();
domainFactory = new DomainFactoryImpl((srlid)->null);
}
private void dropCompetitorCollection() {
@@ -347,7 +347,7 @@ public class TestStoringAndRetrievingLeaderboards extends AbstractMongoDBTest {
final int[] discardIndexResultsStartingWithHowManyRaces = new int[] { 5, 8 };
FlexibleLeaderboardImpl leaderboard = new FlexibleLeaderboardImpl(leaderboardName, new ThresholdBasedResultDiscardingRuleImpl(discardIndexResultsStartingWithHowManyRaces),
new LowPoint(), null);
final DomainFactory domainFactory = new DomainFactoryImpl();
final DomainFactory domainFactory = new DomainFactoryImpl((srlid)->null);
// create the competitor through the competitor store/factory here so that the DomainObjectFactory finds it and
// resolves the score corrections appropriate
Competitor competitor = domainFactory.getOrCreateCompetitor(123, "$$$Dr. Wolfgang+Hunger$$$", Color.RED, "someone@nowhere.de", null, new TeamImpl("STG", Collections.singleton(
@@ -1,5 +1,7 @@
package com.sap.sailing.monitoring;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -29,84 +31,96 @@ import com.sap.sailing.monitoring.sysinfo.SystemInformationImpl;
* @since Nov 26, 2012
*/
public class OSGiRestartingPortMonitor extends AbstractPortMonitor {
Logger log = Logger.getLogger(OSGiRestartingPortMonitor.class.getName());
final static private Logger log = Logger.getLogger(OSGiRestartingPortMonitor.class.getName());
private final int DEFAULT_RETRY_COUNT_BEFORE_RESTART = 5;
final int retryCountBeforeRestart;
final Map<Endpoint, Integer> failureCount;
SystemInformation info = null;
public OSGiRestartingPortMonitor(Properties properties) {
super(properties);
failureCount = new HashMap<>();
String[] props_bundles = properties.getProperty("monitor.bundles").split(",");
retryCountBeforeRestart = Integer.valueOf(properties.getProperty("monitor.retrycount", ""+DEFAULT_RETRY_COUNT_BEFORE_RESTART).trim());
for (int i=0; i<endpoints.length;i++) {
endpoints[i].setBundleName(props_bundles[i].trim());
}
this.info = SystemInformationImpl.getInstance();
log.info("Started and initialized OSGi monitor. State of SIGAR sysstats library: " + (info == null ? "INACTIVE" : "ACTIVE") + " java.library.path: " + System.getProperty("java.library.path"));
}
@Override
public void handleFailure(Endpoint endpoint) {
boolean sysinfo_available = true;
if (this.info == null) {
sysinfo_available = false;
}
Bundle bundle = getBundleByName(endpoint.getBundleName());
if (bundle == null) {
log.severe("Couldn't find bundle "+endpoint.getBundleName()+". Cannot restart. Please check monitoring.properties file");
try {
sendMail(endpoint, "Couldn't find non-responsive bundle "+endpoint.getBundleName(),
"Couldn't find bundle "+endpoint.getBundleName()+". Cannot restart. Please check monitoring.properties file");
} catch (Exception e) {
e.printStackTrace();
log.log(Level.SEVERE, "handleFailure", e);
int myFailureCount = (failureCount.get(endpoint) == null ? 0 : failureCount.get(endpoint))+1;
if (myFailureCount > retryCountBeforeRestart) {
failureCount.remove(endpoint);
boolean sysinfo_available = true;
if (this.info == null) {
sysinfo_available = false;
}
} else {
String info_before_restart = "";
if (sysinfo_available) {
info_before_restart = info.toString();
}
if (bundle.getState() == BundleEvent.STARTED || bundle.getState() == BundleEvent.STOPPED || bundle.getState() == 32l) {
Bundle bundle = getBundleByName(endpoint.getBundleName());
if (bundle == null) {
log.severe("Couldn't find bundle "+endpoint.getBundleName()+". Cannot restart. Please check monitoring.properties file");
try {
bundle.stop();
} catch (BundleException e) {
log.severe("Could not stop " + endpoint.getBundleName() + " trying to start anyway.");
}
try {
bundle.start();
} catch (BundleException e) {
e.printStackTrace();
log.severe("Could not start " + endpoint.getBundleName() + "! Handler will try again next time");
}
} else {
log.severe("Bundle " + endpoint.getBundleName() + " not in state STARTED or ACTIVE (State: +"+bundle.getState()+")! Restart not performed.");
}
final String subject = "Bundle " + endpoint.getBundleName() + " restarted";
log.info(subject);
/* only send mail if service has not failed before and mailing is enabled */
if (!endpoint.hasFailed() /* before */ && this.properties.getProperty("mail.enabled", "true").equalsIgnoreCase("true")) {
log.info("Sending mail to " + this.properties.getProperty("mail.to") + " saying that bundle "
+ endpoint.getBundleName() + " was restarted");
try {
String content = "The Bundle " + endpoint.getBundleName() + " has been restarted - check on "
+ endpoint + " didn't respond!\n"
+ "This Mail won't be sent again if service continues to fail.";
if (sysinfo_available) {
content += "\n\nSystem Information BEFORE restart:\n" + info_before_restart;
content += "\n\nSystem information AFTER restart:\n" + info.toString();
} else {
content += "\n\nSystem information NOT available due to an error in the library (in most cases caused by native libs not being available)";
}
sendMail(endpoint, subject, content);
sendMail(endpoint, "Couldn't find non-responsive bundle "+endpoint.getBundleName(),
"Couldn't find bundle "+endpoint.getBundleName()+". Cannot restart. Please check monitoring.properties file");
} catch (Exception e) {
e.printStackTrace();
log.throwing(getClass().getName(), "handleFailure", e);
log.log(Level.SEVERE, "handleFailure", e);
}
} else {
String info_before_restart = "";
if (sysinfo_available) {
info_before_restart = info.toString();
}
if (bundle.getState() == BundleEvent.STARTED || bundle.getState() == BundleEvent.STOPPED || bundle.getState() == 32l) {
try {
bundle.stop();
} catch (BundleException e) {
log.severe("Could not stop " + endpoint.getBundleName() + " trying to start anyway.");
}
try {
bundle.start();
} catch (BundleException e) {
e.printStackTrace();
log.severe("Could not start " + endpoint.getBundleName() + "! Handler will try again next time");
}
} else {
log.severe("Bundle " + endpoint.getBundleName() + " not in state STARTED or ACTIVE (State: +"+bundle.getState()+")! Restart not performed.");
}
final String subject = "Bundle " + endpoint.getBundleName() + " restarted";
log.info(subject);
/* only send mail if service has not failed before and mailing is enabled */
if (!endpoint.hasFailed() /* before */ && this.properties.getProperty("mail.enabled", "true").equalsIgnoreCase("true")) {
log.info("Sending mail to " + this.properties.getProperty("mail.to") + " saying that bundle "
+ endpoint.getBundleName() + " was restarted");
try {
String content = "The Bundle " + endpoint.getBundleName() + " has been restarted - check on "
+ endpoint + " didn't respond!\n"
+ "This Mail won't be sent again if service continues to fail.";
if (sysinfo_available) {
content += "\n\nSystem Information BEFORE restart:\n" + info_before_restart;
content += "\n\nSystem information AFTER restart:\n" + info.toString();
} else {
content += "\n\nSystem information NOT available due to an error in the library (in most cases caused by native libs not being available)";
}
sendMail(endpoint, subject, content);
} catch (Exception e) {
e.printStackTrace();
log.throwing(getClass().getName(), "handleFailure", e);
}
}
}
} else {
log.info("Endpoint "+endpoint+" failed the "+myFailureCount+"th time since the last success. Trying again.");
failureCount.put(endpoint, myFailureCount);
}
}
@@ -128,6 +142,10 @@ public class OSGiRestartingPortMonitor extends AbstractPortMonitor {
@Override
public void handleConnection(Endpoint endpoint) {
final Integer previousFailureCount;
if ((previousFailureCount = failureCount.remove(endpoint)) != null) { // endpoint succeeded
log.info("endpoint "+endpoint+" recovered after "+previousFailureCount+" failures");
}
}
protected Bundle getBundleByName(String name) {
@@ -49,10 +49,14 @@ import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.DynamicGPSFixMovingTrackImpl;
import com.sap.sailing.domain.tracking.impl.WindWithConfidenceImpl;
import com.sap.sailing.polars.mining.BearingClusterGroup;
import com.sap.sailing.polars.mining.CubicRegressionPerCourseProcessor;
import com.sap.sailing.polars.mining.PolarDataMiner;
import com.sap.sailing.polars.mining.SpeedRegressionPerAngleClusterProcessor;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import com.sap.sse.datamining.data.ClusterGroup;
public class PolarDataMinerTest {
@@ -73,12 +77,20 @@ public class PolarDataMinerTest {
return new PolarSheetGenerationSettingsImpl(50, 0.1, 20, 20, 0.1, true, true, 2, 0.05, true, windStepping,
false, 3);
}
private ClusterGroup<Bearing> createAngleClusterGroup() {
return new BearingClusterGroup(0, 180, 5);
}
@Ignore
@Test
public void testGrouping() throws InterruptedException, TimeoutException, NoSuchMethodException,
NotEnoughDataHasBeenAddedException {
PolarDataMiner miner = new PolarDataMiner(createTestPolarSettings());
PolarSheetGenerationSettings settings = createTestPolarSettings();
ClusterGroup<Bearing> angleClusterGroup = createAngleClusterGroup();
PolarDataMiner miner = new PolarDataMiner(settings,
new CubicRegressionPerCourseProcessor(),
new SpeedRegressionPerAngleClusterProcessor(angleClusterGroup), angleClusterGroup);
BoatClass mockedBoatClass = mock(BoatClass.class);
@@ -19,7 +19,9 @@ Require-Bundle:
com.sap.sse,
com.sap.sse.shared.android,
org.apache.commons.math;bundle-version="2.1.0",
org.eclipse.osgi
org.eclipse.osgi,
com.sap.sse.replication;bundle-version="1.0.0",
com.sap.sse.operationaltransformation;bundle-version="1.0.0"
Import-Package:
com.sap.sailing.util,
com.sap.sse.common
@@ -0,0 +1,8 @@
package com.sap.sailing.polars;
import com.sap.sailing.polars.impl.PolarDataServiceImpl;
import com.sap.sse.replication.OperationWithResult;
public interface PolarDataOperation<T> extends OperationWithResult<PolarDataServiceImpl, T>{
}
@@ -13,6 +13,8 @@ import com.sap.sse.datamining.impl.data.ComparisonStrategy;
import com.sap.sse.datamining.impl.data.FixClusterGroup;
public class SpeedClusterGroup extends FixClusterGroup<Speed> {
private static final long serialVersionUID = -3428022721991223921L;
/**
* A {@link SpeedClusterGroup} lets the user set the level mids for all its clusters. The Boundaries will
@@ -1,6 +1,8 @@
package com.sap.sailing.polars.impl;
import java.util.Dictionary;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Set;
import java.util.logging.Logger;
@@ -9,6 +11,7 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import com.sap.sailing.domain.polars.PolarDataService;
import com.sap.sse.replication.Replicable;
public class Activator implements BundleActivator {
@@ -19,7 +22,11 @@ public class Activator implements BundleActivator {
@Override
public void start(BundleContext context) throws Exception {
logger.info("Registering PolarDataService");
registrations.add(context.registerService(PolarDataService.class, new PolarDataServiceImpl(), null));
PolarDataServiceImpl service = new PolarDataServiceImpl();
registrations.add(context.registerService(PolarDataService.class, service, null));
final Dictionary<String, String> replicableServiceProperties = new Hashtable<>();
replicableServiceProperties.put(Replicable.OSGi_Service_Registry_ID_Property_Name, service.getId().toString());
registrations.add(context.registerService(Replicable.class.getName(), service, replicableServiceProperties));
}
@Override
@@ -1,13 +1,23 @@
package com.sap.sailing.polars.impl;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.logging.Logger;
import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.base.SpeedWithBearingWithConfidence;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.impl.SpeedWithBearingWithConfidenceImpl;
@@ -22,17 +32,28 @@ import com.sap.sailing.domain.common.confidence.BearingWithConfidence;
import com.sap.sailing.domain.common.confidence.impl.BearingWithConfidenceImpl;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.PolarSheetGenerationSettingsImpl;
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
import com.sap.sailing.domain.polars.NotEnoughDataHasBeenAddedException;
import com.sap.sailing.domain.polars.PolarDataService;
import com.sap.sailing.domain.polars.PolarsChangedListener;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.polars.PolarDataOperation;
import com.sap.sailing.polars.aggregation.PolarFixAggregator;
import com.sap.sailing.polars.aggregation.SimplePolarFixRaceInterval;
import com.sap.sailing.polars.data.PolarFix;
import com.sap.sailing.polars.generation.PolarSheetGenerator;
import com.sap.sailing.polars.mining.BearingClusterGroup;
import com.sap.sailing.polars.mining.CubicRegressionPerCourseProcessor;
import com.sap.sailing.polars.mining.PolarDataMiner;
import com.sap.sailing.polars.mining.SpeedRegressionPerAngleClusterProcessor;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.datamining.data.ClusterGroup;
import com.sap.sse.replication.OperationExecutionListener;
import com.sap.sse.replication.OperationWithResult;
import com.sap.sse.replication.ReplicationMasterDescriptor;
import com.sap.sse.replication.impl.OperationWithResultWithIdWrapper;
import com.sap.sse.replication.impl.ReplicableWithObjectInputStream;
import com.sap.sse.util.SmartFutureCache;
/**
@@ -43,16 +64,48 @@ import com.sap.sse.util.SmartFutureCache;
* @author Frederik Petersen (D054528)
*
*/
public class PolarDataServiceImpl implements PolarDataService {
public class PolarDataServiceImpl implements PolarDataService, ReplicableWithObjectInputStream<PolarDataServiceImpl, PolarDataOperation<?>>{
private final PolarDataMiner polarDataMiner;
private static final Logger logger = Logger.getLogger(PolarDataServiceImpl.class.getSimpleName());
private PolarDataMiner polarDataMiner;
private final ConcurrentHashMap<OperationExecutionListener<PolarDataServiceImpl>, OperationExecutionListener<PolarDataServiceImpl>> operationExecutionListeners;
/**
* The master from which this replicable is currently replicating, or <code>null</code> if this replicable is not
* currently replicated from any master.
*/
private ReplicationMasterDescriptor replicatingFromMaster;
private final Set<OperationWithResult<PolarDataServiceImpl, ?>> operationsSentToMasterForReplication;
private ThreadLocal<Boolean> currentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster = ThreadLocal
.withInitial(() -> false);
private DomainFactory domainFactory;
public PolarDataServiceImpl() {
this.polarDataMiner = new PolarDataMiner();
PolarSheetGenerationSettings settings = PolarSheetGenerationSettingsImpl.createBackendPolarSettings();
ClusterGroup<Bearing> angleClusterGroup = createAngleClusterGroup();
CubicRegressionPerCourseProcessor cubicRegressionPerCourseProcessor = new CubicRegressionPerCourseProcessor();
SpeedRegressionPerAngleClusterProcessor speedRegressionPerAngleClusterProcessor = new SpeedRegressionPerAngleClusterProcessor(
angleClusterGroup);
this.polarDataMiner = new PolarDataMiner(settings, cubicRegressionPerCourseProcessor,
speedRegressionPerAngleClusterProcessor, angleClusterGroup);
this.operationsSentToMasterForReplication = new HashSet<>();
this.operationExecutionListeners = new ConcurrentHashMap<>();
}
private ClusterGroup<Bearing> createAngleClusterGroup() {
return new BearingClusterGroup(0, 180, 5);
}
@Override
public SpeedWithConfidence<Void> getSpeed(BoatClass boatClass, Speed windSpeed, Bearing trueWindAngle) throws NotEnoughDataHasBeenAddedException {
if (polarDataMiner == null) {
throw new NotEnoughDataHasBeenAddedException("Polar Data Miner is currently unavailable. Maybe we are in the process of replication initial load?");
}
return polarDataMiner.estimateBoatSpeed(boatClass, windSpeed, trueWindAngle);
}
@@ -64,9 +117,12 @@ public class PolarDataServiceImpl implements PolarDataService {
@Override
public SpeedWithBearingWithConfidence<Void> getAverageSpeedWithBearing(BoatClass boatClass, Speed windSpeed,
LegType legType, Tack tack, boolean useRegressionForSpeed) throws NotEnoughDataHasBeenAddedException {
LegType legType, Tack tack) throws NotEnoughDataHasBeenAddedException {
if (polarDataMiner == null) {
throw new NotEnoughDataHasBeenAddedException("Polar Data Miner is currently unavailable. Maybe we are in the process of replication initial load?");
}
SpeedWithBearingWithConfidence<Void> averageSpeedAndCourseOverGround = polarDataMiner
.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType, useRegressionForSpeed);
.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType);
if (tack == Tack.PORT) {
//Negative twa
DegreeBearingImpl bearing = new DegreeBearingImpl(-averageSpeedAndCourseOverGround.getObject().getBearing()
@@ -185,19 +241,16 @@ public class PolarDataServiceImpl implements PolarDataService {
if (boatClass == null || windSpeed == null) {
throw new IllegalArgumentException("Boatclass and windspeed cannot be null.");
}
SpeedWithBearingWithConfidence<Void> speed = polarDataMiner.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType, true);
if (polarDataMiner == null) {
throw new NotEnoughDataHasBeenAddedException("Polar Data Miner is currently unavailable. Maybe we are in the process of replication initial load?");
}
SpeedWithBearingWithConfidence<Void> speed = polarDataMiner.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType);
Bearing bearing = new DegreeBearingImpl(speed.getObject().getBearing().getDegrees() * 2);
BearingWithConfidence<Void> bearingWithConfidence = new BearingWithConfidenceImpl<Void>(bearing, speed.getConfidence(),
null);
return bearingWithConfidence;
}
@Override
public SpeedWithBearingWithConfidence<Void> getAverageSpeedWithBearing(BoatClass boatClass, Speed windSpeed,
LegType legType, Tack tack) throws NotEnoughDataHasBeenAddedException {
return getAverageSpeedWithBearing(boatClass, windSpeed, legType, tack, true);
}
@Override
public void insertExistingFixes(TrackedRace trackedRace) {
for (Competitor competitor : trackedRace.getRace().getCompetitors()) {
@@ -217,4 +270,113 @@ public class PolarDataServiceImpl implements PolarDataService {
polarDataMiner.unregisterListener(boatClass, listener);
}
@Override
public void addOperationExecutionListener(OperationExecutionListener<PolarDataServiceImpl> listener) {
operationExecutionListeners.put(listener, listener);
}
@Override
public void removeOperationExecutionListener(OperationExecutionListener<PolarDataServiceImpl> listener) {
operationExecutionListeners.remove(listener);
}
@Override
public void clearReplicaState() throws MalformedURLException, IOException, InterruptedException {
polarDataMiner = null;
}
@Override
public boolean isCurrentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster() {
return currentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster.get();
}
@Override
public void setCurrentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster(boolean b) {
currentlyFillingFromInitialLoadOrApplyingOperationReceivedFromMaster.set(b);
}
@Override
public Serializable getId() {
return getClass().getName();
}
@Override
public ObjectInputStream createObjectInputStreamResolvingAgainstCache(InputStream is) throws IOException {
ObjectInputStream ois;
if (domainFactory != null) {
ois = domainFactory.createObjectInputStreamResolvingAgainstThisFactory(is);
} else {
// TODO ensure that domainfactory is set here. Otherwise there can be issues with duplicate domain objects
logger.warning("PolarDataService didn't have a domain factory attached. Replication to this service could fail.");
ois = new ObjectInputStream(is);
}
return ois;
}
@Override
public void initiallyFillFromInternal(ObjectInputStream is) throws IOException, ClassNotFoundException,
InterruptedException {
PolarSheetGenerationSettings backendPolarSettings = (PolarSheetGenerationSettings) is.readObject();
CubicRegressionPerCourseProcessor cubicRegressionPerCourseProcessor = (CubicRegressionPerCourseProcessor) is.readObject();
SpeedRegressionPerAngleClusterProcessor speedRegressionPerAngleClusterProcessor = (SpeedRegressionPerAngleClusterProcessor) is.readObject();
polarDataMiner = new PolarDataMiner(backendPolarSettings,
cubicRegressionPerCourseProcessor, speedRegressionPerAngleClusterProcessor,
speedRegressionPerAngleClusterProcessor.getAngleCluster());
}
@Override
public void serializeForInitialReplicationInternal(ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.writeObject(polarDataMiner.getPolarSheetGenerationSettings());
//objectOutputStream.writeObject(polarDataMiner.getMovingAverageProcessor());
objectOutputStream.writeObject(polarDataMiner.getCubicRegressionPerCourseProcessor());
objectOutputStream.writeObject(polarDataMiner.getSpeedRegressionPerAngleClusterProcessor());
}
@Override
public Iterable<OperationExecutionListener<PolarDataServiceImpl>> getOperationExecutionListeners() {
return operationExecutionListeners.keySet();
}
@Override
public ReplicationMasterDescriptor getMasterDescriptor() {
return replicatingFromMaster;
}
@Override
public void startedReplicatingFrom(ReplicationMasterDescriptor master) {
this.replicatingFromMaster = master;
}
@Override
public void stoppedReplicatingFrom(ReplicationMasterDescriptor master) {
this.replicatingFromMaster = null;
}
@Override
public boolean hasSentOperationToMaster(OperationWithResult<PolarDataServiceImpl, ?> operation) {
return this.operationsSentToMasterForReplication.contains(operation);
}
@Override
public void addOperationSentToMasterForReplication(
OperationWithResultWithIdWrapper<PolarDataServiceImpl, ?> operation) {
this.operationsSentToMasterForReplication.add(operation);
}
@Override
public void registerDomainFactory(DomainFactory domainFactory) {
this.domainFactory = domainFactory;
}
@Override
public void unregisterDomainFactory(DomainFactory domainFactory) {
if (this.domainFactory == domainFactory) {
this.domainFactory = null;
}
}
}
@@ -1,5 +1,6 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
@@ -24,8 +25,9 @@ import com.sap.sailing.polars.regression.impl.IncrementalAnyOrderLeastSquaresImp
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util.Pair;
public class AngleAndSpeedRegression {
public class AngleAndSpeedRegression implements Serializable {
private static final long serialVersionUID = 6343595388753945979L;
private final IncrementalLeastSquares speedRegression = new IncrementalAnyOrderLeastSquaresImpl(3, false);
private final IncrementalLeastSquares angleRegression = new IncrementalAnyOrderLeastSquaresImpl(3);
@@ -1,7 +1,10 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
public class AverageAngleContainer {
public class AverageAngleContainer implements Serializable {
private static final long serialVersionUID = -6370647955050312847L;
private int dataCount = 0;
private double angleSumDeg = 0.0;
private double averageAngleDeg = 0.0;
@@ -1,5 +1,6 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
@@ -18,6 +19,8 @@ import com.sap.sse.i18n.ResourceBundleStringMessages;
public class BearingClusterGroup extends FixClusterGroup<Bearing>{
private static final long serialVersionUID = -3810975212669767738L;
public BearingClusterGroup(int startAngle, int endAngle, int clusterSize) {
super("", createClusters(startAngle, endAngle, clusterSize));
}
@@ -35,13 +38,7 @@ public class BearingClusterGroup extends FixClusterGroup<Bearing>{
private static ClusterBoundary<Bearing> createBoundary(double angleInDeg, ComparisonStrategy strategy) {
Bearing angle = new DegreeBearingImpl(angleInDeg);
Comparator<Bearing> comparator = new Comparator<Bearing>() {
@Override
public int compare(Bearing arg0, Bearing arg1) {
return new Double(arg0.getDegrees()).compareTo(new Double(arg1.getDegrees()));
}
};
Comparator<Bearing> comparator = new BearingComparator();
return new ComparatorClusterBoundary<Bearing>(angle, strategy, comparator);
}
@@ -49,6 +46,16 @@ public class BearingClusterGroup extends FixClusterGroup<Bearing>{
public String getLocalizedName(Locale locale, ResourceBundleStringMessages stringMessages) {
return "";
}
private static class BearingComparator implements Comparator<Bearing>, Serializable {
private static final long serialVersionUID = 8166601046140275541L;
@Override
public int compare(Bearing arg0, Bearing arg1) {
return new Double(arg0.getDegrees()).compareTo(new Double(arg1.getDegrees()));
}
};
}
@@ -1,5 +1,6 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -22,17 +23,19 @@ import com.sap.sse.datamining.factories.GroupKeyFactory;
import com.sap.sse.datamining.impl.components.GroupedDataEntry;
import com.sap.sse.datamining.shared.GroupKey;
public class CubicRegressionPerCourseProcessor implements Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void> {
public class CubicRegressionPerCourseProcessor implements
Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void>, Serializable {
private static final long serialVersionUID = 3059764273262382648L;
private static final Logger logger = Logger.getLogger(CubicRegressionPerCourseProcessor.class.getName());
private final Map<GroupKey, AngleAndSpeedRegression> regressions = new HashMap<>();
private ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners;
public CubicRegressionPerCourseProcessor(ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners) {
this.listeners = listeners;
}
/**
* FIXME Make sure replication and listeners interact correctly
*/
private transient ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners;
@Override
public boolean canProcessElements() {
@@ -145,6 +148,10 @@ public class CubicRegressionPerCourseProcessor implements Processor<GroupedDataE
logger.severe("Polar Data Mining Pipe failed. Cause: " + failure.getMessage());
throw new RuntimeException("Polar Data Miner failed.", failure);
}
public void setListeners(ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners) {
this.listeners = listeners;
}
@Override
@@ -187,4 +194,6 @@ public class CubicRegressionPerCourseProcessor implements Processor<GroupedDataE
return null;
}
}
@@ -10,7 +10,6 @@ import com.sap.sailing.domain.common.Bearing;
import com.sap.sailing.domain.common.LegType;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.common.WindSource;
import com.sap.sailing.domain.common.WindSourceType;
import com.sap.sailing.domain.common.confidence.BearingWithConfidence;
@@ -28,12 +27,11 @@ import com.sap.sse.common.Util.Pair;
import com.sap.sse.datamining.data.Cluster;
import com.sap.sse.datamining.data.ClusterGroup;
public class GPSFixMovingWithPolarContext implements MovingAveragePolarClusterKey, AngleClusterPolarClusterKey {
public class GPSFixMovingWithPolarContext implements LegTypePolarClusterKey, AngleClusterPolarClusterKey {
private final GPSFixMoving fix;
private final TrackedRace race;
private final Competitor competitor;
private final ClusterGroup<Speed> windSpeedClusterGroup;
private final Set<WindSource> windSourcesToExcludeForSpeed;
private final ClusterGroup<Bearing> angleClusterGroup;
private final BearingWithConfidence<Void> absTrueWindAngle;
@@ -42,11 +40,10 @@ public class GPSFixMovingWithPolarContext implements MovingAveragePolarClusterKe
private LegType legType;
public GPSFixMovingWithPolarContext(GPSFixMoving fix, TrackedRace race, Competitor competitor,
ClusterGroup<Speed> windSpeedClusterGroup, ClusterGroup<Bearing> angleClusterGroup) {
ClusterGroup<Bearing> angleClusterGroup) {
this.fix = fix;
this.race = race;
this.competitor = competitor;
this.windSpeedClusterGroup = windSpeedClusterGroup;
this.angleClusterGroup = angleClusterGroup;
this.windSourcesToExcludeForSpeed = collectWindSourcesToIgnoreForSpeed();
this.absTrueWindAngle = computeTrueWindAngleAbsolute();
@@ -89,12 +86,6 @@ public class GPSFixMovingWithPolarContext implements MovingAveragePolarClusterKe
return result;
}
@Override
public Cluster<Speed> getWindSpeedCluster() {
final WindWithConfidence<Pair<Position, TimePoint>> windWithConfidence = getWind();
return windWithConfidence == null ? null : windSpeedClusterGroup.getClusterFor(windWithConfidence.getObject());
}
public WindWithConfidence<Pair<Position, TimePoint>> getWind() {
return wind;
}
@@ -1,6 +1,6 @@
package com.sap.sailing.polars.mining;
import java.util.Set;
import java.io.Serializable;
import com.sap.sailing.domain.base.BoatClass;
import com.sap.sailing.domain.base.SpeedWithBearingWithConfidence;
@@ -8,11 +8,11 @@ import com.sap.sailing.domain.common.LegType;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.polars.NotEnoughDataHasBeenAddedException;
import com.sap.sse.datamining.components.Processor;
import com.sap.sse.datamining.data.ClusterGroup;
import com.sap.sse.datamining.impl.components.GroupedDataEntry;
public interface MovingAverageProcessor extends Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void>{
public interface MovingAverageProcessor extends Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void>, Serializable {
SpeedWithBearingWithConfidence<Void> getAverageSpeedAndCourseOverGround(BoatClass boatClass,
Speed windSpeed, LegType legType) throws NotEnoughDataHasBeenAddedException;
Set<BoatClass> getAvailableBoatClasses();
ClusterGroup<Speed> getSpeedCluster();
}
@@ -1,9 +1,7 @@
package com.sap.sailing.polars.mining;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
import com.sap.sailing.domain.base.BoatClass;
@@ -33,6 +31,8 @@ import com.sap.sse.datamining.shared.GroupKey;
public class MovingAverageProcessorImpl implements MovingAverageProcessor {
private static final long serialVersionUID = 9016357546663534562L;
private static final Logger logger = Logger.getLogger(MovingAverageProcessorImpl.class.getName());
private final Map<GroupKey, MovingAverageBoatSpeedEstimator> boatSpeedEstimators = new HashMap<>();
@@ -41,10 +41,6 @@ public class MovingAverageProcessorImpl implements MovingAverageProcessor {
private final ClusterGroup<Speed> speedClusterGroup;
private final Set<BoatClass> availableBoatClasses = new HashSet<>();
public MovingAverageProcessorImpl(ClusterGroup<Speed> speedClusterGroup) {
this.speedClusterGroup = speedClusterGroup;
}
@@ -79,7 +75,6 @@ public class MovingAverageProcessorImpl implements MovingAverageProcessor {
BearingWithConfidence<Void> angleToTheWind = fix.getAbsoluteAngleToTheWind();
WindWithConfidence<Pair<Position, TimePoint>> windSpeed = fix.getWind();
SpeedWithBearingWithConfidence<TimePoint> boatSpeedWithConfidence = fix.getBoatSpeed();
availableBoatClasses.add(element.getDataEntry().getBoatClass());
WindWithConfidence<Pair<Position, TimePoint>> windWithConfidenceForSpeed = windSpeed;
double confidenceForWindSpeed = windWithConfidenceForSpeed.getConfidence();
double confidenceForWindBearing = angleToTheWind.getConfidence();
@@ -158,10 +153,6 @@ public class MovingAverageProcessorImpl implements MovingAverageProcessor {
throw new RuntimeException("Polar Data Miner failed.", failure);
}
public Set<BoatClass> getAvailableBoatClasses() {
return availableBoatClasses;
}
@Override
public Class<GroupedDataEntry<GPSFixMovingWithPolarContext>> getInputType() {
// TODO Auto-generated method stub
@@ -218,4 +209,9 @@ public class MovingAverageProcessorImpl implements MovingAverageProcessor {
return compoundKey;
}
@Override
public ClusterGroup<Speed> getSpeedCluster() {
return speedClusterGroup;
}
}
@@ -36,10 +36,8 @@ import com.sap.sailing.domain.common.TrackedRaceStatusEnum;
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
import com.sap.sailing.domain.common.impl.KnotSpeedImpl;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.PolarSheetGenerationSettingsImpl;
import com.sap.sailing.domain.common.impl.PolarSheetsDataImpl;
import com.sap.sailing.domain.common.impl.PolarSheetsHistogramDataImpl;
import com.sap.sailing.domain.common.impl.WindSpeedSteppingWithMaxDistance;
import com.sap.sailing.domain.common.tracking.GPSFixMoving;
import com.sap.sailing.domain.polars.NotEnoughDataHasBeenAddedException;
import com.sap.sailing.domain.polars.PolarsChangedListener;
@@ -61,7 +59,6 @@ public class PolarDataMiner {
private static final int EXECUTOR_QUEUE_SIZE = 100;
private static final int THREAD_POOL_SIZE = Math.max((int) (Runtime.getRuntime().availableProcessors() * (3.0/4.0)), 3);
private final ThreadPoolExecutor executor = createExecutor();
private final PolarSheetGenerationSettings backendPolarSheetGenerationSettings;
private final Map<TrackedRace, Set<GPSFixMovingWithOriginInfo>> fixesForRacesWhichAreStillLoading = new HashMap<>();
private final Queue<GPSFixMovingWithOriginInfo> fixQueue = new ConcurrentLinkedQueue<GPSFixMovingWithOriginInfo>();
@@ -69,6 +66,19 @@ public class PolarDataMiner {
private static final Logger logger = Logger.getLogger(PolarDataMiner.class.getSimpleName());
private final ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners = new ConcurrentHashMap<>();
private ParallelFilteringProcessor<GPSFixMovingWithOriginInfo> preFilteringProcessor;
private final PolarSheetGenerationSettings backendPolarSheetGenerationSettings;
/**
* This processor uses two cubic regressions angle to the true wind over windspeed and boatspeed over windspeed for each
* course (legtype tack combination)
*/
private final CubicRegressionPerCourseProcessor cubicRegressionPerCourseProcessor;
private final SpeedRegressionPerAngleClusterProcessor speedRegressionPerAngleClusterProcessor;
private final ClusterGroup<Bearing> angleClusterGroup;
private ThreadPoolExecutor createExecutor() {
return new ThreadPoolExecutor(THREAD_POOL_SIZE, THREAD_POOL_SIZE, 60, TimeUnit.SECONDS,
@@ -92,28 +102,16 @@ public class PolarDataMiner {
};
}
/**
* This processor keeps track of the moving average of the speed values and the average angle for each course (legtype tack combination)
*/
private MovingAverageProcessor movingAverageProcessor;
/**
* This processor uses two cubic regressions angle to the true wind over windspeed and boatspeed over windspeed for each
* course (legtype tack combination)
*/
private CubicRegressionPerCourseProcessor cubicRegressionPerCourseProcessor;
private SpeedRegressionPerAngleClusterProcessor speedRegressionPerAngleClusterProcessor;
private ParallelFilteringProcessor<GPSFixMovingWithOriginInfo> preFilteringProcessor;
public PolarDataMiner() {
this(PolarSheetGenerationSettingsImpl.createBackendPolarSettings());
}
public PolarDataMiner(PolarSheetGenerationSettings backendPolarSettings) {
public PolarDataMiner(PolarSheetGenerationSettings backendPolarSettings,
CubicRegressionPerCourseProcessor cubicRegressionPerCourseProcessor,
SpeedRegressionPerAngleClusterProcessor speedRegressionPerAngleClusterProcessor,
ClusterGroup<Bearing> angleClusterGroup) {
cubicRegressionPerCourseProcessor.setListeners(listeners);
speedRegressionPerAngleClusterProcessor.setListeners(listeners);
backendPolarSheetGenerationSettings = backendPolarSettings;
this.cubicRegressionPerCourseProcessor = cubicRegressionPerCourseProcessor;
this.speedRegressionPerAngleClusterProcessor = speedRegressionPerAngleClusterProcessor;
this.angleClusterGroup = angleClusterGroup;
try {
setUpWorkflow();
} catch (ClassCastException | NoSuchMethodException | SecurityException e) {
@@ -124,23 +122,6 @@ public class PolarDataMiner {
private void setUpWorkflow() throws ClassCastException, NoSuchMethodException,
SecurityException {
WindSpeedSteppingWithMaxDistance stepping = backendPolarSheetGenerationSettings.getWindSpeedStepping();
final ClusterGroup<Speed> speedClusterGroup = SpeedClusterGroupFromWindSteppingCreator
.createSpeedClusterGroupFrom(stepping);
movingAverageProcessor = new MovingAverageProcessorImpl(speedClusterGroup);
Collection<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>> movingAverageGrouperResultReceivers = new ArrayList<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>>();
movingAverageGrouperResultReceivers.add(movingAverageProcessor);
Collection<ParameterizedFunction<?>> parameterizedDimensions = new ArrayList<>();
for (Function<?> function : PolarDataDimensionCollectionFactory.getMovingAverageClusterKeyDimensions()) {
parameterizedDimensions.add(new SimpleParameterizedFunction<>(function, ParameterProvider.NULL));
}
Processor<GPSFixMovingWithPolarContext, GroupedDataEntry<GPSFixMovingWithPolarContext>> movingAverageGroupingProcessor = new ParallelMultiDimensionsValueNestingGroupingProcessor<GPSFixMovingWithPolarContext>(
GPSFixMovingWithPolarContext.class, executor, movingAverageGrouperResultReceivers, parameterizedDimensions);
cubicRegressionPerCourseProcessor = new CubicRegressionPerCourseProcessor(listeners);
Collection<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>> regressionPerCourseGrouperResultReceivers = new ArrayList<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>>();
regressionPerCourseGrouperResultReceivers.add(cubicRegressionPerCourseProcessor);
@@ -151,8 +132,6 @@ public class PolarDataMiner {
Processor<GPSFixMovingWithPolarContext, GroupedDataEntry<GPSFixMovingWithPolarContext>> cubicRegressionPerCourseGroupingProcessor = new ParallelMultiDimensionsValueNestingGroupingProcessor<GPSFixMovingWithPolarContext>(
GPSFixMovingWithPolarContext.class, executor, regressionPerCourseGrouperResultReceivers, parameterizedDimensionsForCubicRegression);
ClusterGroup<Bearing> angleClusterGroup = createAngleClusterGroup();
speedRegressionPerAngleClusterProcessor = new SpeedRegressionPerAngleClusterProcessor(angleClusterGroup, listeners);
Collection<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>> regressionPerAngleClusterGrouperResultReceivers = new ArrayList<Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, ?>>();
regressionPerAngleClusterGrouperResultReceivers.add(speedRegressionPerAngleClusterProcessor);
@@ -166,7 +145,6 @@ public class PolarDataMiner {
Collection<Processor<GPSFixMovingWithPolarContext, ?>> filteringResultReceivers = new ArrayList<>();
filteringResultReceivers.add(movingAverageGroupingProcessor);
filteringResultReceivers.add(cubicRegressionPerCourseGroupingProcessor);
filteringResultReceivers.add(regressionPerAngleClusterGroupingProcessor);
@@ -185,7 +163,7 @@ public class PolarDataMiner {
protected GPSFixMovingWithPolarContext enrich(GPSFixMovingWithOriginInfo element) {
GPSFixMovingWithPolarContext result = null;
result = new GPSFixMovingWithPolarContext(element.getFix(), element.getTrackedRace(),
element.getCompetitor(), speedClusterGroup, angleClusterGroup);
element.getCompetitor(), angleClusterGroup);
return result;
}
};
@@ -216,10 +194,6 @@ public class PolarDataMiner {
}
private ClusterGroup<Bearing> createAngleClusterGroup() {
return new BearingClusterGroup(0, 180, 5);
}
public void addFix(GPSFixMoving fix, Competitor competitor, TrackedRace trackedRace) {
GPSFixMovingWithOriginInfo fixWithOriginInfo = new GPSFixMovingWithOriginInfo(fix, trackedRace, competitor);
if (trackedRace.getStatus().getStatus() == TrackedRaceStatusEnum.LOADING) {
@@ -387,7 +361,7 @@ public class PolarDataMiner {
}
public Set<BoatClass> getAvailableBoatClasses() {
return movingAverageProcessor.getAvailableBoatClasses();
return speedRegressionPerAngleClusterProcessor.getAvailableBoatClasses();
}
public int[] getDataCountsForWindSpeed(BoatClass boatClass, Speed windSpeed, int startAngleInclusive, int endAngleExclusive) {
@@ -403,13 +377,9 @@ public class PolarDataMiner {
}
public SpeedWithBearingWithConfidence<Void> getAverageSpeedAndCourseOverGround(BoatClass boatClass,
Speed windSpeed, LegType legType, boolean useRegressionForSpeed) throws NotEnoughDataHasBeenAddedException {
Speed windSpeed, LegType legType) throws NotEnoughDataHasBeenAddedException {
SpeedWithBearingWithConfidence<Void> averageSpeedAndCourseOverGround = null;
if (useRegressionForSpeed) {
averageSpeedAndCourseOverGround = cubicRegressionPerCourseProcessor.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType);
} else {
averageSpeedAndCourseOverGround = movingAverageProcessor.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType);
}
averageSpeedAndCourseOverGround = cubicRegressionPerCourseProcessor.getAverageSpeedAndCourseOverGround(boatClass, windSpeed, legType);
return averageSpeedAndCourseOverGround;
}
@@ -458,4 +428,16 @@ public class PolarDataMiner {
listenersForBoatClass.remove(listener);
}
}
public CubicRegressionPerCourseProcessor getCubicRegressionPerCourseProcessor() {
return cubicRegressionPerCourseProcessor;
}
public SpeedRegressionPerAngleClusterProcessor getSpeedRegressionPerAngleClusterProcessor() {
return speedRegressionPerAngleClusterProcessor;
}
public PolarSheetGenerationSettings getPolarSheetGenerationSettings() {
return backendPolarSheetGenerationSettings;
}
}
@@ -1,6 +1,8 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
@@ -27,8 +29,11 @@ import com.sap.sse.datamining.factories.GroupKeyFactory;
import com.sap.sse.datamining.impl.components.GroupedDataEntry;
import com.sap.sse.datamining.shared.GroupKey;
public class SpeedRegressionPerAngleClusterProcessor implements Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void>{
public class SpeedRegressionPerAngleClusterProcessor implements
Processor<GroupedDataEntry<GPSFixMovingWithPolarContext>, Void>, Serializable {
private static final long serialVersionUID = 3279917556091599077L;
private static final Logger logger = Logger.getLogger(CubicRegressionPerCourseProcessor.class.getName());
private final Map<GroupKey, IncrementalLeastSquares> regressions = new HashMap<>();
@@ -37,11 +42,15 @@ public class SpeedRegressionPerAngleClusterProcessor implements Processor<Groupe
private final ClusterGroup<Bearing> angleClusterGroup;
private final ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners;
/**
* FIXME make sure listeners and replication interact correctly
*/
private transient ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners;
private final Set<BoatClass> availableBoatClasses = new HashSet<BoatClass>();
public SpeedRegressionPerAngleClusterProcessor(ClusterGroup<Bearing> angleClusterGroup, ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners) {
public SpeedRegressionPerAngleClusterProcessor(ClusterGroup<Bearing> angleClusterGroup) {
this.angleClusterGroup = angleClusterGroup;
this.listeners = listeners;
}
@Override
@@ -70,6 +79,7 @@ public class SpeedRegressionPerAngleClusterProcessor implements Processor<Groupe
}
GPSFixMovingWithPolarContext fix = element.getDataEntry();
regression.addData(fix.getWind().getObject().getKnots(), fix.getBoatSpeed().getObject().getKnots());
availableBoatClasses.add(boatClass);
Set<PolarsChangedListener> listenersForBoatClass = listeners.get(fix.getBoatClass());
if (listenersForBoatClass != null) {
for (PolarsChangedListener listener : listenersForBoatClass) {
@@ -155,6 +165,14 @@ public class SpeedRegressionPerAngleClusterProcessor implements Processor<Groupe
return polynomialFunction;
}
public void setListeners(ConcurrentHashMap<BoatClass, Set<PolarsChangedListener>> listeners) {
this.listeners = listeners;
}
Set<BoatClass> getAvailableBoatClasses() {
return availableBoatClasses;
}
@Override
public Class<GroupedDataEntry<GPSFixMovingWithPolarContext>> getInputType() {
// TODO Auto-generated method stub
@@ -195,4 +213,8 @@ public class SpeedRegressionPerAngleClusterProcessor implements Processor<Groupe
return null;
}
public ClusterGroup<Bearing> getAngleCluster() {
return angleClusterGroup;
}
}
@@ -1,10 +1,13 @@
package com.sap.sailing.polars.mining;
import java.io.Serializable;
import com.sap.sailing.domain.common.Speed;
import com.sap.sailing.domain.common.WindSpeedStepping;
public class WindSpeedLevel {
public class WindSpeedLevel implements Serializable {
private static final long serialVersionUID = -4498750034316806342L;
private final int level;
private final WindSpeedStepping stepping;
@@ -1,5 +1,7 @@
package com.sap.sailing.polars.regression;
import java.io.Serializable;
import org.apache.commons.math.analysis.polynomials.PolynomialFunction;
import com.sap.sailing.domain.polars.NotEnoughDataHasBeenAddedException;
@@ -10,7 +12,7 @@ import com.sap.sailing.domain.polars.NotEnoughDataHasBeenAddedException;
* @author Frederik Petersen (D054528)
*
*/
public interface IncrementalLeastSquares {
public interface IncrementalLeastSquares extends Serializable {
/**
* Adds data to the least squares regression. This only updates the internal matrix and vector and will not trigger the
@@ -1,5 +1,6 @@
package com.sap.sailing.polars.regression.impl;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
@@ -29,6 +30,8 @@ import com.sap.sse.concurrent.NamedReentrantReadWriteLock;
*/
public class IncrementalAnyOrderLeastSquaresImpl implements IncrementalLeastSquares {
private static final long serialVersionUID = -5282614133220702724L;
private class NaNCheckerVisitor implements RealMatrixPreservingVisitor {
private boolean hasNaNEntry = false;
@@ -64,10 +67,10 @@ public class IncrementalAnyOrderLeastSquaresImpl implements IncrementalLeastSqua
private AtomicBoolean functionNeedsUpdate = new AtomicBoolean(true);
private final NamedReentrantReadWriteLock lock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresLock",
private transient NamedReentrantReadWriteLock lock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresLock",
false);
private final NamedReentrantReadWriteLock cacheLock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresCacheLock",
private transient NamedReentrantReadWriteLock cacheLock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresCacheLock",
true);
private PolynomialFunction cachedFunction;
@@ -296,6 +299,15 @@ public class IncrementalAnyOrderLeastSquaresImpl implements IncrementalLeastSqua
}
}
private void readObject(java.io.ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
lock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresLock",
false);
cacheLock = new NamedReentrantReadWriteLock("IncrementalLeastSquaresCacheLock",
true);
}
@Override
public long getNumberOfAddedPoints() {
@@ -122,7 +122,7 @@ public class PolarResource extends AbstractSailingServerResource {
try {
PolarDataService service = getService().getPolarDataService();
SpeedWithBearingWithConfidence<Void> speedWithBearing = service.getAverageSpeedWithBearing(boatClass,
windSpeed, legType, tack, true);
windSpeed, legType, tack);
String resultString = "Speed: " + speedWithBearing.getObject().getKnots() + "kn; Angle: "
+ speedWithBearing.getObject().getBearing().getDegrees() + "°; Confidence: "
+ speedWithBearing.getConfidence();
@@ -7,6 +7,7 @@ import java.io.OutputStream;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -24,6 +25,8 @@ import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.StreamingOutput;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.configuration.DeviceConfiguration;
import com.sap.sailing.domain.base.configuration.DeviceConfigurationMatcher;
import com.sap.sailing.domain.leaderboard.Leaderboard;
import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
import com.sap.sailing.domain.masterdataimport.TopLevelMasterData;
@@ -37,7 +40,7 @@ public class MasterDataResource extends AbstractSailingServerResource {
@GET
@Produces("application/x-java-serialized-object")
public Response getMasterDataByLeaderboardGroups(@QueryParam("names[]") List<String> leaderboardGroupNames,
@QueryParam("compress") Boolean compress, @QueryParam("exportWind") Boolean exportWind)
@QueryParam("compress") Boolean compress, @QueryParam("exportWind") Boolean exportWind, @QueryParam("exportDeviceConfigs") Boolean exportDeviceConfigs)
throws UnsupportedEncodingException {
final long startTime = System.currentTimeMillis();
logger.info("Masterdataexport has started");
@@ -47,6 +50,9 @@ public class MasterDataResource extends AbstractSailingServerResource {
if (exportWind == null) {
exportWind = true;
}
if (exportDeviceConfigs == null) {
exportDeviceConfigs = false;
}
logger.info(String.format("Masterdataexport gzip compression is turned %s", compress ? "on" : "off"));
Map<String, LeaderboardGroup> allLeaderboardGroups = getService().getLeaderboardGroups();
@@ -73,9 +79,15 @@ public class MasterDataResource extends AbstractSailingServerResource {
}
}
}
Map<DeviceConfigurationMatcher, DeviceConfiguration> deviceConfigurations;
if (exportDeviceConfigs) {
deviceConfigurations = getAllDeviceConfigs();
} else {
deviceConfigurations = new HashMap<>();
}
final TopLevelMasterData masterData = new TopLevelMasterData(groupsToExport,
getService().getAllEvents(), getService().getPersistentRegattasForRaceIDs(), getService()
.getAllMediaTracks(), getService().getGPSFixStore(), exportWind);
.getAllMediaTracks(), getService().getGPSFixStore(), exportWind, deviceConfigurations);
final StreamingOutput streamingOutput;
if (compress) {
streamingOutput= new CompressingStreamingOutput(masterData, competitorIds, startTime);
@@ -92,6 +104,11 @@ public class MasterDataResource extends AbstractSailingServerResource {
return builtResponse;
}
private Map<DeviceConfigurationMatcher, DeviceConfiguration> getAllDeviceConfigs() {
Map<DeviceConfigurationMatcher, DeviceConfiguration> configs = getService().getAllDeviceConfigurations();
return configs;
}
private abstract class AbstractStreamingOutput implements StreamingOutput {
private final TopLevelMasterData masterData;
private final List<Serializable> competitorIds;
@@ -1,7 +1,10 @@
package com.sap.sailing.server.replication.test;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.CompetitorStore;
import com.sap.sailing.domain.base.DomainFactory;
import com.sap.sailing.domain.base.impl.DomainFactoryImpl;
import com.sap.sailing.domain.persistence.DomainObjectFactory;
import com.sap.sailing.domain.persistence.MongoObjectFactory;
import com.sap.sailing.domain.persistence.PersistenceFactory;
import com.sap.sailing.domain.persistence.media.MediaDBFactory;
@@ -9,6 +12,7 @@ import com.sap.sailing.domain.racelog.tracking.EmptyGPSFixStore;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sailing.server.RacingEventService;
import com.sap.sailing.server.impl.RacingEventServiceImpl;
import com.sap.sailing.server.impl.RacingEventServiceImpl.ConstructorParameters;
import com.sap.sse.mongodb.MongoDBService;
public abstract class AbstractServerReplicationTest extends com.sap.sse.replication.testsupport.AbstractServerWithSingleServiceReplicationTest<RacingEventService, RacingEventServiceImpl> {
@@ -42,17 +46,35 @@ public abstract class AbstractServerReplicationTest extends com.sap.sse.replicat
@Override
public RacingEventServiceImpl createNewMaster() {
return new RacingEventServiceImpl(PersistenceFactory.INSTANCE.getDomainObjectFactory(mongoDBService,
DomainFactory.INSTANCE), mongoObjectFactory, MediaDBFactory.INSTANCE.getMediaDB(mongoDBService),
EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE);
return new RacingEventServiceImpl((final RaceLogResolver raceLogResolver)-> {
return new ConstructorParameters() {
private final DomainFactory baseDomainFactory = new DomainFactoryImpl(raceLogResolver);
@Override public DomainObjectFactory getDomainObjectFactory() { return PersistenceFactory.INSTANCE.getDomainObjectFactory(mongoDBService, baseDomainFactory); }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return baseDomainFactory; }
@Override public CompetitorStore getCompetitorStore() { return getBaseDomainFactory().getCompetitorStore(); }
};
}, MediaDBFactory.INSTANCE.getMediaDB(mongoDBService), EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE, null);
}
@Override
public RacingEventServiceImpl createNewReplica() {
return new RacingEventServiceImpl(PersistenceFactory.INSTANCE.getDomainObjectFactory(mongoDBService,
// replica gets its own base DomainFactory:
new DomainFactoryImpl()), mongoObjectFactory, MediaDBFactory.INSTANCE.getMediaDB(mongoDBService),
EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE);
return new RacingEventServiceImpl(
(final RaceLogResolver raceLogResolver) -> {
return new RacingEventServiceImpl.ConstructorParameters() {
private final DomainObjectFactory domainObjectFactory =
PersistenceFactory.INSTANCE.getDomainObjectFactory(mongoDBService,
// replica gets its own base DomainFactory:
new DomainFactoryImpl(raceLogResolver));
@Override public DomainObjectFactory getDomainObjectFactory() { return domainObjectFactory; }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return domainObjectFactory.getBaseDomainFactory(); }
@Override public CompetitorStore getCompetitorStore() { return getBaseDomainFactory().getCompetitorStore(); }
};
}, MediaDBFactory.INSTANCE.getMediaDB(mongoDBService), EmptyWindStore.INSTANCE, EmptyGPSFixStore.INSTANCE,
/* serviceFinderFactory */ null);
}
}
}
@@ -77,7 +77,7 @@ public class DelayedLeaderboardCorrectionsReplicationTest extends AbstractServer
// then start initial load, wait until finished; then link a tracked race to leaderboard's RaceColumn on master and
// verify that on the replica it is associated to the RaceColumn as well, and the DelayedLeaderboardCorrections are
// resolved properly on the replica.
final DomainFactory domainFactory = new DomainFactoryImpl();
final DomainFactory domainFactory = new DomainFactoryImpl((srlid)->null);
BoatClass boatClass = domainFactory.getOrCreateBoatClass("29erXX", /* typicallyStartsUpwind */ true);
DynamicCompetitor hasso = AbstractLeaderboardTest.createCompetitor("Dr. Hasso Plattner"); // don't create competitor using CompetitorStore
final DynamicTrackedRace q2YellowTrackedRace = new MockedTrackedRaceWithFixedRank(hasso, /* rank */ 1, /* started */ false, boatClass) {
@@ -105,7 +105,7 @@ public class DelayedLeaderboardCorrectionsReplicationTest extends AbstractServer
// re-load new master from persistence
master = createRacingEventServiceWithOneMockedTrackedRace(q2YellowTrackedRace, domainFactory);
DomainFactoryImpl replicaDomainFactory = new DomainFactoryImpl();
DomainFactoryImpl replicaDomainFactory = new DomainFactoryImpl((srlid)->null);
replica = createRacingEventServiceWithOneMockedTrackedRace(q2YellowTrackedRace, replicaDomainFactory);
final Leaderboard masterLeaderboardReloaded = master.getLeaderboardByName(leaderboardName);
assertNotNull(masterLeaderboardReloaded);
@@ -78,8 +78,7 @@ public class ServerReplicationTest extends AbstractServerReplicationTest {
@Test
public void testWaypointRemovalReplication() throws InterruptedException {
final String boatClassName = "49er";
// FIXME use master DomainFactory; see bug 592
final DomainFactory masterDomainFactory = DomainFactory.INSTANCE;
final DomainFactory masterDomainFactory = testSetUp.getMaster().getBaseDomainFactory();
BoatClass boatClass = masterDomainFactory.getOrCreateBoatClass(boatClassName);
final String baseEventName = "Test Event";
AddDefaultRegatta addRegattaOperation = new AddDefaultRegatta(RegattaImpl.getDefaultName(baseEventName, boatClassName), boatClassName,
@@ -61,6 +61,7 @@ public class SimpleRabbitMQTest {
new Thread(consumer2).start();
String message = "Hello World!";
channel.basicPublish(EXCHANGE_NAME, /* queue name */ "", null, message.getBytes());
Thread.sleep(1000);
consumer1.waitUntilReceived(1000);
consumer2.waitUntilReceived(1000);
assertEquals(message, received.get(consumer1));
@@ -76,13 +76,13 @@ public class TrackedRaceContentsReplicationTest extends AbstractServerReplicatio
super.setUp();
final String boatClassName = "49er";
// FIXME use master DomainFactory; see bug 592
final DomainFactory masterDomainFactory = DomainFactory.INSTANCE;
final DomainFactory masterDomainFactory = testSetUp.getMaster().getBaseDomainFactory();
BoatClass boatClass = masterDomainFactory.getOrCreateBoatClass(boatClassName, /* typicallyStartsUpwind */true);
competitor = masterDomainFactory.getCompetitorStore().getOrCreateCompetitor("GER 61", "Tina Lutz", Color.RED, "someone@nowhere.de", null, new TeamImpl("Tina Lutz + Susann Beucke",
(List<PersonImpl>) Arrays.asList(new PersonImpl[] { new PersonImpl("Tina Lutz", DomainFactory.INSTANCE.getOrCreateNationality("GER"), null, null),
new PersonImpl("Tina Lutz", DomainFactory.INSTANCE.getOrCreateNationality("GER"), null, null) }),
new PersonImpl("Rigo de Mas", DomainFactory.INSTANCE.getOrCreateNationality("NED"), null, null)),
new BoatImpl("GER 61", DomainFactory.INSTANCE.getOrCreateBoatClass("470", /* typicallyStartsUpwind */ true), "GER 61"),
(List<PersonImpl>) Arrays.asList(new PersonImpl[] { new PersonImpl("Tina Lutz", masterDomainFactory.getOrCreateNationality("GER"), null, null),
new PersonImpl("Tina Lutz", masterDomainFactory.getOrCreateNationality("GER"), null, null) }),
new PersonImpl("Rigo de Mas", masterDomainFactory.getOrCreateNationality("NED"), null, null)),
new BoatImpl("GER 61", masterDomainFactory.getOrCreateBoatClass("470", /* typicallyStartsUpwind */ true), "GER 61"),
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowanceInSecondsPerNauticalMile */ null);
final String baseEventName = "Test Event";
AddDefaultRegatta addEventOperation = new AddDefaultRegatta(RegattaImpl.getDefaultName(baseEventName, boatClassName), boatClassName,
@@ -75,8 +75,7 @@ public class TrackedRaceWithGPSFixStoreContentsReplicationTest extends AbstractS
/* dropDB */true, /* master=null means create a new one */null,
/* replica=null means create a new one */null);
final String boatClassName = "49er";
// FIXME use master DomainFactory; see bug 592
final DomainFactory masterDomainFactory = DomainFactory.INSTANCE;
final DomainFactory masterDomainFactory = testSetUp.getMaster().getBaseDomainFactory();
BoatClass boatClass = masterDomainFactory.getOrCreateBoatClass(boatClassName, /* typicallyStartsUpwind */true);
competitor = masterDomainFactory.getCompetitorStore().getOrCreateCompetitor("GER 61", "Tina Lutz", Color.RED, "someone@nowhere.de", null, new TeamImpl("Tina Lutz + Susann Beucke",
(List<PersonImpl>) Arrays.asList(new PersonImpl[] { new PersonImpl("Tina Lutz", DomainFactory.INSTANCE.getOrCreateNationality("GER"), null, null),
@@ -145,5 +144,9 @@ public class TrackedRaceWithGPSFixStoreContentsReplicationTest extends AbstractS
}
}
@Test
public void testTrackedRaceHasValidRaceLogResolverAfterDeserialization() {
TrackedRace replicaTrackedRace = replica.getTrackedRace(raceIdentifier);
assertNotNull(replicaTrackedRace.getRaceLogResolver());
}
}
@@ -7,6 +7,7 @@ import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -164,7 +165,7 @@ public class MediaMasterDataExportTest {
Map<String, Regatta> regattaForRaceIdString = Collections.emptyMap();
GPSFixStore gpsFixStore = mock(GPSFixStore.class);
boolean exportWind = false;
TopLevelMasterData topLevelMasterData = new TopLevelMasterData(groupsToExport , allEvents , regattaForRaceIdString, allMediaTracks , gpsFixStore , exportWind);
TopLevelMasterData topLevelMasterData = new TopLevelMasterData(groupsToExport , allEvents , regattaForRaceIdString, allMediaTracks , gpsFixStore , exportWind, new HashMap<>());
return topLevelMasterData;
}
@@ -52,14 +52,14 @@ public class CompetitorStoreTest {
@Test
public void testPersistentCompetitorStore() {
CompetitorStore persistentStore1 = new PersistentCompetitorStore(
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(), /* clearStore */true, null);
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(), /* clearStore */true, null, /* raceLogResolver */ (srlid)->null);
DynamicCompetitor template = AbstractLeaderboardTest.createCompetitor("Test Competitor");
Competitor competitor = persistentStore1.getOrCreateCompetitor(template.getId(), template.getName(),
template.getColor(), template.getEmail(), template.getFlagImage(), template.getTeam(),
template.getBoat(), /* timeOnTimeFactor */ 1.234, /* timeOnDistanceAllowanceInSecondsPerNauticalMile */ Duration.ONE_SECOND.times(730));
CompetitorStore persistentStore2 = new PersistentCompetitorStore(
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(), /* clearStore */false, null);
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(), /* clearStore */false, null, /* raceLogResolver */ (srlid)->null);
Competitor competitor2 = persistentStore2.getExistingCompetitorById(template.getId());
assertNotSame(competitor2, template); // the new store loads new instances from the database
assertEquals(template.getId(), competitor2.getId());
@@ -307,7 +307,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -514,7 +514,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -657,7 +657,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -741,7 +741,7 @@ public class MasterDataImportTest {
public void testMasterDataImportForRaceLogEventsReferencingCompetitors() throws MalformedURLException, IOException,
InterruptedException, ClassNotFoundException {
// Setup source service
DomainFactory sourceDomainFactory = new DomainFactoryImpl();
DomainFactory sourceDomainFactory = new DomainFactoryImpl((srlid)->null);
RacingEventService sourceService = new RacingEventServiceImpl(
PersistenceFactory.INSTANCE.getDomainObjectFactory(MongoDBService.INSTANCE, sourceDomainFactory),
PersistenceFactory.INSTANCE.getMongoObjectFactory(MongoDBService.INSTANCE),
@@ -835,7 +835,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -997,7 +997,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1196,7 +1196,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1356,7 +1356,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1487,7 +1487,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1623,7 +1623,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1720,7 +1720,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1843,7 +1843,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -1914,7 +1914,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -2103,7 +2103,7 @@ public class MasterDataImportTest {
DomainFactory domainFactory;
MasterDataResource resource = new MasterDataResource();
MasterDataResource spyResource = spyResource(resource, sourceService);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true);
Response response = spyResource.getMasterDataByLeaderboardGroups(groupNamesToExport, false, true, false);
StreamingOutput streamingOutput = (StreamingOutput) response.getEntity();
ByteArrayOutputStream os = new ByteArrayOutputStream();
UUID randomUUID = UUID.randomUUID();
@@ -30,9 +30,9 @@
<stringAttribute key="profilingTraceType-PERFORMANCE_HOTSPOT_TRACE" value="KEY_IGNORE_SLEEPING_THREADS%CTX_KEY%false%CTX_ENTRY%KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%true%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_TENANT_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
<stringAttribute key="profilingTraceType-SYNCHRONIZATION_TRACE" value="KEY_APPLICATION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_SESSION_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_ENABLEMENT%CTX_KEY%false%CTX_ENTRY%KEY_USER_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_REQUEST_FILTER%CTX_KEY%*%CTX_ENTRY%KEY_TENANT_FILTER%CTX_KEY%*%CTX_ENTRY%"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="target_bundles" value="com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.rabbitmq.client@default:default,com.sun.jersey.contribs.jersey-multipart@default:default,com.sun.jersey@default:default,com.sun.mail.javax.mail@default:default,jackson-core-lgpl@default:default,jackson-jaxrs@default:default,jackson-mapper-lgpl@default:default,javax.servlet@default:default,javax.validation@default:default,javax.ws.rs@default:default,jcl.over.slf4j@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.fileupload@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.geronimo.specs.geronimo-annotation_1.0_spec@default:default,org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec@default:default,org.apache.geronimo.specs.geronimo-jms_1.1_spec@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.servicemix.bundles.aws-java-sdk@default:default,org.apache.servicemix.bundles.ehcache@default:default,org.apache.servicemix.bundles.scribe@default:default,org.apache.servicemix.bundles.zxing@default:default,org.apache.shiro.core@default:default,org.apache.shiro.ehcache@default:default,org.apache.shiro.web@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.jmx@default:default,org.eclipse.jetty.osgi.boot@3:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.jdom@default:default,org.jvnet.mimepull@default:default,org.mongodb.mongo-java-driver@default:default,org.objectweb.asm@default:default,rome@default:default,routeconverter@default:default,slf4j.api@default:default,slf4j.jdk14@default:false"/>
<stringAttribute key="target_bundles" value="com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.rabbitmq.client@default:default,com.sun.jersey.contribs.jersey-multipart@default:default,com.sun.jersey@default:default,com.sun.mail.javax.mail@default:default,jackson-core-lgpl@default:default,jackson-jaxrs@default:default,jackson-mapper-lgpl@default:default,javax.servlet@default:default,javax.validation@default:default,javax.ws.rs@default:default,jcl.over.slf4j@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.codec@default:default,org.apache.commons.collections@default:default,org.apache.commons.fileupload@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.commons.math@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.geronimo.specs.geronimo-annotation_1.0_spec@default:default,org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec@default:default,org.apache.geronimo.specs.geronimo-jms_1.1_spec@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.servicemix.bundles.aws-java-sdk@default:default,org.apache.servicemix.bundles.ehcache@default:default,org.apache.servicemix.bundles.scribe@default:default,org.apache.servicemix.bundles.zxing@default:default,org.apache.shiro.core@default:default,org.apache.shiro.ehcache@default:default,org.apache.shiro.web@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.jetty.continuation@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.jmx@default:default,org.eclipse.jetty.osgi.boot@3:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hyperic.sigar@default:default,org.jdom@default:default,org.jvnet.mimepull@default:default,org.mongodb.mongo-java-driver@default:default,org.objectweb.asm@default:default,rome@default:default,routeconverter@default:default,slf4j.api@default:default,slf4j.jdk14@default:false"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useCustomFeatures" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<stringAttribute key="workspace_bundles" value="com.google.gwt.osgi@default:default,com.googlecode.java-diff-utils@default:default,com.googlecode.mgwt@default:default,com.sap.sailing.barbados.resultimport@default:default,com.sap.sailing.dashboards.gwt@5:true,com.sap.sailing.datamining.shared@default:default,com.sap.sailing.datamining@default:default,com.sap.sailing.declination@default:default,com.sap.sailing.domain.common@default:default,com.sap.sailing.domain.deckmanadapter@4:true,com.sap.sailing.domain.igtimiadapter.persistence@default:default,com.sap.sailing.domain.igtimiadapter@default:default,com.sap.sailing.domain.persistence@default:default,com.sap.sailing.domain.racelogtrackingadapter@3:default,com.sap.sailing.domain.shared.android@default:default,com.sap.sailing.domain.swisstimingadapter.persistence@default:default,com.sap.sailing.domain.swisstimingadapter@4:true,com.sap.sailing.domain.swisstimingreplayadapter@4:true,com.sap.sailing.domain.tractracadapter.persistence@default:default,com.sap.sailing.domain.tractracadapter@4:true,com.sap.sailing.domain@default:default,com.sap.sailing.ess40.resultimport@default:default,com.sap.sailing.expeditionconnector@default:default,com.sap.sailing.freg.resultimport@default:default,com.sap.sailing.geocoding@default:default,com.sap.sailing.gwt.ui@5:true,com.sap.sailing.kiworesultimport@default:default,com.sap.sailing.manage2sail.resultimport@default:default,com.sap.sailing.manage2sail@default:default,com.sap.sailing.news@default:default,com.sap.sailing.nmeaconnector@default:default,com.sap.sailing.polars@4:true,com.sap.sailing.resultimport@default:default,com.sap.sailing.sailwave.resultimport@default:default,com.sap.sailing.server.gateway.ess40@4:true,com.sap.sailing.server.gateway.serialization.shared.android@default:default,com.sap.sailing.server.gateway.serialization@default:default,com.sap.sailing.server.gateway@5:true,com.sap.sailing.server.trackfiles@default:default,com.sap.sailing.server@default:default,com.sap.sailing.simulator@default:default,com.sap.sailing.udpconnector@default:default,com.sap.sailing.velum.resultimport@default:default,com.sap.sailing.www.events@4:true,com.sap.sailing.www@4:true,com.sap.sailing.xrr.resultimport@default:default,com.sap.sailing.xrr.schema@default:default,com.sap.sailing.xrr.structureimport@default:default,com.sap.sse.common@default:default,com.sap.sse.datamining.shared@default:default,com.sap.sse.datamining@default:default,com.sap.sse.filestorage@default:default,com.sap.sse.gwt.adminconsole@default:default,com.sap.sse.gwt.theme@5:true,com.sap.sse.gwt@default:default,com.sap.sse.mail@4:true,com.sap.sse.mongodb@default:default,com.sap.sse.operationaltransformation@default:default,com.sap.sse.replication@4:true,com.sap.sse.security.common@default:default,com.sap.sse.security.ui@6:true,com.sap.sse.security.userstore.mongodb@4:true,com.sap.sse.security@5:true,com.sap.sse.shared.android@default:default,com.sap.sse@default:default,com.tractrac.clientmodule@default:default,net.sf.marineapi@default:default,org.json.simple@default:default,org.moxieapps.gwt.highcharts@default:default"/>
<stringAttribute key="workspace_bundles" value="com.google.gwt.osgi@default:default,com.googlecode.java-diff-utils@default:default,com.googlecode.mgwt@default:default,com.sap.sailing.barbados.resultimport@default:default,com.sap.sailing.dashboards.gwt@5:true,com.sap.sailing.datamining.shared@default:default,com.sap.sailing.datamining@default:default,com.sap.sailing.declination@default:default,com.sap.sailing.domain.common@default:default,com.sap.sailing.domain.deckmanadapter@4:true,com.sap.sailing.domain.igtimiadapter.persistence@default:default,com.sap.sailing.domain.igtimiadapter@default:default,com.sap.sailing.domain.persistence@default:default,com.sap.sailing.domain.racelogtrackingadapter@3:default,com.sap.sailing.domain.shared.android@default:default,com.sap.sailing.domain.swisstimingadapter.persistence@default:default,com.sap.sailing.domain.swisstimingadapter@4:true,com.sap.sailing.domain.swisstimingreplayadapter@4:true,com.sap.sailing.domain.tractracadapter.persistence@default:default,com.sap.sailing.domain.tractracadapter@4:true,com.sap.sailing.domain@default:default,com.sap.sailing.ess40.resultimport@default:default,com.sap.sailing.expeditionconnector@default:default,com.sap.sailing.freg.resultimport@default:default,com.sap.sailing.geocoding@default:default,com.sap.sailing.gwt.ui@5:true,com.sap.sailing.kiworesultimport@default:default,com.sap.sailing.manage2sail.resultimport@default:default,com.sap.sailing.manage2sail@default:default,com.sap.sailing.monitoring@default:default,com.sap.sailing.news@default:default,com.sap.sailing.nmeaconnector@default:default,com.sap.sailing.polars@4:true,com.sap.sailing.resultimport@default:default,com.sap.sailing.sailwave.resultimport@default:default,com.sap.sailing.server.gateway.ess40@4:true,com.sap.sailing.server.gateway.serialization.shared.android@default:default,com.sap.sailing.server.gateway.serialization@default:default,com.sap.sailing.server.gateway@5:true,com.sap.sailing.server.trackfiles@default:default,com.sap.sailing.server@default:default,com.sap.sailing.simulator@default:default,com.sap.sailing.udpconnector@default:default,com.sap.sailing.velum.resultimport@default:default,com.sap.sailing.www.events@4:true,com.sap.sailing.www@4:true,com.sap.sailing.xrr.resultimport@default:default,com.sap.sailing.xrr.schema@default:default,com.sap.sailing.xrr.structureimport@default:default,com.sap.sse.common@default:default,com.sap.sse.datamining.shared@default:default,com.sap.sse.datamining@default:default,com.sap.sse.filestorage@default:default,com.sap.sse.gwt.adminconsole@default:default,com.sap.sse.gwt.theme@5:true,com.sap.sse.gwt@default:default,com.sap.sse.mail@4:true,com.sap.sse.mongodb@default:default,com.sap.sse.operationaltransformation@default:default,com.sap.sse.replication@4:true,com.sap.sse.security.common@default:default,com.sap.sse.security.ui@6:true,com.sap.sse.security.userstore.mongodb@4:true,com.sap.sse.security@5:true,com.sap.sse.shared.android@default:default,com.sap.sse@default:default,com.tractrac.clientmodule@default:default,net.sf.marineapi@default:default,org.json.simple@default:default,org.moxieapps.gwt.highcharts@default:default"/>
</launchConfiguration>
@@ -19,7 +19,7 @@
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console -clean"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djetty.port=8889 -Dreplication.exchangeName=sapsailinganalytics-replica -Declipse.ignoreApp=true -Dosgi.noShutdown=true&#13;&#10;-Dexpedition.udp.port=2011 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -XX:+UseMembar -Dmongo.dbName=replica -Dreplicate.on.start=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl -Dreplicate.master.queue.host=127.0.0.1 -Dreplicate.master.queue.port=5672 -Dreplicate.master.servlet.port=8888 -Dreplicate.master.servlet.host=127.0.0.1 -Dreplicate.master.exchange.name=sapsailinganalytics"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djetty.port=8889 -Dreplication.exchangeName=sapsailinganalytics-replica -Declipse.ignoreApp=true -Dosgi.noShutdown=true&#13;&#10;-Dexpedition.udp.port=2011 -Xmx6000m -XX:+UseG1GC -Djetty.home=${project_loc:com.sap.sailing.server}/../target/configuration/jetty -Djava.util.logging.config.file=${project_loc:com.sap.sailing.server}/../target/configuration/logging_debug.properties -XX:+UseMembar -Dmongo.dbName=replica -Dreplicate.on.start=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl,com.sap.sailing.polars.impl.PolarDataServiceImpl -Dreplicate.master.queue.host=127.0.0.1 -Dreplicate.master.queue.port=5672 -Dreplicate.master.servlet.port=8888 -Dreplicate.master.servlet.host=127.0.0.1 -Dreplicate.master.exchange.name=sapsailinganalytics"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
@@ -42,7 +42,7 @@ public class ExtenderBundleTracker extends BundleTracker<Bundle> {
for (StackTraceElement traceElement : stackTrace) {
b.append(traceElement.toString() + "\n");
}
logger.fine(b.toString());
logger.severe(b.toString());
}
String trackManifestEntry = (String) bundle.getHeaders().get("TrackLifecycle");
if (trackManifestEntry != null) {
@@ -5,6 +5,7 @@ import java.io.ObjectInputStream;
import java.io.Serializable;
import java.net.URI;
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
import com.sap.sailing.domain.base.Competitor;
import com.sap.sailing.domain.base.CompetitorStore;
import com.sap.sailing.domain.base.DomainFactory;
@@ -40,8 +41,9 @@ public class PersistentCompetitorStore extends TransientCompetitorStoreImpl impl
* if <code>true</code>, the persistent competitor store is initially cleared, with all persistent
* competitor data removed; use with caution!
*/
public PersistentCompetitorStore(MongoObjectFactory storeTo, boolean clear, TypeBasedServiceFinderFactory serviceFinderFactory) {
DomainFactoryImpl baseDomainFactory = new DomainFactoryImpl(this);
public PersistentCompetitorStore(MongoObjectFactory storeTo, boolean clear,
TypeBasedServiceFinderFactory serviceFinderFactory, RaceLogResolver raceLogResolver) {
DomainFactoryImpl baseDomainFactory = new DomainFactoryImpl(this, raceLogResolver);
this.loadFrom = PersistenceFactory.INSTANCE.getDomainObjectFactory(MongoDBService.INSTANCE, baseDomainFactory, serviceFinderFactory);
this.storeTo = storeTo;
if (clear) {
@@ -34,6 +34,7 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -52,6 +53,7 @@ import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
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.state.RaceState;
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateImpl;
@@ -396,6 +398,23 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
private final JoinedClassLoader joinedClassLoader;
/**
* Providing the constructor parameters for a new {@link RacingEventServiceImpl} instance is a bit tricky
* in some cases because containment and initialization order of some types is fairly tightly coupled.
* There is a dependency of many such objects on an instance of {@link RaceLogResolver} which is implemented
* by {@link RacingEventServiceImpl}. However, therefore, this instance only becomes available in the
* innermost constructor.
*
* @author Axel Uhl (d043530)
*
*/
public static interface ConstructorParameters {
DomainObjectFactory getDomainObjectFactory();
MongoObjectFactory getMongoObjectFactory();
com.sap.sailing.domain.base.DomainFactory getBaseDomainFactory();
CompetitorStore getCompetitorStore();
}
/**
* Constructs a {@link DomainFactory base domain factory} that uses this object's {@link #competitorStore competitor
* store} for competitor management. This base domain factory is then also used for the construction of the
@@ -421,29 +440,41 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
* be cleared before the service starts.
*
* @param clearPersistentCompetitorStore
* if <code>true</code>, the {@link PersistentCompetitorStore} is created empty, with the correcponding
* if <code>true</code>, the {@link PersistentCompetitorStore} is created empty, with the corresponding
* database collection cleared as well. Use with caution! When used with <code>false</code>, competitors
* created and stored during previous service executions will initially be loaded.
*/
public RacingEventServiceImpl(boolean clearPersistentCompetitorStore,
TypeBasedServiceFinderFactory serviceFinderFactory) {
this(new PersistentCompetitorStore(
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(serviceFinderFactory),
clearPersistentCompetitorStore, serviceFinderFactory), null, null, serviceFinderFactory);
public RacingEventServiceImpl(boolean clearPersistentCompetitorStore, final TypeBasedServiceFinderFactory serviceFinderFactory) {
this((final RaceLogResolver raceLogResolver)-> {
return new ConstructorParameters() {
private final MongoObjectFactory mongoObjectFactory = PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(serviceFinderFactory);
private final PersistentCompetitorStore competitorStore = new PersistentCompetitorStore(
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(serviceFinderFactory),
clearPersistentCompetitorStore, serviceFinderFactory, raceLogResolver);
@Override public DomainObjectFactory getDomainObjectFactory() { return competitorStore.getDomainObjectFactory(); }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return competitorStore.getBaseDomainFactory(); }
@Override public CompetitorStore getCompetitorStore() { return competitorStore; }
};
}, MediaDBFactory.INSTANCE.getDefaultMediaDB(), null, null, serviceFinderFactory);
}
private RacingEventServiceImpl(boolean clearPersistentCompetitorStore, WindStore windStore,
GPSFixStore gpsFixStore, TypeBasedServiceFinderFactory serviceFinderFactory) {
this(new PersistentCompetitorStore(
PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(serviceFinderFactory),
clearPersistentCompetitorStore, serviceFinderFactory), windStore, gpsFixStore, serviceFinderFactory);
}
private RacingEventServiceImpl(final boolean clearPersistentCompetitorStore, WindStore windStore,
GPSFixStore gpsFixStore, final TypeBasedServiceFinderFactory serviceFinderFactory) {
this((final RaceLogResolver raceLogResolver)-> {
return new ConstructorParameters() {
private final MongoObjectFactory mongoObjectFactory = PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory(serviceFinderFactory);
private final PersistentCompetitorStore competitorStore = new PersistentCompetitorStore(
mongoObjectFactory,
clearPersistentCompetitorStore, serviceFinderFactory, raceLogResolver);
private RacingEventServiceImpl(PersistentCompetitorStore persistentCompetitorStore, WindStore windStore,
GPSFixStore gpsFixStore, TypeBasedServiceFinderFactory serviceFinderFactory) {
this(persistentCompetitorStore.getDomainObjectFactory(), persistentCompetitorStore.getMongoObjectFactory(),
persistentCompetitorStore.getBaseDomainFactory(), MediaDBFactory.INSTANCE.getDefaultMediaDB(),
persistentCompetitorStore, windStore, gpsFixStore, serviceFinderFactory);
@Override public DomainObjectFactory getDomainObjectFactory() { return competitorStore.getDomainObjectFactory(); }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return competitorStore.getBaseDomainFactory(); }
@Override public CompetitorStore getCompetitorStore() { return competitorStore; }
};
}, MediaDBFactory.INSTANCE.getDefaultMediaDB(), windStore, gpsFixStore, serviceFinderFactory);
}
/**
@@ -452,10 +483,30 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
* be used for testing because it provides a transient {@link CompetitorStore} as required for competitor
* persistence.
*/
public RacingEventServiceImpl(DomainObjectFactory domainObjectFactory, MongoObjectFactory mongoObjectFactory,
public RacingEventServiceImpl(Function<RaceLogResolver, DomainObjectFactory> domainObjectFactoryProvider,
final MongoObjectFactory mongoObjectFactory, MediaDB mediaDB, WindStore windStore, GPSFixStore gpsFixStore) {
this((final RaceLogResolver raceLogResolver)-> {
return new ConstructorParameters() {
private final DomainObjectFactory domainObjectFactory = domainObjectFactoryProvider.apply(raceLogResolver);
@Override public DomainObjectFactory getDomainObjectFactory() { return domainObjectFactory; }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return domainObjectFactory.getBaseDomainFactory(); }
@Override public CompetitorStore getCompetitorStore() { return getBaseDomainFactory().getCompetitorStore(); }
};
}, mediaDB, windStore, gpsFixStore, null);
}
public RacingEventServiceImpl(final DomainObjectFactory domainObjectFactory, MongoObjectFactory mongoObjectFactory,
MediaDB mediaDB, WindStore windStore, GPSFixStore gpsFixStore) {
this(domainObjectFactory, mongoObjectFactory, domainObjectFactory.getBaseDomainFactory(), mediaDB,
domainObjectFactory.getBaseDomainFactory().getCompetitorStore(), windStore, gpsFixStore, null);
this((final RaceLogResolver raceLogResolver)-> {
return new ConstructorParameters() {
@Override public DomainObjectFactory getDomainObjectFactory() { return domainObjectFactory; }
@Override public MongoObjectFactory getMongoObjectFactory() { return mongoObjectFactory; }
@Override public DomainFactory getBaseDomainFactory() { return domainObjectFactory.getBaseDomainFactory(); }
@Override public CompetitorStore getCompetitorStore() { return getBaseDomainFactory().getCompetitorStore(); }
};
}, mediaDB, windStore, gpsFixStore, null);
}
/**
@@ -467,14 +518,18 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
* of {@link DeviceIdentifier}s of specific device types or the managing of the device-to-competitor
* associations per race tracked.
*/
private RacingEventServiceImpl(DomainObjectFactory domainObjectFactory, MongoObjectFactory mongoObjectFactory,
com.sap.sailing.domain.base.DomainFactory baseDomainFactory, MediaDB mediaDb,
CompetitorStore competitorStore, WindStore windStore, GPSFixStore gpsFixStore,
TypeBasedServiceFinderFactory serviceFinderFactory) {
public RacingEventServiceImpl(Function<RaceLogResolver, ConstructorParameters> constructorParametersProvider, MediaDB mediaDb,
WindStore windStore, GPSFixStore gpsFixStore, TypeBasedServiceFinderFactory serviceFinderFactory) {
logger.info("Created " + this);
final ConstructorParameters constructorParameters = constructorParametersProvider.apply(this);
this.domainObjectFactory = constructorParameters.getDomainObjectFactory();
this.masterDataClassLoaders.add(this.getClass().getClassLoader());
joinedClassLoader = new JoinedClassLoader(masterDataClassLoaders);
this.operationsSentToMasterForReplication = new HashSet<>();
this.baseDomainFactory = constructorParameters.getBaseDomainFactory();
this.mongoObjectFactory = constructorParameters.getMongoObjectFactory();
this.mediaDB = mediaDb;
this.competitorStore = constructorParameters.getCompetitorStore();
if (windStore == null) {
try {
windStore = MongoWindStoreFactory.INSTANCE.getMongoWindStore(mongoObjectFactory, domainObjectFactory);
@@ -482,11 +537,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
throw new RuntimeException(e);
}
}
this.baseDomainFactory = baseDomainFactory;
this.domainObjectFactory = domainObjectFactory;
this.mongoObjectFactory = mongoObjectFactory;
this.mediaDB = mediaDb;
this.competitorStore = competitorStore;
this.competitorStore.addCompetitorUpdateListener(new CompetitorUpdateListener() {
@Override
public void competitorUpdated(Competitor competitor) {
@@ -3191,6 +3241,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
public void setPolarDataService(PolarDataService service) {
if (this.polarDataService == null) {
polarDataService = service;
polarDataService.registerDomainFactory(baseDomainFactory);
setPolarDataServiceOnAllTrackedRaces(service);
}
}
@@ -3216,6 +3267,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
public void unsetPolarDataService(PolarDataService service) {
if (polarDataService == service) {
polarDataService.unregisterDomainFactory(baseDomainFactory);
polarDataService = null;
setPolarDataService(null);
}
@@ -14,6 +14,7 @@ import com.sap.sailing.domain.base.Leg;
import com.sap.sailing.domain.base.Mark;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.SharedDomainFactory;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
@@ -56,6 +57,7 @@ import com.sap.sailing.domain.tracking.WindWithConfidence;
import com.sap.sailing.domain.tracking.impl.DynamicTrackedRegattaImpl;
import com.sap.sailing.domain.tracking.impl.EmptyWindStore;
import com.sap.sse.common.Duration;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
@@ -621,4 +623,9 @@ public class DummyTrackedRace extends TrackedRaceWithWindEssentials {
@Override
public void detachRaceExecutionOrderProvider(RaceExecutionOrderProvider raceExecutionOrderProvider) {
}
@Override
public IsManagedByCache<SharedDomainFactory> resolve(SharedDomainFactory domainFactory) {
return this;
}
}
@@ -22,6 +22,8 @@ import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.RaceColumn;
import com.sap.sailing.domain.base.RaceDefinition;
import com.sap.sailing.domain.base.Regatta;
import com.sap.sailing.domain.base.configuration.DeviceConfiguration;
import com.sap.sailing.domain.base.configuration.DeviceConfigurationMatcher;
import com.sap.sailing.domain.base.impl.RegattaImpl;
import com.sap.sailing.domain.common.DataImportProgress;
import com.sap.sailing.domain.common.RaceIdentifier;
@@ -119,6 +121,9 @@ public class ImportMasterDataOperation extends
progress.setCurrentSubProgressPct(0);
createWindTracks(toState);
importRaceLogTrackingGPSFixes(toState);
if (masterData.getDeviceConfigurations() != null) {
importDeviceConfigurations(toState);
}
dataImportLock.getProgress(importOperationId).setResult(creationCount);
return creationCount;
} catch (Exception e) {
@@ -129,6 +134,31 @@ public class ImportMasterDataOperation extends
}
}
private void importDeviceConfigurations(RacingEventService toState) {
Map<DeviceConfigurationMatcher, DeviceConfiguration> existingConfigs = toState.getAllDeviceConfigurations();
Set<DeviceConfigurationMatcher> existingKeys = existingConfigs.keySet();
Map<DeviceConfigurationMatcher, DeviceConfiguration> newConfigs = masterData.getDeviceConfigurations();
for(Entry<DeviceConfigurationMatcher, DeviceConfiguration> entry : newConfigs.entrySet()) {
DeviceConfigurationMatcher key = entry.getKey();
DeviceConfiguration value = entry.getValue();
if (existingKeys.contains(key)) {
if (override) {
logger.info(String.format(
"Device configuration [%s] already exists. Overwrite because override flag is set.",
key.getMatcherIdentifier()));
toState.removeDeviceConfiguration(key);
toState.createOrUpdateDeviceConfiguration(key, value);
} else {
logger.info(String
.format("Device configuration [%s] already exists. Not overwriting because override flag is not set.",
key.getMatcherIdentifier()));
}
} else {
toState.createOrUpdateDeviceConfiguration(key, value);
}
}
}
/**
* Ensures that all links from <code>eventReceived</code> to its leaderboard groups are established also on the
* local event after import as long as those leaderboard groups are part of the actual import. For this subset of
@@ -132,7 +132,8 @@ public class PathImpl implements Path, Serializable {
if ((this.pathPoints.get(idx).getTimePoint().asMillis() >= nextTimePoint.asMillis())||(idx == this.pathPoints.size()-1)) {
if (idx == this.pathPoints.size()-1) {
// for the last step, next-time-point needs to be aligned to the time-range of the course
if (nextTimePoint.after(endTime)) {
nextTimePoint = endTime;
}
@@ -57,9 +57,9 @@ public class PolarDiagramGPS extends PolarDiagramBase {
for (int i = 0; i < windSpeeds.size(); i++) {
try {
beatPort = this.polarData.getAverageSpeedWithBearing(this.boatClass, windSpeeds.get(i), LegType.UPWIND,
Tack.PORT, true).getObject();
Tack.PORT).getObject();
beatStar = this.polarData.getAverageSpeedWithBearing(this.boatClass, windSpeeds.get(i), LegType.UPWIND,
Tack.STARBOARD, true).getObject();
Tack.STARBOARD).getObject();
} catch (NotEnoughDataHasBeenAddedException e) {
beatPort = null;
beatStar = null;
@@ -86,9 +86,9 @@ public class PolarDiagramGPS extends PolarDiagramBase {
for (int i = 0; i < windSpeeds.size(); i++) {
try {
jibePort = this.polarData.getAverageSpeedWithBearing(this.boatClass, windSpeeds.get(i),
LegType.DOWNWIND, Tack.PORT, true).getObject();
LegType.DOWNWIND, Tack.PORT).getObject();
jibeStar = this.polarData.getAverageSpeedWithBearing(this.boatClass, windSpeeds.get(i),
LegType.DOWNWIND, Tack.STARBOARD, true).getObject();
LegType.DOWNWIND, Tack.STARBOARD).getObject();
} catch (NotEnoughDataHasBeenAddedException e) {
jibePort = null;
jibeStar = null;
@@ -146,13 +146,13 @@ public class PolarDiagramGPSDirect implements PolarDiagram, Serializable {
try {
if (beatPort == null) {
SpeedWithBearing beatPortRelative = this.polarData.getAverageSpeedWithBearing(this.boatClass, wind,
LegType.UPWIND, Tack.PORT, true).getObject();
LegType.UPWIND, Tack.PORT).getObject();
beatPort = new KnotSpeedWithBearingImpl(beatPortRelative.getKnots(), this.wind.getBearing().reverse()
.add(beatPortRelative.getBearing()));
}
if (beatStar == null) {
SpeedWithBearing beatStarRelative = this.polarData.getAverageSpeedWithBearing(this.boatClass, wind,
LegType.UPWIND, Tack.STARBOARD, true).getObject();
LegType.UPWIND, Tack.STARBOARD).getObject();
beatStar = new KnotSpeedWithBearingImpl(beatStarRelative.getKnots(), this.wind.getBearing().reverse()
.add(beatStarRelative.getBearing()));
}
@@ -175,13 +175,13 @@ public class PolarDiagramGPSDirect implements PolarDiagram, Serializable {
try {
if (jibePort == null) {
SpeedWithBearing jibePortRelative = this.polarData.getAverageSpeedWithBearing(this.boatClass, wind,
LegType.DOWNWIND, Tack.PORT, true).getObject();
LegType.DOWNWIND, Tack.PORT).getObject();
jibePort = new KnotSpeedWithBearingImpl(jibePortRelative.getKnots(), this.wind.getBearing().reverse()
.add(jibePortRelative.getBearing()));
}
if (jibeStar == null) {
SpeedWithBearing jibeStarRelative = this.polarData.getAverageSpeedWithBearing(this.boatClass, wind,
LegType.DOWNWIND, Tack.STARBOARD, true).getObject();
LegType.DOWNWIND, Tack.STARBOARD).getObject();
jibeStar = new KnotSpeedWithBearingImpl(jibeStarRelative.getKnots(), this.wind.getBearing().reverse()
.add(jibeStarRelative.getBearing()));
}
@@ -1,5 +1,7 @@
package com.sap.sse.datamining.test.util.components;
import java.io.Serializable;
import com.sap.sse.datamining.shared.annotations.Dimension;
/*
@@ -7,8 +9,9 @@ import com.sap.sse.datamining.shared.annotations.Dimension;
* The tests will fail, because they are reflected via constant strings.
*/
public class Number {
public class Number implements Serializable {
private static final long serialVersionUID = 1L;
private int value;
public Number(int value) {
@@ -1,5 +1,6 @@
package com.sap.sse.datamining.data;
import java.io.Serializable;
import java.util.Locale;
import com.sap.sse.i18n.ResourceBundleStringMessages;
@@ -16,7 +17,7 @@ import com.sap.sse.i18n.ResourceBundleStringMessages;
* @see ClusterBoundary
* @see ClusterGroup
*/
public interface Cluster<ElementType> {
public interface Cluster<ElementType> extends Serializable {
public String getAsLocalizedString(Locale locale, ResourceBundleStringMessages stringMessages);
@@ -1,5 +1,7 @@
package com.sap.sse.datamining.data;
import java.io.Serializable;
import com.sap.sse.datamining.impl.data.ComparisonStrategy;
/**
@@ -11,7 +13,7 @@ import com.sap.sse.datamining.impl.data.ComparisonStrategy;
*
* @see Cluster
*/
public interface ClusterBoundary<ElementType> {
public interface ClusterBoundary<ElementType> extends Serializable {
public boolean contains(ElementType value);
@@ -1,5 +1,6 @@
package com.sap.sse.datamining.data;
import java.io.Serializable;
import java.util.Locale;
import com.sap.sse.i18n.ResourceBundleStringMessages;
@@ -14,7 +15,7 @@ import com.sap.sse.i18n.ResourceBundleStringMessages;
*
* @see Cluster
*/
public interface ClusterGroup<ElementType> {
public interface ClusterGroup<ElementType extends Serializable> extends Serializable {
public String getLocalizedName(Locale locale, ResourceBundleStringMessages stringMessages);
@@ -1,11 +1,12 @@
package com.sap.sse.datamining.data;
import java.io.Serializable;
import java.util.Collection;
public interface ClusterGroupRepository {
public void add(ClusterGroup<?> clusterGroup);
public <DataType> Collection<ClusterGroup<DataType>> getClusterGroupsFor(Class<DataType> type);
public <DataType extends Serializable> Collection<ClusterGroup<DataType>> getClusterGroupsFor(Class<DataType> type);
}
@@ -10,6 +10,7 @@ import com.sap.sse.i18n.ResourceBundleStringMessages;
public abstract class AbstractCluster<ElementType> implements Cluster<ElementType> {
private static final long serialVersionUID = 1606840566021644768L;
private final String messageKey;
private Collection<ClusterBoundary<ElementType>> boundaries;
@@ -1,9 +1,12 @@
package com.sap.sse.datamining.impl.data;
import java.io.Serializable;
import com.sap.sse.datamining.data.ClusterBoundary;
public abstract class AbstractClusterBoundary<ElementType> implements ClusterBoundary<ElementType> {
public abstract class AbstractClusterBoundary<ElementType extends Serializable> implements ClusterBoundary<ElementType> {
private static final long serialVersionUID = 513488430319010656L;
private final ElementType boundaryValue;
private final ComparisonStrategy strategy;
@@ -8,6 +8,8 @@ import com.sap.sse.datamining.data.ClusterBoundary;
public class ClusterWithLowerAndUpperBoundaries<ElementType> extends AbstractCluster<ElementType> {
private static final long serialVersionUID = -845964568416163995L;
/**
* A {@link Cluster} with a lower and an upper boundary. This <code>Cluster</code> contains
* all elements, that are contained by the given <code>lowerBound</code> <b>and</b> the given
Loaded 100 of 112 files, more files were not shown because too many files have changed in this diff. Show more