mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-26 23:46:36 +00:00
made most domain objects serializable
This commit is contained in:
+1
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
|
||||
|
||||
public class DeclinationRecordImpl implements Declination {
|
||||
private static final long serialVersionUID = 6918630656182340186L;
|
||||
private final Position position;
|
||||
private final TimePoint timePoint;
|
||||
private final Bearing bearing;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.domain.common;
|
||||
|
||||
public interface Named {
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface Named extends Serializable {
|
||||
String getName();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.sap.sailing.domain.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public interface TimePoint extends Comparable<TimePoint> {
|
||||
public interface TimePoint extends Comparable<TimePoint>, Serializable {
|
||||
long asMillis();
|
||||
|
||||
Date asDate();
|
||||
|
||||
+1
@@ -3,6 +3,7 @@ package com.sap.sailing.domain.common.impl;
|
||||
import com.sap.sailing.domain.common.Named;
|
||||
|
||||
public class NamedImpl implements Named {
|
||||
private static final long serialVersionUID = -4815125282671451300L;
|
||||
private final String name;
|
||||
|
||||
public NamedImpl(String name) {
|
||||
|
||||
+3
@@ -25,6 +25,7 @@ import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
*
|
||||
*/
|
||||
public class LeaderboardImplWithDelayedCarriedPoints extends LeaderboardImpl {
|
||||
private static final long serialVersionUID = -8933075542228571746L;
|
||||
private final Map<String, Integer> carriedPointsByCompetitorName;
|
||||
private final Map<String, Map<RaceInLeaderboard, MaxPointsReason>> maxPointsReasonsByCompetitorName;
|
||||
private final Map<String, Map<RaceInLeaderboard, Integer>> correctedScoresByCompetitorName;
|
||||
@@ -37,6 +38,8 @@ public class LeaderboardImplWithDelayedCarriedPoints extends LeaderboardImpl {
|
||||
* @author Axel Uhl (D043530)
|
||||
*/
|
||||
private class RaceInLeaderboardForDelayedCarriedPoints extends RaceInLeaderboardImpl {
|
||||
private static final long serialVersionUID = -1243132535406059096L;
|
||||
|
||||
public RaceInLeaderboardForDelayedCarriedPoints(Leaderboard leaderboard, String name, boolean medalRace) {
|
||||
super(leaderboard, name, medalRace);
|
||||
}
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@ import com.sap.sailing.domain.base.Person;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.Team;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
import com.sap.sailing.domain.base.impl.BoatClassImpl;
|
||||
import com.sap.sailing.domain.base.impl.BoatImpl;
|
||||
import com.sap.sailing.domain.base.impl.CourseImpl;
|
||||
import com.sap.sailing.domain.base.impl.EventImpl;
|
||||
@@ -88,7 +87,7 @@ public class DomainFactoryImpl implements DomainFactory {
|
||||
olympicClassesByID.put("009", baseDomainFactory.getOrCreateBoatClass("49er", /* alwaysStartsUpwind */ true));
|
||||
olympicClassesByID.put("007", baseDomainFactory.getOrCreateBoatClass("Star", /* typicallyStartsUpwind */ true));
|
||||
olympicClassesByID.put("010", baseDomainFactory.getOrCreateBoatClass("Elliott 6M", /* typicallyStartsUpwind */ true));
|
||||
unknownBoatClass = new BoatClassImpl("Unknown", /* typicallyStartsUpwind */ true);
|
||||
unknownBoatClass = baseDomainFactory.getOrCreateBoatClass("Unknown", /* typicallyStartsUpwind */ true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
@@ -21,6 +21,7 @@ public class MockedTrackedRaceWithFixedRank extends MockedTrackedRace {
|
||||
this.started = started;
|
||||
this.competitor = competitor;
|
||||
this.raceDefinition = new RaceDefinition() {
|
||||
private static final long serialVersionUID = 6812543850545870357L;
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ public class MockedTrackedRaceWithFixedRankAndManyCompetitors extends MockedTrac
|
||||
competitors = new HashSet<Competitor>();
|
||||
competitors.add(competitor);
|
||||
this.raceDefinition = new RaceDefinition() {
|
||||
private static final long serialVersionUID = 8878878939443845646L;
|
||||
@Override
|
||||
public String getName() {
|
||||
return null;
|
||||
|
||||
+2
@@ -274,6 +274,8 @@ public class MockedTrackedRace implements DynamicTrackedRace {
|
||||
@Override
|
||||
public Event getEvent() {
|
||||
return new Event() {
|
||||
private static final long serialVersionUID = -4908774269425170811L;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "A Mocked Test Event";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
|
||||
public interface Timed {
|
||||
public interface Timed extends Serializable {
|
||||
TimePoint getTimePoint();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.sap.sailing.domain.base;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface WithID {
|
||||
|
||||
/**
|
||||
* Something that uniquely identifies this object beyond his name
|
||||
*/
|
||||
Object getId();
|
||||
Serializable getId();
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -7,6 +7,8 @@ import java.util.Date;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
|
||||
public abstract class AbstractTimePoint implements TimePoint {
|
||||
private static final long serialVersionUID = 8825508619301420378L;
|
||||
|
||||
private static SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
||||
|
||||
public static Comparator<TimePoint> TIMEPOINT_COMPARATOR = new Comparator<TimePoint>() {
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.sap.sailing.domain.common.Distance;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class BoatClassImpl extends NamedImpl implements BoatClass {
|
||||
private static final long serialVersionUID = 7194912853476256420L;
|
||||
|
||||
/**
|
||||
* If the averaged courses over ground differ by at least this degree angle, a maneuver will
|
||||
* be assumed. Note that this should be much less than the tack angle because averaging may
|
||||
@@ -30,7 +32,7 @@ public class BoatClassImpl extends NamedImpl implements BoatClass {
|
||||
|
||||
private final long approximateManeuverDurationInMilliseconds;
|
||||
|
||||
private final boolean typicallyStartsUpwind;
|
||||
private final boolean typicallyStartsUpwind;
|
||||
|
||||
private final Distance hullLength;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class BoatImpl extends NamedImpl implements Boat {
|
||||
private static final long serialVersionUID = 3489730487528955788L;
|
||||
private final BoatClass boatClass;
|
||||
private final String sailID;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sap.sailing.domain.base.Buoy;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class BuoyImpl extends NamedImpl implements Buoy {
|
||||
private static final long serialVersionUID = 1900673146064411979L;
|
||||
|
||||
public BuoyImpl(String name) {
|
||||
super(name);
|
||||
|
||||
+6
-3
@@ -1,16 +1,19 @@
|
||||
package com.sap.sailing.domain.base.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.base.Boat;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Team;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class CompetitorImpl extends NamedImpl implements Competitor {
|
||||
private static final long serialVersionUID = 294603681016643157L;
|
||||
private final Team team;
|
||||
private final Boat boat;
|
||||
private final Object id;
|
||||
private final Serializable id;
|
||||
|
||||
public CompetitorImpl(Object id, String name, Team team, Boat boat) {
|
||||
public CompetitorImpl(Serializable id, String name, Team team, Boat boat) {
|
||||
super(name);
|
||||
this.id = id;
|
||||
this.team = team;
|
||||
@@ -18,7 +21,7 @@ public class CompetitorImpl extends NamedImpl implements Competitor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getId() {
|
||||
public Serializable getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ import difflib.Patch;
|
||||
import difflib.PatchFailedException;
|
||||
|
||||
public class CourseImpl extends NamedImpl implements Course {
|
||||
private static final long serialVersionUID = -4280487649617132403L;
|
||||
|
||||
private static final Logger logger = Logger.getLogger(CourseImpl.class.getName());
|
||||
|
||||
private final List<Waypoint> waypoints;
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class EventImpl extends NamedImpl implements Event {
|
||||
private static final long serialVersionUID = 6509564189552478869L;
|
||||
private final Set<RaceDefinition> races;
|
||||
private final BoatClass boatClass;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.base.Buoy;
|
||||
import com.sap.sailing.domain.base.Gate;
|
||||
|
||||
public class GateImpl implements Gate {
|
||||
private static final long serialVersionUID = 2807354812133070574L;
|
||||
private final Buoy left;
|
||||
private final Buoy right;
|
||||
private final String name;
|
||||
|
||||
+1
@@ -4,6 +4,7 @@ import java.util.Date;
|
||||
|
||||
|
||||
public class MillisecondsTimePoint extends AbstractTimePoint {
|
||||
private static final long serialVersionUID = -1021748860232043166L;
|
||||
private final long millis;
|
||||
private Date date;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.common.CountryCode;
|
||||
import com.sap.sailing.domain.common.CountryCodeFactory;
|
||||
|
||||
public class NationalityImpl implements Nationality {
|
||||
private static final long serialVersionUID = 238906193483424259L;
|
||||
private final String threeLetterIOCAcronym;
|
||||
|
||||
public NationalityImpl(String name, String threeLetterIOCAcronym) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.base.Person;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class PersonImpl extends NamedImpl implements Person {
|
||||
private static final long serialVersionUID = -2104903799224233508L;
|
||||
private final Nationality nationality;
|
||||
private final Date dateOfBirth;
|
||||
private final String description;
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class RaceDefinitionImpl extends NamedImpl implements RaceDefinition {
|
||||
private static final long serialVersionUID = -1900955198751393727L;
|
||||
private final Course course;
|
||||
private final Iterable<Competitor> competitors;
|
||||
private final BoatClass boatClass;
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.sap.sailing.domain.base.Team;
|
||||
import com.sap.sailing.domain.common.impl.NamedImpl;
|
||||
|
||||
public class TeamImpl extends NamedImpl implements Team {
|
||||
private static final long serialVersionUID = 4646922280429210183L;
|
||||
private final Iterable<? extends Person> sailors;
|
||||
private final Person coach;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.sap.sailing.domain.base.ControlPoint;
|
||||
import com.sap.sailing.domain.base.Waypoint;
|
||||
|
||||
public class WaypointImpl implements Waypoint {
|
||||
private static final long serialVersionUID = 1600863368078653897L;
|
||||
private final ControlPoint controlPoint;
|
||||
private static int idCounter = 1;
|
||||
private final int id;
|
||||
@@ -34,9 +35,6 @@ public class WaypointImpl implements Waypoint {
|
||||
return getControlPoint().getBuoys();
|
||||
}
|
||||
|
||||
/**
|
||||
* Note that a waypoint is not compared by its identity but by the control point it represents.
|
||||
*/
|
||||
@Override
|
||||
public Integer getId() {
|
||||
return id;
|
||||
|
||||
+1
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.leaderboard.LeaderboardGroup;
|
||||
|
||||
public class LeaderboardGroupImpl implements LeaderboardGroup {
|
||||
|
||||
private static final long serialVersionUID = 2035927369446736934L;
|
||||
private String name;
|
||||
private String description;
|
||||
private List<Leaderboard> leaderboards;
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ import com.sap.sailing.domain.leaderboard.ThresholdBasedResultDiscardingRule;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
|
||||
public class LeaderboardImpl implements Named, Leaderboard {
|
||||
private static final long serialVersionUID = -328091952760083438L;
|
||||
private final List<RaceInLeaderboard> races;
|
||||
private final SettableScoreCorrection scoreCorrection;
|
||||
private ThresholdBasedResultDiscardingRule resultDiscardingRule;
|
||||
|
||||
+1
@@ -10,6 +10,7 @@ import com.sap.sailing.domain.leaderboard.RaceInLeaderboard;
|
||||
import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
|
||||
public class RaceInLeaderboardImpl implements RaceInLeaderboard {
|
||||
private static final long serialVersionUID = -7801617988982540470L;
|
||||
private TrackedRace trackedRace;
|
||||
private final Leaderboard leaderboard;
|
||||
private boolean medalRace;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.sap.sailing.domain.tracking;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.sap.sailing.domain.common.Position;
|
||||
|
||||
public interface Positioned {
|
||||
public interface Positioned extends Serializable {
|
||||
Position getPosition();
|
||||
}
|
||||
|
||||
+2
@@ -8,6 +8,8 @@ import com.sap.sailing.domain.common.Speed;
|
||||
import com.sap.sailing.domain.tracking.GPSFix;
|
||||
|
||||
public abstract class AbstractGPSFixImpl implements GPSFix {
|
||||
private static final long serialVersionUID = 9037068515469957639L;
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
||||
+3
@@ -18,6 +18,7 @@ import com.sap.sailing.domain.tracking.GPSFix;
|
||||
*
|
||||
*/
|
||||
public class CompactGPSFixImpl extends AbstractGPSFixImpl {
|
||||
private static final long serialVersionUID = 8167588584536992501L;
|
||||
private final double latDeg;
|
||||
private final double lngDeg;
|
||||
private final long timePointAsMillis;
|
||||
@@ -43,6 +44,8 @@ public class CompactGPSFixImpl extends AbstractGPSFixImpl {
|
||||
}
|
||||
|
||||
private class CompactTimePoint extends AbstractTimePoint implements TimePoint {
|
||||
private static final long serialVersionUID = -2470922642359937437L;
|
||||
|
||||
@Override
|
||||
public long asMillis() {
|
||||
return timePointAsMillis;
|
||||
|
||||
+1
@@ -20,6 +20,7 @@ import com.sap.sailing.domain.tracking.GPSFixMoving;
|
||||
*
|
||||
*/
|
||||
public class CompactGPSFixMovingImpl extends CompactGPSFixImpl implements GPSFixMoving {
|
||||
private static final long serialVersionUID = 761582024504236533L;
|
||||
private final double knotSpeed;
|
||||
private final double degBearing;
|
||||
|
||||
|
||||
+4
-1
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
|
||||
public class DummyMarkPassingWithTimePointOnly implements MarkPassing {
|
||||
private static final long serialVersionUID = -5494669910047887984L;
|
||||
private final TimePoint timePoint;
|
||||
|
||||
public DummyMarkPassingWithTimePointOnly(TimePoint timePoint) {
|
||||
@@ -28,13 +29,15 @@ public class DummyMarkPassingWithTimePointOnly implements MarkPassing {
|
||||
@Override
|
||||
public Competitor getCompetitor() {
|
||||
return new Competitor() {
|
||||
private static final long serialVersionUID = 5663644650754031382L;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Dummy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getId() {
|
||||
public String getId() {
|
||||
return "Dummy";
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -152,6 +152,7 @@ public class DynamicGPSFixMovingTrackImpl<ItemType> extends DynamicTrackImpl<Ite
|
||||
}
|
||||
|
||||
private class DummyGPSFixMoving extends DummyTimed implements GPSFixMoving {
|
||||
private static final long serialVersionUID = 7135346050999824024L;
|
||||
public DummyGPSFixMoving(TimePoint timePoint) {
|
||||
super(timePoint);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.sap.sailing.domain.tracking.GPSFix;
|
||||
*
|
||||
*/
|
||||
public class GPSFixImpl extends AbstractGPSFixImpl implements GPSFix {
|
||||
private static final long serialVersionUID = -368671632334748334L;
|
||||
private final Position position;
|
||||
private final TimePoint timePoint;
|
||||
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.tracking.GPSFixMoving;
|
||||
|
||||
public class GPSFixMovingImpl extends GPSFixImpl implements GPSFixMoving {
|
||||
private static final long serialVersionUID = 6508021498142383100L;
|
||||
private final SpeedWithBearing speed;
|
||||
|
||||
public GPSFixMovingImpl(Position position, TimePoint timePoint, SpeedWithBearing speed) {
|
||||
|
||||
+2
@@ -81,6 +81,8 @@ public class GPSFixTrackImpl<ItemType, FixType extends GPSFix> extends TrackImpl
|
||||
}
|
||||
|
||||
private class DummyGPSFix extends DummyTimed implements GPSFix {
|
||||
private static final long serialVersionUID = -6258506654181816698L;
|
||||
|
||||
public DummyGPSFix(TimePoint timePoint) {
|
||||
super(timePoint);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.tracking.Maneuver;
|
||||
|
||||
public class ManeuverImpl extends AbstractGPSFixImpl implements Maneuver {
|
||||
private static final long serialVersionUID = -5317959066507472580L;
|
||||
private final ManeuverType type;
|
||||
private final Tack newTack;
|
||||
private final Position position;
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.tracking.MarkPassing;
|
||||
|
||||
public class MarkPassingImpl implements MarkPassing {
|
||||
private static final long serialVersionUID = -2673562761742403742L;
|
||||
private final TimePoint timePoint;
|
||||
private final Waypoint waypoint;
|
||||
private final Competitor competitor;
|
||||
|
||||
@@ -17,6 +17,7 @@ public abstract class TrackImpl<FixType extends Timed> implements Track<FixType>
|
||||
private final NavigableSet<Timed> fixes;
|
||||
|
||||
protected static class DummyTimed implements Timed {
|
||||
private static final long serialVersionUID = 6047311973718918856L;
|
||||
private final TimePoint timePoint;
|
||||
public DummyTimed(TimePoint timePoint) {
|
||||
super();
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.sap.sailing.domain.common.impl.DegreeBearingImpl;
|
||||
import com.sap.sailing.domain.tracking.Wind;
|
||||
|
||||
public class WindImpl extends KnotSpeedWithBearingImpl implements Wind {
|
||||
private static final long serialVersionUID = 5431592324949471980L;
|
||||
private final Position position;
|
||||
private final TimePoint timepoint;
|
||||
private final Bearing from;
|
||||
|
||||
+1
@@ -273,6 +273,7 @@ public class WindTrackImpl extends TrackImpl<Wind> implements WindTrack {
|
||||
}
|
||||
|
||||
protected static class DummyWind extends DummyTimed implements Wind {
|
||||
private static final long serialVersionUID = -311172509910032149L;
|
||||
public DummyWind(TimePoint timePoint) {
|
||||
super(timePoint);
|
||||
}
|
||||
|
||||
@@ -316,4 +316,14 @@ public interface RacingEventService extends TrackedEventRegistry {
|
||||
TrackedRace createTrackedRace(EventAndRaceIdentifier raceIdentifier, WindStore windStore,
|
||||
long millisecondsOverWhichToAverageWind, long millisecondsOverWhichToAverageSpeed);
|
||||
|
||||
void createEvent(String eventName, String boatClassName, boolean boatClassTypicallyStartsUpwind);
|
||||
|
||||
/**
|
||||
* Adds <code>raceDefinition</code> to the {@link Event} such that it will appear in {@link Event#getAllRaces()}
|
||||
* and {@link Event#getRaceByName(String)}.
|
||||
*
|
||||
* @param addToEvent identifier of an event that must exist already
|
||||
*/
|
||||
void addRace(EventIdentifier addToEvent, RaceDefinition raceDefinition);
|
||||
|
||||
}
|
||||
|
||||
+14
@@ -26,6 +26,7 @@ import java.util.logging.Logger;
|
||||
import com.sap.sailing.domain.base.ControlPoint;
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.base.impl.EventImpl;
|
||||
import com.sap.sailing.domain.common.DefaultLeaderboardName;
|
||||
import com.sap.sailing.domain.common.EventAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.common.EventFetcher;
|
||||
@@ -366,6 +367,13 @@ public class RacingEventServiceImpl implements RacingEventService, EventFetcher,
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createEvent(String eventName, String boatClassName, boolean boatClassTypicallyStartsUpwind) {
|
||||
Event event = new EventImpl(eventName, com.sap.sailing.domain.base.DomainFactory.INSTANCE.getOrCreateBoatClass(
|
||||
boatClassName, boatClassTypicallyStartsUpwind));
|
||||
eventsByName.put(eventName, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<String, List<RaceRecord>> getTracTracRaceRecords(URL jsonURL) throws IOException, ParseException, org.json.simple.parser.ParseException, URISyntaxException {
|
||||
JSONService jsonService = getDomainFactory().parseJSONURL(jsonURL);
|
||||
@@ -406,6 +414,12 @@ public class RacingEventServiceImpl implements RacingEventService, EventFetcher,
|
||||
/* endOfTracking */ null, windStore), windStore, timeoutInMilliseconds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRace(EventIdentifier addToEvent, RaceDefinition raceDefinition) {
|
||||
Event event = getEvent(addToEvent);
|
||||
event.addRace(raceDefinition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized RacesHandle addRace(RaceTrackingConnectivityParameters params, WindStore windStore,
|
||||
long timeoutInMilliseconds) throws Exception {
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
package com.sap.sailing.server.operationaltransformation;
|
||||
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
|
||||
public class AddEvent extends AbstractRacingEventServiceOperation {
|
||||
private static final long serialVersionUID = -3550383541066673065L;
|
||||
private final String eventName;
|
||||
private final String boatClassName;
|
||||
private final boolean boatClassTypicallyStartsUpwind;
|
||||
|
||||
public AddEvent(String eventName, String boatClassName, boolean boatClassTypicallyStartsUpwind) {
|
||||
super();
|
||||
this.eventName = eventName;
|
||||
this.boatClassName = boatClassName;
|
||||
this.boatClassTypicallyStartsUpwind = boatClassTypicallyStartsUpwind;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventServiceOperation transformClientOp(RacingEventServiceOperation serverOp) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventServiceOperation transformServerOp(RacingEventServiceOperation clientOp) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventService applyTo(RacingEventService toState) {
|
||||
toState.createEvent(eventName, boatClassName, boatClassTypicallyStartsUpwind);
|
||||
return toState;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user