mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-16 09:11:02 +00:00
# RaceLogStartTimeEvent now sets 'nextStatus' on its own
# some renaming in RaceLogEventFactory to reduce name-bloat # database load restores createdAt timestamp correctly
This commit is contained in:
1 parent
3a445745ff
commit
2b2d4d01aa
15 files changed
+169
-74
No files matched your search
+4
-4
@@ -22,11 +22,11 @@ public interface RaceLogEventFactory {
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint timePoint, int passId, RaceLogRaceStatus nextStatus);
|
||||
|
||||
RaceLogPassChangeEvent createRaceLogPassChangeEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId);
|
||||
RaceLogPassChangeEvent createRaceLogPassChangeEvent(TimePoint timePoint, int passId);
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId);
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint timePoint, int passId);
|
||||
|
||||
RaceLogCourseAreaChangedEvent createRaceLogCourseAreaChangedEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
|
||||
RaceLogCourseAreaChangedEvent createRaceLogCourseAreaChangedEvent(TimePoint timePoint, int passId, Serializable courseAreaId);
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint timePoint, int passId, Serializable courseAreaId);
|
||||
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors, int passId, CourseData courseData);
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint timePoint, int passId, CourseData courseData);
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.sap.sailing.domain.racelog;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseData;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.racelog.impl.RaceLogEventRestoreFactoryImpl;
|
||||
|
||||
public interface RaceLogEventRestoreFactory extends RaceLogEventFactory {
|
||||
RaceLogEventRestoreFactory INSTANCE = new RaceLogEventRestoreFactoryImpl();
|
||||
|
||||
RaceLogFlagEvent createFlagEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed);
|
||||
|
||||
RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, TimePoint startTime);
|
||||
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
|
||||
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> competitors, int passId);
|
||||
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
|
||||
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, CourseData courseData);
|
||||
}
|
||||
+7
@@ -1,7 +1,14 @@
|
||||
package com.sap.sailing.domain.racelog;
|
||||
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
|
||||
/**
|
||||
* A {@link RaceLogStartTimeEvent} denotes a new start time.
|
||||
*
|
||||
* Each {@link RaceLogStartTimeEvent} is also a {@link RaceLogRaceStatusEvent} with
|
||||
* {@link RaceLogRaceStatusEvent#getNextStatus()} returning {@link RaceLogRaceStatus#SCHEDULED}.
|
||||
*/
|
||||
public interface RaceLogStartTimeEvent extends RaceLogRaceStatusEvent {
|
||||
|
||||
TimePoint getStartTime();
|
||||
|
||||
+7
-7
@@ -36,7 +36,7 @@ public class RaceLogEventFactoryImpl implements RaceLogEventFactory {
|
||||
@Override
|
||||
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint timePoint, Serializable id, List<Competitor> involvedBoats, int passId,
|
||||
TimePoint startTime) {
|
||||
return new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(), timePoint, id, involvedBoats, passId, RaceLogRaceStatus.SCHEDULED, startTime);
|
||||
return new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(), timePoint, id, involvedBoats, passId, startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,26 +57,26 @@ public class RaceLogEventFactoryImpl implements RaceLogEventFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createRaceLogPassChangeEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors,
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors,
|
||||
int passId) {
|
||||
return new RaceLogPassChangeEventImpl(MillisecondsTimePoint.now(), timePoint, id, competitors, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createRaceLogPassChangeEvent(TimePoint timePoint, int passId) {
|
||||
return createRaceLogPassChangeEvent(timePoint, UUID.randomUUID(), new ArrayList<Competitor>(), passId);
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint timePoint, int passId) {
|
||||
return createPassChangeEvent(timePoint, UUID.randomUUID(), new ArrayList<Competitor>(), passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createRaceLogCourseAreaChangedEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors,
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint timePoint, Serializable id, List<Competitor> competitors,
|
||||
int passId, Serializable courseAreaId) {
|
||||
return new RaceLogCourseAreaChangeEventImpl(MillisecondsTimePoint.now(), timePoint, id, competitors, passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createRaceLogCourseAreaChangedEvent(
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(
|
||||
TimePoint timePoint, int passId, Serializable courseAreaId) {
|
||||
return createRaceLogCourseAreaChangedEvent(timePoint, UUID.randomUUID(), new ArrayList<Competitor>(), passId, courseAreaId);
|
||||
return createCourseAreaChangedEvent(timePoint, UUID.randomUUID(), new ArrayList<Competitor>(), passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.sap.sailing.domain.racelog.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseData;
|
||||
import com.sap.sailing.domain.common.TimePoint;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.racelog.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.racelog.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogPassChangeEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogRaceStatusEvent;
|
||||
import com.sap.sailing.domain.racelog.RaceLogStartTimeEvent;
|
||||
|
||||
public class RaceLogEventRestoreFactoryImpl extends RaceLogEventFactoryImpl implements RaceLogEventRestoreFactory {
|
||||
|
||||
@Override
|
||||
public RaceLogFlagEvent createFlagEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed) {
|
||||
return new RaceLogFlagEventImpl(createdAt, logicalTimePoint, id, involvedBoats, passId, upperFlag, lowerFlag, isDisplayed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, TimePoint logicalTimePoint, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, TimePoint startTime) {
|
||||
return new RaceLogStartTimeEventImpl(createdAt, logicalTimePoint, id, involvedBoats, passId, startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus) {
|
||||
return new RaceLogRaceStatusEventImpl(createdAt, logicalTimePoint, id, competitors, passId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId) {
|
||||
return new RaceLogPassChangeEventImpl(createdAt, logicalTimePoint, id, competitors, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId) {
|
||||
return new RaceLogCourseAreaChangeEventImpl(createdAt, logicalTimePoint, id, competitors, passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CourseData courseData) {
|
||||
return new RaceLogCourseDesignChangedEventImpl(createdAt, logicalTimePoint, id, competitors, passId, courseData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+2
-2
@@ -15,8 +15,8 @@ public class RaceLogStartTimeEventImpl extends RaceLogRaceStatusEventImpl implem
|
||||
private TimePoint startTime;
|
||||
|
||||
public RaceLogStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, Serializable pId,
|
||||
List<Competitor> pInvolvedBoats, int pPassId, RaceLogRaceStatus nextStatus, TimePoint pStartTime) {
|
||||
super(createdAt, pTimePoint, pId, pInvolvedBoats, pPassId, nextStatus);
|
||||
List<Competitor> pInvolvedBoats, int pPassId, TimePoint pStartTime) {
|
||||
super(createdAt, pTimePoint, pId, pInvolvedBoats, pPassId, RaceLogRaceStatus.SCHEDULED);
|
||||
this.startTime = pStartTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user