mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-20 03:00:00 +00:00
Merge branch 'design2015-bug3348' into design2015
This commit is contained in:
commit
4208f91551
150 files changed
+1470
-1878
No files matched your search
+62
-39
@@ -41,7 +41,6 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
@@ -59,10 +58,30 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEven
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseAreaChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEndOfTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFixedMarkPassingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartOfTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogSuppressedMarkPassingsEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
@@ -70,6 +89,13 @@ import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorM
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogCloseOpenEndedDeviceMappingEvent;
|
||||
@@ -209,8 +235,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
private final CompetitorJsonDeserializer competitorDeserializer;
|
||||
|
||||
private final DB database;
|
||||
|
||||
private RaceLogEventRestoreFactory raceLogEventFactory;
|
||||
|
||||
private final DomainFactory baseDomainFactory;
|
||||
private final TypeBasedServiceFinder<DeviceIdentifierMongoHandler> deviceIdentifierServiceFinder;
|
||||
private final TypeBasedServiceFinderFactory serviceFinderFactory;
|
||||
@@ -235,7 +260,6 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
this.baseDomainFactory = baseDomainFactory;
|
||||
this.competitorDeserializer = CompetitorJsonDeserializer.create(baseDomainFactory);
|
||||
this.database = db;
|
||||
this.raceLogEventFactory = RaceLogEventRestoreFactory.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1363,7 +1387,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Wind wind = loadWind((DBObject) dbObject.get(FieldNames.WIND.name()));
|
||||
Boolean isMagnetic = (Boolean) dbObject.get(FieldNames.IS_MAGNETIC.name());
|
||||
return raceLogEventFactory.createWindFixEvent(createdAt, author, logicalTimePoint, id, competitors, passId, wind, isMagnetic == null ? true : isMagnetic);
|
||||
return new RaceLogWindFixEventImpl(createdAt, logicalTimePoint, author, id, passId, wind, isMagnetic == null ? true : isMagnetic);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
@@ -1380,7 +1404,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
(Serializable) dbObject.get(FieldNames.COMPETITOR_ID.name()));
|
||||
TimePoint from = loadTimePoint(dbObject, FieldNames.RACE_LOG_FROM);
|
||||
TimePoint to = loadTimePoint(dbObject, FieldNames.RACE_LOG_TO);
|
||||
return raceLogEventFactory.createDeviceCompetitorMappingEvent(createdAt, author, logicalTimePoint, id, device, mappedTo, passId, from, to);
|
||||
return new RaceLogDeviceCompetitorMappingEventImpl(createdAt, logicalTimePoint, author, id, passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
@@ -1397,7 +1421,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
Mark mappedTo = loadMark((DBObject) dbObject.get(FieldNames.MARK.name()));
|
||||
TimePoint from = loadTimePoint(dbObject, FieldNames.RACE_LOG_FROM);
|
||||
TimePoint to = loadTimePoint(dbObject, FieldNames.RACE_LOG_TO);
|
||||
return raceLogEventFactory.createDeviceMarkMappingEvent(createdAt, author, logicalTimePoint, id, device, mappedTo, passId, from, to);
|
||||
return new RaceLogDeviceMarkMappingEventImpl(createdAt, logicalTimePoint, author, id, passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
@@ -1405,12 +1429,12 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
String raceName = (String) dbObject.get(FieldNames.RACE_NAME.name());
|
||||
BoatClass boatClass = baseDomainFactory.getOrCreateBoatClass((String) dbObject.get(FieldNames.BOAT_CLASS_NAME.name()));
|
||||
Serializable raceId = (Serializable) dbObject.get(FieldNames.RACE_ID.name());
|
||||
return raceLogEventFactory.createDenoteForTrackingEvent(createdAt, author, logicalTimePoint, id, passId, raceName, boatClass, raceId);
|
||||
return new RaceLogDenoteForTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId, raceName, boatClass, raceId);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
return raceLogEventFactory.createStartTrackingEvent(createdAt, author, logicalTimePoint, id, passId);
|
||||
return new RaceLogStartTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
@@ -1420,7 +1444,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
String revokedEventType = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_EVENT_TYPE.name());
|
||||
String revokedEventShortInfo = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_EVENT_SHORT_INFO.name());
|
||||
String reason = (String) dbObject.get(FieldNames.RACE_LOG_REVOKED_REASON.name());
|
||||
return raceLogEventFactory.createRevokeEvent(createdAt, author, logicalTimePoint, id, passId,
|
||||
return new RaceLogRevokeEventImpl(createdAt, logicalTimePoint, author, id, passId,
|
||||
revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
}
|
||||
|
||||
@@ -1428,20 +1452,20 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Serializable competitorId = (Serializable) dbObject.get(FieldNames.RACE_LOG_COMPETITOR_ID.name());
|
||||
Competitor comp = baseDomainFactory.getCompetitorStore().getExistingCompetitorById(competitorId);
|
||||
return raceLogEventFactory.createRegisterCompetitorEvent(createdAt, author, logicalTimePoint, id, passId, comp);
|
||||
return new RaceLogRegisterCompetitorEventImpl(createdAt, logicalTimePoint, author, id, passId, comp);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Mark mark = loadMark((DBObject) dbObject.get(FieldNames.RACE_LOG_MARK.name()));
|
||||
return raceLogEventFactory.createDefineMarkEvent(createdAt, author, logicalTimePoint, id, passId, mark);
|
||||
return new RaceLogDefineMarkEventImpl(createdAt, logicalTimePoint, author, id, passId, mark);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogCloseOpenEndedDeviceMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Serializable deviceMappingEventId = Helpers.tryUuidConversion((Serializable) dbObject.get(FieldNames.RACE_LOG_DEVICE_MAPPING_EVENT_ID.name()));
|
||||
TimePoint closingTimePoint = loadTimePoint(dbObject, FieldNames.RACE_LOG_CLOSING_TIMEPOINT);
|
||||
return raceLogEventFactory.createCloseOpenEndedDeviceMappingEvent(createdAt, author, logicalTimePoint, id, passId,
|
||||
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(createdAt, logicalTimePoint, author, id, passId,
|
||||
deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@@ -1454,19 +1478,19 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
} else {
|
||||
logger.warning("Could not find additional scoring information attached to db log for " + dbObject.toString());
|
||||
}
|
||||
return raceLogEventFactory.createAdditionalScoringInformationEvent(createdAt, author, logicalTimePoint, id, competitors, passId, informationType);
|
||||
return new RaceLogAdditionalScoringInformationEventImpl(createdAt, logicalTimePoint, author, id, passId, informationType);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
TimePoint protestStartTime = loadTimePoint(dbObject, FieldNames.RACE_LOG_PROTEST_START_TIME);
|
||||
return raceLogEventFactory.createProtestStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors, passId, protestStartTime);
|
||||
return new RaceLogProtestStartTimeEventImpl(createdAt, logicalTimePoint, author, id, passId, protestStartTime);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
RacingProcedureType type = RacingProcedureType.valueOf(dbObject.get(FieldNames.RACE_LOG_START_PROCEDURE_TYPE.name()).toString());
|
||||
return raceLogEventFactory.createStartProcedureChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, type);
|
||||
return new RaceLogStartProcedureChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, type);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
@@ -1476,14 +1500,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
if (dbObject.containsField(FieldNames.RACE_LOG_GOLF_DOWN_TIME.name())) {
|
||||
golfDownTime = (Number) dbObject.get(FieldNames.RACE_LOG_GOLF_DOWN_TIME.name());
|
||||
}
|
||||
return raceLogEventFactory.createGateLineOpeningTimeEvent(createdAt, author, logicalTimePoint, id, competitors,
|
||||
return new RaceLogGateLineOpeningTimeEventImpl(createdAt, logicalTimePoint, author, id,
|
||||
passId, gateLaunchStopTime == null ? null : gateLaunchStopTime.longValue(), golfDownTime.longValue());
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
String pathfinderId = dbObject.get(FieldNames.RACE_LOG_PATHFINDER_ID.name()).toString();
|
||||
return raceLogEventFactory.createPathfinderEvent(createdAt, author, logicalTimePoint, id, competitors, passId, pathfinderId);
|
||||
return new RaceLogPathfinderEventImpl(createdAt, logicalTimePoint, author, id, passId, pathfinderId);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogFinishPositioningConfirmedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
@@ -1496,7 +1520,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
positionedCompetitors = loadPositionedCompetitors(dbPositionedCompetitorList);
|
||||
}
|
||||
|
||||
return raceLogEventFactory.createFinishPositioningConfirmedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
|
||||
return new RaceLogFinishPositioningConfirmedEventImpl(createdAt, logicalTimePoint, author, id, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogFinishPositioningListChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
@@ -1504,36 +1528,36 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
BasicDBList dbPositionedCompetitorList = (BasicDBList) dbObject.get(FieldNames.RACE_LOG_POSITIONED_COMPETITORS.name());
|
||||
CompetitorResults positionedCompetitors = loadPositionedCompetitors(dbPositionedCompetitorList);
|
||||
|
||||
return raceLogEventFactory.createFinishPositioningListChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
|
||||
return new RaceLogFinishPositioningListChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors) {
|
||||
return raceLogEventFactory.createPassChangeEvent(createdAt, author, logicalTimePoint, id, competitors, passId);
|
||||
return new RaceLogPassChangeEventImpl(createdAt, logicalTimePoint, author, id, passId);
|
||||
}
|
||||
|
||||
private RaceLogCourseDesignChangedEvent loadRaceLogCourseDesignChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
String courseName = (String) dbObject.get(FieldNames.RACE_LOG_COURSE_DESIGN_NAME.name());
|
||||
CourseBase courseData = loadCourseData((BasicDBList) dbObject.get(FieldNames.RACE_LOG_COURSE_DESIGN.name()), courseName);
|
||||
return raceLogEventFactory.createCourseDesignChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, courseData);
|
||||
return new RaceLogCourseDesignChangedEventImpl(createdAt, logicalTimePoint, author, id, passId, courseData);
|
||||
}
|
||||
|
||||
private RaceLogCourseAreaChangedEvent loadRaceLogCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Serializable courseAreaId = (Serializable) dbObject.get(FieldNames.COURSE_AREA_ID.name());
|
||||
return raceLogEventFactory.createCourseAreaChangedEvent(createdAt, author, logicalTimePoint, id, competitors, passId, courseAreaId);
|
||||
return new RaceLogCourseAreaChangeEventImpl(createdAt, logicalTimePoint, author, id, passId, courseAreaId);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogFixedMarkPassingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
TimePoint ofFixedPassing = loadTimePoint(dbObject, FieldNames.TIMEPOINT_OF_FIXED_MARKPASSING);
|
||||
Integer zeroBasedIndexOfWaypoint = (Integer) dbObject.get(FieldNames.INDEX_OF_PASSED_WAYPOINT.name());
|
||||
return raceLogEventFactory.createFixedMarkPassingEvent(logicalTimePoint, author, id, competitors, passId, ofFixedPassing, zeroBasedIndexOfWaypoint);
|
||||
return new RaceLogFixedMarkPassingEventImpl(createdAt, logicalTimePoint, author, id, competitors, passId, ofFixedPassing, zeroBasedIndexOfWaypoint);
|
||||
}
|
||||
|
||||
private RaceLogEvent loadRaceLogSuppressedMarkPassingsEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
Integer zeroBasedIndexOfFirstSuppressedWaypoint = (Integer) dbObject.get(FieldNames.INDEX_OF_FIRST_SUPPRESSED_WAYPOINT.name());
|
||||
return raceLogEventFactory.createSuppressedMarkPassingsEvent(logicalTimePoint, author, id, competitors, passId, zeroBasedIndexOfFirstSuppressedWaypoint);
|
||||
return new RaceLogSuppressedMarkPassingsEventImpl(createdAt, logicalTimePoint, author, id, competitors, passId, zeroBasedIndexOfFirstSuppressedWaypoint);
|
||||
}
|
||||
|
||||
private CompetitorResults loadPositionedCompetitors(BasicDBList dbPositionedCompetitorList) {
|
||||
@@ -1581,22 +1605,21 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
return raceLogEventFactory.createFlagEvent(createdAt, author, logicalTimePoint, id, competitors, passId, upperFlag, lowerFlag, displayed);
|
||||
return new RaceLogFlagEventImpl(createdAt, logicalTimePoint, author, id, passId, upperFlag, lowerFlag, displayed);
|
||||
}
|
||||
|
||||
private RaceLogStartTimeEvent loadRaceLogStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
TimePoint startTime = loadTimePoint(dbObject, FieldNames.RACE_LOG_EVENT_START_TIME);
|
||||
final String nextStatusName = (String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name());
|
||||
final RaceLogRaceStatus nextStatus = nextStatusName==null?null:RaceLogRaceStatus.valueOf(nextStatusName);
|
||||
return raceLogEventFactory.createStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors, passId, startTime, nextStatus);
|
||||
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
|
||||
return new RaceLogStartTimeEventImpl(createdAt, logicalTimePoint, author, id, passId, startTime, nextStatus);
|
||||
}
|
||||
|
||||
private RaceLogStartOfTrackingEvent loadRaceLogStartOfTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
return raceLogEventFactory.createStartOfTrackingEvent(logicalTimePoint, author, id, competitors, passId);
|
||||
return new RaceLogStartOfTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
|
||||
}
|
||||
|
||||
private RaceLogEndOfTrackingEvent loadRaceLogEndOfTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
return raceLogEventFactory.createEndOfTrackingEvent(logicalTimePoint, author, id, competitors, passId);
|
||||
return new RaceLogEndOfTrackingEventImpl(createdAt, logicalTimePoint, author, id, passId);
|
||||
}
|
||||
|
||||
private RaceLogDependentStartTimeEvent loadRaceLogDependentStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
@@ -1611,13 +1634,13 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
final Duration startTimeDifference = startTimeDifferenceObject == null ? null :
|
||||
new MillisecondsDurationImpl(((Number) startTimeDifferenceObject).longValue());
|
||||
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
|
||||
return raceLogEventFactory.createDependentStartTimeEvent(createdAt, author, logicalTimePoint, id, competitors,
|
||||
return new RaceLogDependentStartTimeEventImpl(createdAt, logicalTimePoint, author, id,
|
||||
passId, dependentRaceLog, startTimeDifference, nextStatus);
|
||||
}
|
||||
|
||||
private RaceLogRaceStatusEvent loadRaceLogRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, Integer passId, List<Competitor> competitors, DBObject dbObject) {
|
||||
RaceLogRaceStatus nextStatus = RaceLogRaceStatus.valueOf((String) dbObject.get(FieldNames.RACE_LOG_EVENT_NEXT_STATUS.name()));
|
||||
return raceLogEventFactory.createRaceStatusEvent(createdAt, author, logicalTimePoint, id, competitors, passId, nextStatus);
|
||||
return new RaceLogRaceStatusEventImpl(createdAt, logicalTimePoint, author, id, passId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1689,7 +1712,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, DBObject dbObject) {
|
||||
final Competitor comp = getCompetitorByID(dbObject);
|
||||
final Double timeOnTimeFactor = (Double) dbObject.get(FieldNames.REGATTA_LOG_TIME_ON_TIME_FACTOR.name());
|
||||
return new RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(createdAt, author, logicalTimePoint, id, comp, timeOnTimeFactor);
|
||||
return new RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(createdAt, logicalTimePoint, author, id, comp, timeOnTimeFactor);
|
||||
}
|
||||
|
||||
private RegattaLogEvent loadRegattaLogSetCompetitorTimeOnTimeFactorEvent(TimePoint createdAt,
|
||||
@@ -1698,7 +1721,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
final Double timeOnDistanceSecondsAllowancePerNauticalMile = (Double) dbObject.get(FieldNames.REGATTA_LOG_TIME_ON_DISTANCE_SECONDS_ALLOWANCE_PER_NAUTICAL_MILE.name());
|
||||
final Duration timeOnDistanceAllowancePerNauticalMile = timeOnDistanceSecondsAllowancePerNauticalMile == null ? null :
|
||||
new MillisecondsDurationImpl((long) (timeOnDistanceSecondsAllowancePerNauticalMile*1000));
|
||||
return new RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(createdAt, author, logicalTimePoint, id, comp, timeOnDistanceAllowancePerNauticalMile);
|
||||
return new RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(createdAt, logicalTimePoint, author, id, comp, timeOnDistanceAllowancePerNauticalMile);
|
||||
}
|
||||
|
||||
private RegattaLogRevokeEvent loadRegattaLogRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
@@ -1708,14 +1731,14 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
String revokedEventType = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_EVENT_TYPE.name());
|
||||
String revokedEventShortInfo = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_EVENT_SHORT_INFO.name());
|
||||
String reason = (String) dbObject.get(FieldNames.REGATTA_LOG_REVOKED_REASON.name());
|
||||
return new RegattaLogRevokeEventImpl(createdAt, author, logicalTimePoint, id,
|
||||
return new RegattaLogRevokeEventImpl(createdAt, logicalTimePoint, author, id,
|
||||
revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
}
|
||||
|
||||
private RegattaLogRegisterCompetitorEvent loadRegattaLogRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, DBObject dbObject) {
|
||||
Competitor comp = getCompetitorByID(dbObject);
|
||||
return new RegattaLogRegisterCompetitorEventImpl(createdAt, author, logicalTimePoint, id, comp);
|
||||
return new RegattaLogRegisterCompetitorEventImpl(createdAt, logicalTimePoint, author, id, comp);
|
||||
}
|
||||
|
||||
private RegattaLogCloseOpenEndedDeviceMappingEvent loadRegattaLogCloseOpenEndedDeviceMappingEvent(TimePoint createdAt,
|
||||
@@ -1742,7 +1765,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
Triple<TimePoint, TimePoint, Boolean> times = loadFromToTimePoint(dbObject, FieldNames.REGATTA_LOG_FROM, FieldNames.RACE_LOG_FROM, FieldNames.REGATTA_LOG_TO, FieldNames.RACE_LOG_TO);
|
||||
final TimePoint from = times.getA();
|
||||
final TimePoint to = times.getB();
|
||||
final RegattaLogDeviceMarkMappingEventImpl result = new RegattaLogDeviceMarkMappingEventImpl(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
|
||||
final RegattaLogDeviceMarkMappingEventImpl result = new RegattaLogDeviceMarkMappingEventImpl(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
|
||||
final boolean needsMigration = times.getC();
|
||||
if (needsMigration) {
|
||||
// remove old version of mapping event
|
||||
@@ -1804,7 +1827,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
final TimePoint from = times.getA();
|
||||
final TimePoint to = times.getB();
|
||||
final boolean needsMigration = times.getC();
|
||||
final RegattaLogDeviceCompetitorMappingEventImpl result = new RegattaLogDeviceCompetitorMappingEventImpl(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
|
||||
final RegattaLogDeviceCompetitorMappingEventImpl result = new RegattaLogDeviceCompetitorMappingEventImpl(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
|
||||
if (needsMigration) {
|
||||
// remove old version of mapping event
|
||||
WriteResult removeResult = database.getCollection(CollectionNames.REGATTA_LOGS.name()).remove(outerDBObject);
|
||||
|
||||
+6
-5
@@ -9,8 +9,9 @@ import org.junit.Before;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
@@ -66,8 +67,8 @@ public class AbstractGPSFixStoreTest {
|
||||
}
|
||||
|
||||
protected void map(RaceLog raceLog, Competitor comp, DeviceIdentifier device, long from, long to) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceCompetitorMappingEvent(MillisecondsTimePoint.now(), author, device,
|
||||
comp, 0, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(MillisecondsTimePoint.now(), author, 0,
|
||||
comp, device, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
|
||||
}
|
||||
|
||||
protected void map(Competitor comp, DeviceIdentifier device, long from, long to) {
|
||||
@@ -75,8 +76,8 @@ public class AbstractGPSFixStoreTest {
|
||||
}
|
||||
|
||||
protected void map(Mark mark, DeviceIdentifier device, long from, long to) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceMarkMappingEvent(MillisecondsTimePoint.now(), author, device,
|
||||
mark, 0, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
|
||||
raceLog.add(new RaceLogDeviceMarkMappingEventImpl(MillisecondsTimePoint.now(), author, 0,
|
||||
mark, device, new MillisecondsTimePoint(from), new MillisecondsTimePoint(to)));
|
||||
}
|
||||
|
||||
protected void testNumberOfRawFixes(Track<?> track, long expected) {
|
||||
|
||||
+8
-9
@@ -19,7 +19,8 @@ import org.junit.rules.ExpectedException;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogRegisterCompetitorEventImpl;
|
||||
@@ -68,8 +69,6 @@ public class CreateAndTrackWithRaceLogTest {
|
||||
|
||||
private long time = 0;
|
||||
|
||||
private static final RaceLogEventFactory factory = RaceLogEventFactory.INSTANCE;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
service = new RacingEventServiceImpl(true, new MockSmartphoneImeiServiceFinderFactory());
|
||||
@@ -172,9 +171,9 @@ public class CreateAndTrackWithRaceLogTest {
|
||||
Competitor comp1 = DomainFactory.INSTANCE.getOrCreateCompetitor("comp1", "comp1", null, null, null, null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null);
|
||||
DeviceIdentifier dev1 = new SmartphoneImeiIdentifier("dev1");
|
||||
raceLog.add(factory.createDeviceCompetitorMappingEvent(t(), author, dev1, comp1, 0, t(0), t(10)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(t(), author, 0, comp1, dev1, t(0), t(10)));
|
||||
addFixes0(dev1);
|
||||
raceLog.add(factory.createRegisterCompetitorEvent(t(), author, 0, comp1));
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(t(), author, 0, comp1));
|
||||
|
||||
// start tracking
|
||||
adapter.startTracking(service, leaderboard, column, fleet);
|
||||
@@ -185,7 +184,7 @@ public class CreateAndTrackWithRaceLogTest {
|
||||
|
||||
race.waitForLoadingFromGPSFixStoreToFinishRunning(raceLog);
|
||||
addFixes1(race, comp1, dev1);
|
||||
raceLog.add(factory.createDeviceCompetitorMappingEvent(t(), author, dev1, comp1, 0, t(11), t(20)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(t(), author, 0, comp1, dev1, t(11), t(20)));
|
||||
|
||||
// add another mapping on the fly, other old fixes should be loaded
|
||||
addFixes2(race, comp1, dev1);
|
||||
@@ -207,10 +206,10 @@ public class CreateAndTrackWithRaceLogTest {
|
||||
Competitor comp1 = DomainFactory.INSTANCE.getOrCreateCompetitor("comp1", "comp1", null, null, null, null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null);
|
||||
DeviceIdentifier dev1 = new SmartphoneImeiIdentifier("dev1");
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), author, t(), UUID.randomUUID(), comp1, dev1,
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), comp1, dev1,
|
||||
t(0), t(10)));
|
||||
addFixes0(dev1);
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(t(), author, t(), UUID.randomUUID(), comp1));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(t(), t(), author, UUID.randomUUID(), comp1));
|
||||
|
||||
// start tracking
|
||||
adapter.startTracking(service, leaderboard, column, fleet);
|
||||
@@ -223,7 +222,7 @@ public class CreateAndTrackWithRaceLogTest {
|
||||
addFixes1(race, comp1, dev1);
|
||||
|
||||
// add another mapping on the fly, other old fixes should be loaded
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), author, t(), UUID.randomUUID(), comp1, dev1,
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), comp1, dev1,
|
||||
t(11), t(20)));
|
||||
addFixes2(race, comp1, dev1);
|
||||
|
||||
|
||||
+26
-21
@@ -29,13 +29,18 @@ import com.sap.sailing.domain.abstractlog.impl.AllEventsOfTypeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LastEventOfTypeFinder;
|
||||
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.analyzing.impl.LastPublishedCourseDesignFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogTrackingStateAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogRegisterCompetitorEventImpl;
|
||||
@@ -101,7 +106,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
}
|
||||
RegattaIdentifier regatta = ((RegattaLeaderboard) leaderboard).getRegatta().getRegattaIdentifier();
|
||||
if (raceLogTrackingState != RaceLogTrackingState.TRACKING) {
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createStartTrackingEvent(MillisecondsTimePoint.now(),
|
||||
RaceLogEvent event = new RaceLogStartTrackingEventImpl(MillisecondsTimePoint.now(),
|
||||
service.getServerAuthor(), raceLog.getCurrentPassId());
|
||||
raceLog.add(event);
|
||||
}
|
||||
@@ -157,7 +162,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
throw new NotDenotableForRaceLogTrackingException("Already denoted for tracking");
|
||||
}
|
||||
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createDenoteForTrackingEvent(MillisecondsTimePoint.now(),
|
||||
RaceLogEvent event = new RaceLogDenoteForTrackingEventImpl(MillisecondsTimePoint.now(),
|
||||
service.getServerAuthor(), raceLog.getCurrentPassId(), raceName, boatClass, UUID.randomUUID());
|
||||
raceLog.add(event);
|
||||
}
|
||||
@@ -225,15 +230,15 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
newCourse.addWaypoint(i++, oldWaypoint);
|
||||
}
|
||||
for (Mark mark : marks) {
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createDefineMarkEvent(now,
|
||||
service.getServerAuthor(), toRaceLog.getCurrentPassId(), mark);
|
||||
RaceLogEvent event = new RaceLogDefineMarkEventImpl(now, service.getServerAuthor(),
|
||||
toRaceLog.getCurrentPassId(), mark);
|
||||
toRaceLog.add(event);
|
||||
}
|
||||
for (RaceLogEvent raceLogDeviceMarkMappingEvent : raceLogDeviceMarkMappingEvents) {
|
||||
toRaceLog.add(raceLogDeviceMarkMappingEvent);
|
||||
}
|
||||
int passId = toRaceLog.getCurrentPassId();
|
||||
RaceLogEvent newCourseEvent = RaceLogEventFactory.INSTANCE.createCourseDesignChangedEvent(now,
|
||||
RaceLogEvent newCourseEvent = new RaceLogCourseDesignChangedEventImpl(now,
|
||||
service.getServerAuthor(), passId, newCourse);
|
||||
toRaceLog.add(newCourseEvent);
|
||||
}
|
||||
@@ -243,8 +248,7 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyCompetitors(RaceLog fromRaceLog, Set<RaceLog> toRaceLogs,
|
||||
RacingEventService service) {
|
||||
public void copyCompetitors(RaceLog fromRaceLog, Set<RaceLog> toRaceLogs, RacingEventService service) {
|
||||
final Set<Competitor> competitors = new RegisteredCompetitorsAnalyzer<>(fromRaceLog).analyze();
|
||||
for (RaceLog toRaceLog : toRaceLogs) {
|
||||
registerCompetitors(service, toRaceLog, competitors);
|
||||
@@ -271,17 +275,21 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
|
||||
@Override
|
||||
public void pingMark(RaceLog raceLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
|
||||
pingMark(raceLog, mark, gpsFix, service,
|
||||
(DeviceIdentifier dev, TimePoint timePoint) -> RaceLogEventFactory.INSTANCE
|
||||
.createDeviceMarkMappingEvent(timePoint, service.getServerAuthor(), dev, mark,
|
||||
raceLog.getCurrentPassId(), timePoint, timePoint), new PingDeviceIdentifierImpl());
|
||||
pingMark(
|
||||
raceLog,
|
||||
mark,
|
||||
gpsFix,
|
||||
service,
|
||||
(DeviceIdentifier dev, TimePoint timePoint) -> new RaceLogDeviceMarkMappingEventImpl(timePoint, service
|
||||
.getServerAuthor(), raceLog.getCurrentPassId(), mark, dev, timePoint, timePoint),
|
||||
new PingDeviceIdentifierImpl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pingMark(RegattaLog regattaLog, Mark mark, GPSFix gpsFix, RacingEventService service) {
|
||||
pingMark(regattaLog, mark, gpsFix, service,
|
||||
(DeviceIdentifier dev, TimePoint timePoint) -> new RegattaLogDeviceMarkMappingEventImpl(timePoint,
|
||||
service.getServerAuthor(), timePoint, UUID.randomUUID(), mark, dev, timePoint, timePoint),
|
||||
timePoint, service.getServerAuthor(), UUID.randomUUID(), mark, dev, timePoint, timePoint),
|
||||
new PingDeviceIdentifierImpl());
|
||||
}
|
||||
|
||||
@@ -337,19 +345,16 @@ public class RaceLogTrackingAdapterImpl implements RaceLogTrackingAdapter {
|
||||
|
||||
@Override
|
||||
public void registerCompetitors(RacingEventService service, RaceLog raceLog, Set<Competitor> competitors) {
|
||||
registerCompetitors(
|
||||
service.getServerAuthor(),
|
||||
raceLog,
|
||||
competitors,
|
||||
c -> RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(),
|
||||
service.getServerAuthor(), raceLog.getCurrentPassId(), c));
|
||||
registerCompetitors(service.getServerAuthor(), raceLog, competitors,
|
||||
c -> new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), service.getServerAuthor(),
|
||||
raceLog.getCurrentPassId(), c));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCompetitors(RacingEventService service, RegattaLog regattaLog, Set<Competitor> competitors) {
|
||||
registerCompetitors(service.getServerAuthor(), regattaLog, competitors,
|
||||
c -> new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), service.getServerAuthor(),
|
||||
MillisecondsTimePoint.now(), UUID.randomUUID(), c));
|
||||
c -> new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(),
|
||||
MillisecondsTimePoint.now(), service.getServerAuthor(), UUID.randomUUID(), c));
|
||||
}
|
||||
|
||||
private MailService getMailService() {
|
||||
|
||||
+17
-13
@@ -21,6 +21,7 @@ import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEve
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
@@ -64,16 +65,16 @@ public class DependentStartTimeFinderTest {
|
||||
@Test
|
||||
public void testDependentStartTimeUpdate() {
|
||||
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(5000);
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB, RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
|
||||
// Tests for correct behaviour, when race depending on has no start time set
|
||||
assertNull(finder.analyze().getStartTime());
|
||||
|
||||
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(6000);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA, RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogB);
|
||||
StartTimeFinderResult result = finder.analyze();
|
||||
@@ -98,7 +99,8 @@ public class DependentStartTimeFinderTest {
|
||||
assertEquals(expectedDependingOnRaces, result.getRacesDependingOn());
|
||||
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000),
|
||||
RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogB);
|
||||
result = finder.analyze();
|
||||
@@ -111,7 +113,8 @@ public class DependentStartTimeFinderTest {
|
||||
assertEquals(5000, result.getStartTimeDiff().asMillis());
|
||||
|
||||
// Test correct behaviour, when middle element changes
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(15000)));
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(15000),
|
||||
RaceLogRaceStatus.SCHEDULED));
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogA);
|
||||
result = finder.analyze();
|
||||
assertEquals(5000, result.getStartTime().asMillis());
|
||||
@@ -131,16 +134,16 @@ public class DependentStartTimeFinderTest {
|
||||
@Test
|
||||
public void testDependentStartTimeCycle() {
|
||||
final MillisecondsDurationImpl cAfterB = new MillisecondsDurationImpl(6000);
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB));
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), cAfterB, RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
final MillisecondsDurationImpl bAfterA = new MillisecondsDurationImpl(7000);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA));
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), bAfterA, RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
final MillisecondsDurationImpl aAfterC = new MillisecondsDurationImpl(8000);
|
||||
raceLogA.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("C", "", ""), aAfterC));
|
||||
raceLogA.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("C", "", ""), aAfterC, RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
// Check that all resolve to null in case of a cycle
|
||||
StartTimeFinder finder = new StartTimeFinder(raceLogResolver, raceLogC);
|
||||
@@ -157,7 +160,8 @@ public class DependentStartTimeFinderTest {
|
||||
|
||||
// Check that all resolve correctly after changing some element in cycle
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000),
|
||||
RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
// now A -> C -> B
|
||||
finder = new StartTimeFinder(raceLogResolver, raceLogA);
|
||||
|
||||
+8
-8
@@ -72,11 +72,11 @@ public class MultiLogAnalyzerTest {
|
||||
Competitor c2 = createCompetitor(2);
|
||||
Competitor c3 = createCompetitor(3);
|
||||
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), 0, c1));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), c2));
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), 0, c1));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), c2));
|
||||
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), 0, c3));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), author, now(), uuid(), c3));
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), 0, c3));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(now(), now(), author, uuid(), c3));
|
||||
|
||||
Set<Competitor> result = new MultiLogAnalyzer<>(
|
||||
RegisteredCompetitorsAnalyzer.Factory.INSTANCE, new MultiLogAnalyzer.SetReducer<Competitor>(), raceLog,
|
||||
@@ -96,12 +96,12 @@ public class MultiLogAnalyzerTest {
|
||||
DeviceIdentifier d1 = createDevice();
|
||||
DeviceIdentifier d2 = createDevice();
|
||||
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), author, now(), 0, 0, c1, d1, t(0), t(10)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), author, now(), 1, 0, c1, d2, t(30), t(40)));
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), author, now(), 2, c2, d2, t(10), t(20)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), now(), author, 0, 0, c1, d1, t(0), t(10)));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), now(), author, 1, 0, c1, d2, t(30), t(40)));
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), now(), author, 2, c2, d2, t(10), t(20)));
|
||||
|
||||
// and one for same item (competitor) in other log
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), author, now(), 3, c1, d1, t(10),
|
||||
regattaLog.add(new RegattaLogDeviceCompetitorMappingEventImpl(now(), now(), author, 3, c1, d1, t(10),
|
||||
t(20)));
|
||||
|
||||
Map<WithID, List<DeviceMapping<WithID>>> result = new MultiLogAnalyzer<>(
|
||||
|
||||
+37
-39
@@ -11,7 +11,6 @@ import org.junit.Test;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
|
||||
@@ -27,6 +26,7 @@ import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl.Racing
|
||||
import com.sap.sailing.domain.base.configuration.ConfigurationLoader;
|
||||
import com.sap.sailing.domain.base.configuration.RegattaConfiguration;
|
||||
import com.sap.sailing.domain.base.configuration.impl.EmptyRegattaConfiguration;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsDurationImpl;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
@@ -46,17 +46,15 @@ public class DependentRaceStateTest {
|
||||
private RaceStateChangedListener listenerC;
|
||||
|
||||
private AbstractLogEventAuthor author;
|
||||
private RaceLogEventFactory factory;
|
||||
private ConfigurationLoader<RegattaConfiguration> configuration;
|
||||
|
||||
private TimePoint nowMock;
|
||||
|
||||
|
||||
private RaceLogResolver raceLogResolver;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
author = new LogEventAuthorImpl("Test", 1);
|
||||
factory = RaceLogEventFactory.INSTANCE;
|
||||
configuration = new EmptyRegattaConfiguration();
|
||||
|
||||
raceLogA = new RaceLogImpl("raceLogA");
|
||||
@@ -82,12 +80,12 @@ public class DependentRaceStateTest {
|
||||
}
|
||||
};
|
||||
|
||||
stateA = new RaceStateImpl(raceLogResolver, raceLogA, author, factory, new RacingProcedureFactoryImpl(author,
|
||||
factory, configuration));
|
||||
stateB = new RaceStateImpl(raceLogResolver, raceLogB, author, factory, new RacingProcedureFactoryImpl(author,
|
||||
factory, configuration));
|
||||
stateC = new RaceStateImpl(raceLogResolver, raceLogC, author, factory, new RacingProcedureFactoryImpl(author,
|
||||
factory, configuration));
|
||||
stateA = new RaceStateImpl(raceLogResolver, raceLogA, author, new RacingProcedureFactoryImpl(author,
|
||||
configuration));
|
||||
stateB = new RaceStateImpl(raceLogResolver, raceLogB, author, new RacingProcedureFactoryImpl(author,
|
||||
configuration));
|
||||
stateC = new RaceStateImpl(raceLogResolver, raceLogC, author, new RacingProcedureFactoryImpl(author,
|
||||
configuration));
|
||||
|
||||
stateA.addChangedListener(listenerA);
|
||||
stateB.addChangedListener(listenerB);
|
||||
@@ -96,27 +94,27 @@ public class DependentRaceStateTest {
|
||||
|
||||
@Test
|
||||
public void testCorrectAmountOfStartTimeChanges() {
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000)));
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000)));
|
||||
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
|
||||
|
||||
verify(listenerC, times(3)).onStartTimeChanged(stateC);
|
||||
verify(listenerB, times(2)).onStartTimeChanged(stateB);
|
||||
verify(listenerA, times(1)).onStartTimeChanged(stateA);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
verify(listenerC, times(3)).onStartTimeChanged(stateC);
|
||||
verify(listenerB, times(2)).onStartTimeChanged(stateB);
|
||||
verify(listenerA, times(1)).onStartTimeChanged(stateA);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInitialRegistrationOfRaceState() {
|
||||
final MillisecondsDurationImpl delta = new MillisecondsDurationImpl(5000);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), delta));
|
||||
final RaceState stateB2 = new RaceStateImpl(raceLogResolver, raceLogB, author, factory,
|
||||
new RacingProcedureFactoryImpl(author, factory, configuration));
|
||||
final RaceState stateB2 = new RaceStateImpl(raceLogResolver, raceLogB, author, new RacingProcedureFactoryImpl(
|
||||
author, configuration));
|
||||
final TimePoint[] bTime = new TimePoint[1];
|
||||
stateB2.addChangedListener(new BaseRaceStateChangedListener() {
|
||||
@Override
|
||||
@@ -125,25 +123,25 @@ public class DependentRaceStateTest {
|
||||
}
|
||||
});
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, now));
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, 12, now));
|
||||
assertEquals(now.plus(delta), bTime[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCorrectAmountOfStartTimeChanges2() {
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000)));
|
||||
raceLogC.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("B", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, author, nowMock, "12", null, 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000)));
|
||||
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(5000)));
|
||||
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, author, now, "12", null, 12, new MillisecondsTimePoint(20000)));
|
||||
|
||||
verify(listenerA, times(1)).onStartTimeChanged(stateA);
|
||||
verify(listenerB, times(3)).onStartTimeChanged(stateB);
|
||||
verify(listenerC, times(4)).onStartTimeChanged(stateC);
|
||||
raceLogB.add(new RaceLogDependentStartTimeEventImpl(nowMock, nowMock, author, "12", 12,
|
||||
new SimpleRaceLogIdentifierImpl("A", "", ""), new MillisecondsDurationImpl(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
raceLogA.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(5000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
raceLogB.add(new RaceLogStartTimeEventImpl(now, now, author, "12", 12, new MillisecondsTimePoint(20000), RaceLogRaceStatus.SCHEDULED));
|
||||
|
||||
verify(listenerA, times(1)).onStartTimeChanged(stateA);
|
||||
verify(listenerB, times(3)).onStartTimeChanged(stateB);
|
||||
verify(listenerC, times(4)).onStartTimeChanged(stateC);
|
||||
}
|
||||
}
|
||||
+6
-9
@@ -19,7 +19,6 @@ import org.junit.Test;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
@@ -48,7 +47,6 @@ public class RaceStateTest {
|
||||
|
||||
private RaceLog raceLog;
|
||||
private AbstractLogEventAuthor author;
|
||||
private RaceLogEventFactory factory;
|
||||
private RacingProcedureType defaultRacingProcedureType;
|
||||
private ConfigurationLoader<RegattaConfiguration> configuration;
|
||||
private RaceStateChangedListener listener;
|
||||
@@ -60,13 +58,12 @@ public class RaceStateTest {
|
||||
public void setUp() {
|
||||
raceLog = new RaceLogImpl("test-log");
|
||||
author = new LogEventAuthorImpl("Test", 1);
|
||||
factory = RaceLogEventFactory.INSTANCE;
|
||||
defaultRacingProcedureType = RacingProcedureType.RRS26;
|
||||
configuration = new EmptyRegattaConfiguration();
|
||||
listener = mock(RaceStateChangedListener.class);
|
||||
nowMock = mock(TimePoint.class);
|
||||
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,7 +93,7 @@ public class RaceStateTest {
|
||||
config.setBasicConfiguration(mock(RacingProcedureConfiguration.class));
|
||||
configuration = mock(ConfigurationLoader.class);
|
||||
when(configuration.load()).thenReturn(config);
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
|
||||
|
||||
assertEquals(RacingProcedureType.BASIC, state.getRacingProcedure().getType());
|
||||
}
|
||||
@@ -110,8 +107,8 @@ public class RaceStateTest {
|
||||
config.setESSConfiguration(mock(ESSConfiguration.class));
|
||||
configuration = mock(ConfigurationLoader.class);
|
||||
when(configuration.load()).thenReturn(config);
|
||||
raceLog.add(new RaceLogStartProcedureChangedEventImpl(nowMock, author, nowMock, "12", null, 0, RacingProcedureType.ESS));
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, factory, new RacingProcedureFactoryImpl(author, factory, configuration));
|
||||
raceLog.add(new RaceLogStartProcedureChangedEventImpl(nowMock, nowMock, author, "12", 0, RacingProcedureType.ESS));
|
||||
state = new RaceStateImpl(mock(RaceLogResolver.class), raceLog, author, new RacingProcedureFactoryImpl(author, configuration));
|
||||
|
||||
assertEquals(RacingProcedureType.ESS, state.getRacingProcedure().getType());
|
||||
}
|
||||
@@ -136,8 +133,8 @@ public class RaceStateTest {
|
||||
@Test
|
||||
public void testSetIndividualRecall() {
|
||||
assertFalse(state.getRacingProcedure().isIndividualRecallDisplayed());
|
||||
raceLog.add(new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID
|
||||
.randomUUID(), null, /* pass */0, Flags.XRAY, Flags.NONE, /* pIsDisplayed */true));
|
||||
raceLog.add(new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID
|
||||
.randomUUID(), /* pass */0, Flags.XRAY, Flags.NONE, /* pIsDisplayed */true));
|
||||
assertTrue(state.getRacingProcedure().isIndividualRecallDisplayed());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ public class RaceLogEventImplTest {
|
||||
|
||||
public TestRaceLogEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
|
||||
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -14,10 +14,10 @@ import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogChangedListener;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogChangedVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.common.abstractlog.NotRevokableException;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
@@ -107,7 +107,7 @@ public class RaceLogRevocationTest {
|
||||
|
||||
@Test
|
||||
public void sameEventRevokedByTwoClientsBeforeSync() throws NotRevokableException {
|
||||
RaceLogDenoteForTrackingEvent event = RaceLogEventFactory.INSTANCE.createDenoteForTrackingEvent(
|
||||
RaceLogDenoteForTrackingEvent event = new RaceLogDenoteForTrackingEventImpl(
|
||||
now(), serverAuthor, 0, "race", null, null);
|
||||
serverRaceLog.add(event);
|
||||
|
||||
|
||||
+6
-6
@@ -23,12 +23,12 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
@@ -40,8 +40,8 @@ public class RaceLogTest {
|
||||
private static class MockRaceLogEventForSorting extends RaceLogEventImpl {
|
||||
public MockRaceLogEventForSorting(long createdAtMillis) {
|
||||
super(new MillisecondsTimePoint(createdAtMillis),
|
||||
/* author */ new LogEventAuthorImpl("Dummy Author", /* priority */ 0),
|
||||
MillisecondsTimePoint.now(), /* ID */ UUID.randomUUID(), /* pInvolvedBoats */ null, /* pass ID */ 1);
|
||||
MillisecondsTimePoint.now(),
|
||||
/* author */ new LogEventAuthorImpl("Dummy Author", /* priority */ 0), /* ID */ UUID.randomUUID(), /* pInvolvedBoats */ null, /* pass ID */ 1);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = 4928452859543831451L;
|
||||
@@ -433,14 +433,14 @@ public class RaceLogTest {
|
||||
UUID client1Id = UUID.randomUUID();
|
||||
UUID client2Id = UUID.randomUUID();
|
||||
final TimePoint now = MillisecondsTimePoint.now();
|
||||
RaceLogStartTimeEvent startTimeEvent1 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now, author, 1, now.plus(1));
|
||||
RaceLogStartTimeEvent startTimeEvent1 = new RaceLogStartTimeEventImpl(now, author, 1, now.plus(1));
|
||||
Iterable<RaceLogEvent> empty = raceLog.add(startTimeEvent1, client1Id);
|
||||
assertTrue(Util.isEmpty(empty));
|
||||
RaceLogStartTimeEvent startTimeEvent2 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now.plus(2), author, 1, now.plus(3));
|
||||
RaceLogStartTimeEvent startTimeEvent2 = new RaceLogStartTimeEventImpl(now.plus(2), author, 1, now.plus(3));
|
||||
Iterable<RaceLogEvent> nonEmpty = raceLog.add(startTimeEvent2, client2Id);
|
||||
assertEquals(1, Util.size(nonEmpty));
|
||||
assertSame(startTimeEvent1, nonEmpty.iterator().next());
|
||||
RaceLogStartTimeEvent startTimeEvent3 = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now.plus(4), author, 1, now.plus(5));
|
||||
RaceLogStartTimeEvent startTimeEvent3 = new RaceLogStartTimeEventImpl(now.plus(4), author, 1, now.plus(5));
|
||||
Iterable<RaceLogEvent> nonEmpty2 = raceLog.add(startTimeEvent3, client1Id);
|
||||
assertEquals(1, Util.size(nonEmpty2));
|
||||
assertSame(startTimeEvent2, nonEmpty2.iterator().next());
|
||||
|
||||
+6
-7
@@ -13,10 +13,11 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.racelog.tracking.test.mock.SmartphoneImeiIdentifier;
|
||||
import com.sap.sailing.domain.test.AbstractLeaderboardTest;
|
||||
import com.sap.sse.common.Util;
|
||||
@@ -32,14 +33,12 @@ public class SerializeRaceLogEventsTest {
|
||||
private ObjectOutputStream oos;
|
||||
private ByteArrayOutputStream bos;
|
||||
private RaceLog raceLog;
|
||||
private RaceLogEventFactory eventFactory;
|
||||
|
||||
@Before
|
||||
public void setUp() throws IOException {
|
||||
bos = new ByteArrayOutputStream();
|
||||
oos = new ObjectOutputStream(bos);
|
||||
raceLog = new RaceLogImpl("Test Race Log");
|
||||
eventFactory = RaceLogEventFactory.INSTANCE;
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -59,7 +58,7 @@ public class SerializeRaceLogEventsTest {
|
||||
|
||||
@Test
|
||||
public void testRaceLogSerializationWithSingleEvent() throws IOException, ClassNotFoundException {
|
||||
RaceLogStartTimeEvent startTimeEvent = eventFactory.createStartTimeEvent(MillisecondsTimePoint.now(),
|
||||
RaceLogStartTimeEvent startTimeEvent = new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(),
|
||||
new LogEventAuthorImpl("Author Name", /* priority */0), /* passId */1, /* startTime */
|
||||
MillisecondsTimePoint.now());
|
||||
raceLog.add(startTimeEvent);
|
||||
@@ -79,9 +78,9 @@ public class SerializeRaceLogEventsTest {
|
||||
|
||||
@Test
|
||||
public void testRaceLogSerializationWithEventContainingDeviceIdentifier() throws IOException, ClassNotFoundException {
|
||||
RaceLogDeviceCompetitorMappingEvent mappingEvent = eventFactory.createDeviceCompetitorMappingEvent(
|
||||
MillisecondsTimePoint.now(), new LogEventAuthorImpl("Author Name", /* priority */0), new SmartphoneImeiIdentifier("1948364938463903"),
|
||||
AbstractLeaderboardTest.createCompetitor("Test Competitor"), 0, new MillisecondsTimePoint(0), new MillisecondsTimePoint(10));
|
||||
RaceLogDeviceCompetitorMappingEvent mappingEvent = new RaceLogDeviceCompetitorMappingEventImpl(
|
||||
MillisecondsTimePoint.now(), new LogEventAuthorImpl("Author Name", /* priority */0), 0,
|
||||
AbstractLeaderboardTest.createCompetitor("Test Competitor"), new SmartphoneImeiIdentifier("1948364938463903"), new MillisecondsTimePoint(0), new MillisecondsTimePoint(10));
|
||||
raceLog.add(mappingEvent);
|
||||
oos.writeObject(raceLog);
|
||||
ObjectInputStream ois = getObjectInputStream();
|
||||
|
||||
-2
@@ -5,7 +5,6 @@ import org.junit.Before;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
@@ -17,7 +16,6 @@ public abstract class AbstractRaceLogTrackingTest {
|
||||
protected final AbstractLogEventAuthor author1 = new LogEventAuthorImpl("author1", 1);
|
||||
|
||||
protected final TimePoint now = MillisecondsTimePoint.now();
|
||||
protected final RaceLogEventRestoreFactory factory = RaceLogEventRestoreFactory.INSTANCE;
|
||||
|
||||
public AbstractRaceLogTrackingTest() {
|
||||
super();
|
||||
|
||||
+4
-2
@@ -12,6 +12,8 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.shared.analyzing.DeviceCompetitorMappingFinder;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorImpl;
|
||||
@@ -41,14 +43,14 @@ public class DeviceMappingFinderTest extends AbstractRaceLogTrackingTest {
|
||||
}
|
||||
|
||||
private Serializable addMapping(AbstractLogEventAuthor author, DeviceIdentifier device, Long from, Long to, Competitor item) {
|
||||
RaceLogEvent mapping = factory.createDeviceCompetitorMappingEvent(t(), author, t(), UUID.randomUUID(), device, item, 0,
|
||||
RaceLogEvent mapping = new RaceLogDeviceCompetitorMappingEventImpl(t(), t(), author, UUID.randomUUID(), 0, item, device,
|
||||
t(from), t(to));
|
||||
log.add(mapping);
|
||||
return mapping.getId();
|
||||
}
|
||||
|
||||
private void closeMapping(AbstractLogEventAuthor author, DeviceIdentifier device, Serializable mappingId, long millis) {
|
||||
RaceLogEvent mapping = factory.createCloseOpenEndedDeviceMappingEvent(t(), author, t(), UUID.randomUUID(), 0, mappingId,
|
||||
RaceLogEvent mapping = new RaceLogCloseOpenEndedDeviceMappingEventImpl(t(), t(), author, UUID.randomUUID(), 0, mappingId,
|
||||
new MillisecondsTimePoint(millis));
|
||||
log.add(mapping);
|
||||
}
|
||||
|
||||
+9
-7
@@ -8,13 +8,15 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sse.common.Util;
|
||||
|
||||
public class RevokeEventTest extends AbstractRaceLogTrackingTest {
|
||||
@Test
|
||||
public void revokedEventIsExcluded() {
|
||||
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author, now.plus(1), UUID.randomUUID(), 0, event.getId(),
|
||||
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author, UUID.randomUUID(), 0, event.getId(),
|
||||
null, null, null);
|
||||
|
||||
log.add(event);
|
||||
@@ -27,8 +29,8 @@ public class RevokeEventTest extends AbstractRaceLogTrackingTest {
|
||||
|
||||
@Test
|
||||
public void eventRevokedByAuthorWithLowerPrioIsNotExcluded() {
|
||||
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author1, now.plus(1), UUID.randomUUID(), 0, event.getId(),
|
||||
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author1, UUID.randomUUID(), 0, event.getId(),
|
||||
null, null, null);
|
||||
|
||||
log.add(event);
|
||||
@@ -41,10 +43,10 @@ public class RevokeEventTest extends AbstractRaceLogTrackingTest {
|
||||
|
||||
@Test
|
||||
public void revokingRevokeEventIsNotHarmful() {
|
||||
RaceLogEvent event = factory.createDeviceCompetitorMappingEvent(now, author, now, UUID.randomUUID(), null, null, 0, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = factory.createRevokeEvent(now.plus(1), author, now.plus(1), UUID.randomUUID(), 0, event.getId(),
|
||||
RaceLogEvent event = new RaceLogDeviceCompetitorMappingEventImpl(now, now, author, UUID.randomUUID(), 0, null, null, null, null);
|
||||
RaceLogRevokeEvent revokeEvent = new RaceLogRevokeEventImpl(now.plus(1), now.plus(1), author, UUID.randomUUID(), 0, event.getId(),
|
||||
null, null, null);
|
||||
RaceLogRevokeEvent revokeEvent2 = factory.createRevokeEvent(now.plus(2), author, now.plus(2), UUID.randomUUID(), 2, revokeEvent.getId(),
|
||||
RaceLogRevokeEvent revokeEvent2 = new RaceLogRevokeEventImpl(now.plus(2), now.plus(2), author, UUID.randomUUID(), 2, revokeEvent.getId(),
|
||||
null, null, null);
|
||||
|
||||
log.add(event);
|
||||
|
||||
+17
-1
@@ -1,10 +1,12 @@
|
||||
package com.sap.sailing.domain.abstractlog.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public abstract class AbstractLogEventImpl<VisitorT> implements AbstractLogEvent<VisitorT> {
|
||||
|
||||
@@ -15,13 +17,27 @@ public abstract class AbstractLogEventImpl<VisitorT> implements AbstractLogEvent
|
||||
private final Serializable id;
|
||||
private final AbstractLogEventAuthor author;
|
||||
|
||||
public AbstractLogEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public AbstractLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId) {
|
||||
this.createdAt = createdAt;
|
||||
this.author = author;
|
||||
this.logicalTimePoint = logicalTimePoint;
|
||||
this.id = pId;
|
||||
}
|
||||
|
||||
/**
|
||||
* To be used by constructors creating new events as the value for {@link #createdAt}.
|
||||
*/
|
||||
protected static final TimePoint now() {
|
||||
return MillisecondsTimePoint.now();
|
||||
}
|
||||
|
||||
/**
|
||||
* To be used by constructors creating new events as the value for {@link #id}.
|
||||
*/
|
||||
protected static final Serializable randId() {
|
||||
return UUID.randomUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getCreatedAt() {
|
||||
|
||||
+3
-3
@@ -18,14 +18,14 @@ public abstract class RevokeEventImpl<VisitorT> extends AbstractLogEventImpl<Vis
|
||||
private final String revokedEventShortInfo;
|
||||
|
||||
public RevokeEventImpl(AbstractLogEventAuthor author, AbstractLogEvent<?> toRevoke, String reason) {
|
||||
this(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID.randomUUID(),
|
||||
this(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID.randomUUID(),
|
||||
toRevoke.getId(), toRevoke.getClass().getName(), toRevoke.getShortInfo(), reason);
|
||||
}
|
||||
|
||||
public RevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, Serializable revokedEventId, String revokedEventType,
|
||||
String revokedEventShortInfo, String reason) {
|
||||
super(createdAt, author, logicalTimePoint, pId);
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.revokedEventId = revokedEventId;
|
||||
this.reason = reason;
|
||||
this.revokedEventType = revokedEventType;
|
||||
|
||||
-148
@@ -1,148 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.race;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventFactoryImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public interface RaceLogEventFactory {
|
||||
RaceLogEventFactory INSTANCE = new RaceLogEventFactoryImpl();
|
||||
|
||||
RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id, List<Competitor> involvedBoats,
|
||||
int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed);
|
||||
|
||||
RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Flags upperFlag,
|
||||
Flags lowerFlag, boolean isDisplayed);
|
||||
|
||||
RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, TimePoint startTime);
|
||||
|
||||
RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint startTime);
|
||||
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
|
||||
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, RaceLogRaceStatus nextStatus);
|
||||
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, int passId);
|
||||
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId);
|
||||
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
|
||||
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Serializable courseAreaId);
|
||||
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, CourseBase courseData);
|
||||
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, CourseBase courseData);
|
||||
|
||||
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors,
|
||||
int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, int passId, String pathfinderId);
|
||||
|
||||
RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, String pathfinderId);
|
||||
|
||||
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime, Long golfDownTime);
|
||||
|
||||
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Long gateLaunchStopTime, Long golfDownTime);
|
||||
|
||||
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type);
|
||||
|
||||
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, RacingProcedureType type);
|
||||
|
||||
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime);
|
||||
|
||||
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint protestStartTime);
|
||||
|
||||
RaceLogWindFixEvent createWindFixEvent(TimePoint eventTime, AbstractLogEventAuthor author, int currentPassId, Wind wind, boolean isMagnetic);
|
||||
|
||||
RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, Wind wind, boolean isMagnetic);
|
||||
|
||||
RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to);
|
||||
|
||||
RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to);
|
||||
|
||||
RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
|
||||
String raceName, BoatClass boatClass, Serializable raceId);
|
||||
|
||||
RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId);
|
||||
|
||||
RaceLogRevokeEvent createRevokeEvent(AbstractLogEventAuthor author, int passId, RaceLogEvent toRevoke, String reason);
|
||||
|
||||
RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Competitor competitor);
|
||||
|
||||
RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Mark mark);
|
||||
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
|
||||
Serializable deviceMappingEventId, TimePoint closingTimePoint);
|
||||
|
||||
RaceLogFixedMarkPassingEvent createFixedMarkPassingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, Integer passId, TimePoint ofFixedPassing, Integer zeroBasedIndexOfWaypoint);
|
||||
|
||||
RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint timePoint, Serializable id, AbstractLogEventAuthor author, int currentPassId,
|
||||
AdditionalScoringInformationType informationType);
|
||||
|
||||
RaceLogSuppressedMarkPassingsEvent createSuppressedMarkPassingsEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, Integer passId, Integer zeroBasedIndexOfFirstSuppressedWaypoint);
|
||||
|
||||
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, List<Competitor> involvedBoats, int passId, SimpleRaceLogIdentifier dependentOnRace,
|
||||
Duration startTimeDifference);
|
||||
|
||||
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference);
|
||||
|
||||
RaceLogStartOfTrackingEvent createStartOfTrackingEvent(TimePoint startOfTracking, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, Integer passId);
|
||||
|
||||
RaceLogEndOfTrackingEvent createEndOfTrackingEvent(TimePoint endOfTracking, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, Integer passId);
|
||||
|
||||
|
||||
}
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.race;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventRestoreFactoryImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public interface RaceLogEventRestoreFactory extends RaceLogEventFactory {
|
||||
RaceLogEventRestoreFactory INSTANCE = new RaceLogEventRestoreFactoryImpl();
|
||||
|
||||
RaceLogFlagEvent createFlagEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed);
|
||||
|
||||
RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime, RaceLogRaceStatus nextStatue);
|
||||
|
||||
RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus);
|
||||
|
||||
RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId);
|
||||
|
||||
RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId);
|
||||
|
||||
RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CourseBase courseData);
|
||||
|
||||
RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors,
|
||||
int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors,
|
||||
int passId, CompetitorResults positionedCompetitors);
|
||||
|
||||
RaceLogPathfinderEvent createPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, int passId, String pathfinderId);
|
||||
|
||||
RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime,
|
||||
Long golfDownTime);
|
||||
|
||||
RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type);
|
||||
|
||||
RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime);
|
||||
|
||||
RaceLogWindFixEvent createWindFixEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, Integer passId, Wind wind, boolean isMagnetic);
|
||||
|
||||
RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to);
|
||||
|
||||
RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to);
|
||||
|
||||
RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, String raceName, BoatClass boatClass, Serializable raceId);
|
||||
|
||||
RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId);
|
||||
|
||||
RaceLogRevokeEvent createRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, Serializable revokedEventId,
|
||||
String revokedEventType, String revokedEventShortInfo, String reason);
|
||||
|
||||
RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, Competitor competitor);
|
||||
|
||||
RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, Mark mark);
|
||||
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint);
|
||||
|
||||
RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, List<Competitor> competitors, int passId,
|
||||
AdditionalScoringInformationType informationType);
|
||||
|
||||
RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> involvedBoats, int passId,
|
||||
SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference, RaceLogRaceStatus nextStatus);
|
||||
}
|
||||
+1
-1
@@ -3,9 +3,9 @@ package com.sap.sailing.domain.abstractlog.race.analyzing.impl;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
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.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
+3
-3
@@ -1,13 +1,13 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
|
||||
@@ -18,8 +18,8 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
|
||||
+9
-7
@@ -1,26 +1,28 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogCourseAreaChangeEventImpl extends RaceLogEventImpl implements
|
||||
RaceLogCourseAreaChangedEvent {
|
||||
public class RaceLogCourseAreaChangeEventImpl extends RaceLogEventImpl implements RaceLogCourseAreaChangedEvent {
|
||||
private static final long serialVersionUID = -3943108136024977860L;
|
||||
|
||||
private final Serializable courseAreaId;
|
||||
|
||||
public RaceLogCourseAreaChangeEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Serializable courseAreaId) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogCourseAreaChangeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, Serializable courseAreaId) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.courseAreaId = courseAreaId;
|
||||
}
|
||||
|
||||
public RaceLogCourseAreaChangeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
Serializable courseAreaId) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getCourseAreaId() {
|
||||
return courseAreaId;
|
||||
|
||||
+10
-6
@@ -1,26 +1,30 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogCourseDesignChangedEventImpl extends RaceLogEventImpl implements RaceLogCourseDesignChangedEvent {
|
||||
private static final long serialVersionUID = 1565936170747420547L;
|
||||
|
||||
|
||||
private final CourseBase courseDesign;
|
||||
|
||||
public RaceLogCourseDesignChangedEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, CourseBase courseDesign) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogCourseDesignChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId,
|
||||
CourseBase courseDesign) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.courseDesign = courseDesign;
|
||||
}
|
||||
|
||||
public RaceLogCourseDesignChangedEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
CourseBase courseDesign) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, courseDesign);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
|
||||
+11
-7
@@ -1,32 +1,36 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.Revokable;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogDependentStartTimeEventImpl extends RaceLogRaceStatusEventImpl implements RaceLogDependentStartTimeEvent, Revokable {
|
||||
public class RaceLogDependentStartTimeEventImpl extends RaceLogRaceStatusEventImpl implements
|
||||
RaceLogDependentStartTimeEvent, Revokable {
|
||||
|
||||
private static final long serialVersionUID = -2555082771473210123L;
|
||||
private final Duration startTimeDifference;
|
||||
private SimpleRaceLogIdentifier dependentOnRace;
|
||||
|
||||
public RaceLogDependentStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, SimpleRaceLogIdentifier dependentOnRace,
|
||||
Duration startTimeDifference) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId, RaceLogRaceStatus.SCHEDULED);
|
||||
public RaceLogDependentStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, SimpleRaceLogIdentifier dependentOnRace,
|
||||
Duration startTimeDifference, RaceLogRaceStatus nextStatus) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId, nextStatus);
|
||||
this.dependentOnRace = dependentOnRace;
|
||||
this.startTimeDifference = startTimeDifference;
|
||||
}
|
||||
|
||||
public RaceLogDependentStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, dependentOnRace, startTimeDifference, RaceLogRaceStatus.SCHEDULED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Duration getStartTimeDifference() {
|
||||
return startTimeDifference;
|
||||
|
||||
+8
-7
@@ -1,31 +1,32 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogEndOfTrackingEventImpl extends RaceLogEventImpl implements RaceLogEndOfTrackingEvent {
|
||||
private static final long serialVersionUID = 3130293807404190473L;
|
||||
|
||||
public RaceLogEndOfTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint endOfTracking, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
|
||||
super(createdAt, author, endOfTracking, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogEndOfTrackingEventImpl(TimePoint createdAt, TimePoint endOfTracking, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId) {
|
||||
super(createdAt, endOfTracking, author, pId, pPassId);
|
||||
}
|
||||
|
||||
public RaceLogEndOfTrackingEventImpl(TimePoint endOfTracking, AbstractLogEventAuthor author, int pPassId) {
|
||||
super(endOfTracking, author, pPassId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return "endOfTrackingTime=" + getLogicalTimePoint();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-329
@@ -1,329 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEndOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class RaceLogEventFactoryImpl implements RaceLogEventFactory {
|
||||
|
||||
@Override
|
||||
public RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed) {
|
||||
return new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats, passId,
|
||||
upperFlag, lowerFlag, isDisplayed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFlagEvent createFlagEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Flags upperFlag,
|
||||
Flags lowerFlag, boolean isDisplayed) {
|
||||
return createFlagEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, upperFlag,
|
||||
lowerFlag, isDisplayed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime) {
|
||||
return new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats,
|
||||
passId, startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, TimePoint startTime) {
|
||||
return createStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
|
||||
return new RaceLogDependentStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, involvedBoats,
|
||||
passId, dependentOnRace, startTimeDifference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference) {
|
||||
return createDependentStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId,
|
||||
dependentOnRace, startTimeDifference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus) {
|
||||
return new RaceLogRaceStatusEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
|
||||
passId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, RaceLogRaceStatus nextStatus) {
|
||||
return createRaceStatusEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId) {
|
||||
return new RaceLogPassChangeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId) {
|
||||
return createPassChangeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId) {
|
||||
return new RaceLogCourseAreaChangeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
|
||||
passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Serializable courseAreaId) {
|
||||
return createCourseAreaChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
|
||||
passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, CourseBase courseData) {
|
||||
return new RaceLogCourseDesignChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
|
||||
passId, courseData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, CourseBase courseData) {
|
||||
return createCourseDesignChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
|
||||
passId, courseData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningListChangedEventImpl createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors,
|
||||
int passId, CompetitorResults positionedCompetitors) {
|
||||
return new RaceLogFinishPositioningListChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint,
|
||||
id, competitors, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningListChangedEventImpl createFinishPositioningListChangedEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, CompetitorResults positionedCompetitors) {
|
||||
return createFinishPositioningListChangedEvent(logicalTimePoint, author, UUID.randomUUID(),
|
||||
new ArrayList<Competitor>(), passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
|
||||
return new RaceLogFinishPositioningConfirmedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
|
||||
competitors, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, CompetitorResults positionedCompetitors) {
|
||||
return createFinishPositioningConfirmedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, String pathfinderId) {
|
||||
return new RaceLogPathfinderEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
|
||||
passId, pathfinderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, String pathfinderId) {
|
||||
return createPathfinderEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, pathfinderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime, Long golfDownTime) {
|
||||
return new RaceLogGateLineOpeningTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors,
|
||||
passId, gateLaunchStopTime, golfDownTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Long gateLaunchStopTime, Long golfDownTime) {
|
||||
return createGateLineOpeningTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
|
||||
passId, gateLaunchStopTime, golfDownTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type) {
|
||||
return new RaceLogStartProcedureChangedEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
|
||||
competitors, passId, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, RacingProcedureType type) {
|
||||
return createStartProcedureChangedEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime) {
|
||||
return new RaceLogProtestStartTimeEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id,
|
||||
competitors, passId, protestStartTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, TimePoint protestStartTime) {
|
||||
return createProtestStartTimeEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(),
|
||||
passId, protestStartTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId, Wind wind, boolean isMagnetic) {
|
||||
return createWindFixEvent(logicalTimePoint, author, UUID.randomUUID(), new ArrayList<Competitor>(), passId, wind, isMagnetic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogWindFixEvent createWindFixEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, int passId, Wind wind, boolean isMagnetic) {
|
||||
return new RaceLogWindFixEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId, wind, isMagnetic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to) {
|
||||
return new RaceLogDeviceCompetitorMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(),
|
||||
passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from, TimePoint to) {
|
||||
return new RaceLogDeviceMarkMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(),
|
||||
passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId,
|
||||
String raceName, BoatClass boatClass, Serializable raceId) {
|
||||
return new RaceLogDenoteForTrackingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, raceName,
|
||||
boatClass, raceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int passId) {
|
||||
return new RaceLogStartTrackingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRevokeEvent createRevokeEvent(AbstractLogEventAuthor author, int passId, RaceLogEvent toRevoke, String reason) {
|
||||
return new RaceLogRevokeEventImpl(author, passId, toRevoke, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Competitor competitor) {
|
||||
return new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Mark mark) {
|
||||
return new RaceLogDefineMarkEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, UUID.randomUUID(), passId, mark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
|
||||
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint,
|
||||
UUID.randomUUID(), passId, deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint timePoint, Serializable id,
|
||||
AbstractLogEventAuthor author, int currentPassId, AdditionalScoringInformationType informationType) {
|
||||
return new RaceLogAdditionalScoringInformationEventImpl(MillisecondsTimePoint.now(), author, timePoint, id,
|
||||
Collections.<Competitor> emptyList(), currentPassId, informationType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFixedMarkPassingEvent createFixedMarkPassingEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable id, List<Competitor> competitors, Integer passId, TimePoint ofFixedPassing, Integer zeroBasedIndexOfWaypoint) {
|
||||
return new RaceLogFixedMarkPassingEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId, ofFixedPassing,
|
||||
zeroBasedIndexOfWaypoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogSuppressedMarkPassingsEvent createSuppressedMarkPassingsEvent(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, Integer passId, Integer zeroBasedIndexOfFirstSuppressedWaypoint) {
|
||||
return new RaceLogSuppressedMarkPassingsEventImpl(MillisecondsTimePoint.now(), author, logicalTimePoint, id, competitors, passId,
|
||||
zeroBasedIndexOfFirstSuppressedWaypoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartOfTrackingEvent createStartOfTrackingEvent(TimePoint startOfTracking, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, Integer passId) {
|
||||
return new RaceLogStartOfTrackingEventImpl(MillisecondsTimePoint.now(), author, startOfTracking, id, competitors, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogEndOfTrackingEvent createEndOfTrackingEvent(TimePoint endOfTracking, AbstractLogEventAuthor author, Serializable id,
|
||||
List<Competitor> competitors, Integer passId) {
|
||||
return new RaceLogEndOfTrackingEventImpl(MillisecondsTimePoint.now(), author, endOfTracking, id, competitors, passId);
|
||||
}
|
||||
}
|
||||
+16
-2
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
@@ -15,11 +16,24 @@ public abstract class RaceLogEventImpl extends AbstractLogEventImpl<RaceLogEvent
|
||||
private static final long serialVersionUID = -2557594972618769182L;
|
||||
private final RaceLogEventData raceLogEventData;
|
||||
|
||||
public RaceLogEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RaceLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
|
||||
super(createdAt, author, logicalTimePoint, pId);
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(pInvolvedBoats, pPassId);
|
||||
}
|
||||
|
||||
public RaceLogEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId) {
|
||||
this(createdAt, logicalTimePoint, author, pId, Collections.<Competitor>emptyList(), pPassId);
|
||||
}
|
||||
|
||||
public RaceLogEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, Competitor competitor, int pPassId) {
|
||||
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId);
|
||||
}
|
||||
|
||||
public RaceLogEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId) {
|
||||
this(now(), logicalTimePoint, author, randId(), Collections.<Competitor>emptyList(), pPassId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Competitor> getInvolvedBoats() {
|
||||
|
||||
-201
@@ -1,201 +0,0 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogStartTrackingEventImpl;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.Duration;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogEventRestoreFactoryImpl extends RaceLogEventFactoryImpl implements RaceLogEventRestoreFactory {
|
||||
|
||||
@Override
|
||||
public RaceLogFlagEvent createFlagEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, Flags upperFlag, Flags lowerFlag, boolean isDisplayed) {
|
||||
return new RaceLogFlagEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId, upperFlag, lowerFlag, isDisplayed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTimeEvent createStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> involvedBoats, int passId, TimePoint startTime, RaceLogRaceStatus nextStatue) {
|
||||
return new RaceLogStartTimeEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId, startTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRaceStatusEvent createRaceStatusEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RaceLogRaceStatus nextStatus) {
|
||||
return new RaceLogRaceStatusEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPassChangeEvent createPassChangeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId) {
|
||||
return new RaceLogPassChangeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseAreaChangedEvent createCourseAreaChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Serializable courseAreaId) {
|
||||
return new RaceLogCourseAreaChangeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, courseAreaId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCourseDesignChangedEvent createCourseDesignChangedEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CourseBase courseData) {
|
||||
return new RaceLogCourseDesignChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, courseData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningListChangedEvent createFinishPositioningListChangedEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
|
||||
return new RaceLogFinishPositioningListChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogFinishPositioningConfirmedEvent createFinishPositioningConfirmedEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, CompetitorResults positionedCompetitors) {
|
||||
return new RaceLogFinishPositioningConfirmedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogPathfinderEvent createPathfinderEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, String pathfinderId) {
|
||||
return new RaceLogPathfinderEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, pathfinderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogGateLineOpeningTimeEvent createGateLineOpeningTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, Long gateLaunchStopTime,
|
||||
Long golfDownTime) {
|
||||
return new RaceLogGateLineOpeningTimeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, gateLaunchStopTime,
|
||||
golfDownTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartProcedureChangedEvent createStartProcedureChangedEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, RacingProcedureType type) {
|
||||
return new RaceLogStartProcedureChangedEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogProtestStartTimeEvent createProtestStartTimeEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, List<Competitor> competitors, int passId, TimePoint protestStartTime) {
|
||||
return new RaceLogProtestStartTimeEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, protestStartTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogWindFixEvent createWindFixEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable id, List<Competitor> competitors, Integer passId, Wind wind, boolean isMagnetic) {
|
||||
return new RaceLogWindFixEventImpl(createdAt, author, logicalTimePoint, id, competitors, passId, wind, isMagnetic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDeviceCompetitorMappingEvent createDeviceCompetitorMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Competitor mappedTo, int passId, TimePoint from, TimePoint to) {
|
||||
return new RaceLogDeviceCompetitorMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDeviceMarkMappingEvent createDeviceMarkMappingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, DeviceIdentifier device, Mark mappedTo, int passId, TimePoint from,
|
||||
TimePoint to) {
|
||||
return new RaceLogDeviceMarkMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDenoteForTrackingEvent createDenoteForTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int passId, String raceName, BoatClass boatClass, Serializable raceId) {
|
||||
return new RaceLogDenoteForTrackingEventImpl(createdAt, author, logicalTimePoint, pId, passId, raceName, boatClass, raceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogStartTrackingEvent createStartTrackingEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int passId) {
|
||||
return new RaceLogStartTrackingEventImpl(createdAt, author, logicalTimePoint, pId, passId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRevokeEvent createRevokeEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int passId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo, String reason) {
|
||||
return new RaceLogRevokeEventImpl(createdAt, author, logicalTimePoint, pId, passId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRegisterCompetitorEvent createRegisterCompetitorEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int passId, Competitor competitor) {
|
||||
return new RaceLogRegisterCompetitorEventImpl(createdAt, author, logicalTimePoint, pId, passId, competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDefineMarkEvent createDefineMarkEvent(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int passId, Mark mark) {
|
||||
return new RaceLogDefineMarkEventImpl(createdAt, author, logicalTimePoint, pId, passId, mark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogCloseOpenEndedDeviceMappingEvent createCloseOpenEndedDeviceMappingEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, int passId,
|
||||
Serializable deviceMappingEventId, TimePoint closingTimePoint) {
|
||||
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(createdAt, author, logicalTimePoint, pId, passId,
|
||||
deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogAdditionalScoringInformationEvent createAdditionalScoringInformationEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, List<Competitor> competitors, int passId,
|
||||
AdditionalScoringInformationType informationType) {
|
||||
return new RaceLogAdditionalScoringInformationEventImpl(createdAt, author, logicalTimePoint, pId, competitors, passId, informationType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogDependentStartTimeEvent createDependentStartTimeEvent(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable id, List<Competitor> involvedBoats,
|
||||
int passId, SimpleRaceLogIdentifier dependentOnRace, Duration startTimeDifference, RaceLogRaceStatus nextStatus) {
|
||||
return new RaceLogDependentStartTimeEventImpl(createdAt, author, logicalTimePoint, id, involvedBoats, passId,
|
||||
dependentOnRace, startTimeDifference);
|
||||
}
|
||||
}
|
||||
+13
-8
@@ -1,22 +1,27 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogFinishPositioningConfirmedEventImpl extends RaceLogFinishPositioningEventImpl implements RaceLogFinishPositioningConfirmedEvent {
|
||||
|
||||
public class RaceLogFinishPositioningConfirmedEventImpl extends RaceLogFinishPositioningEventImpl implements
|
||||
RaceLogFinishPositioningConfirmedEvent {
|
||||
|
||||
private static final long serialVersionUID = 5028181339200048499L;
|
||||
|
||||
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId, CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId, positionedCompetitors);
|
||||
|
||||
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId,
|
||||
CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId, positionedCompetitors);
|
||||
}
|
||||
|
||||
public RaceLogFinishPositioningConfirmedEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
CompetitorResults positionedCompetitors) {
|
||||
super(pTimePoint, author, pPassId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
-8
@@ -1,26 +1,30 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public abstract class RaceLogFinishPositioningEventImpl extends RaceLogEventImpl implements RaceLogFinishPositioningEvent {
|
||||
public abstract class RaceLogFinishPositioningEventImpl extends RaceLogEventImpl implements
|
||||
RaceLogFinishPositioningEvent {
|
||||
|
||||
private static final long serialVersionUID = -8168584588697908309L;
|
||||
|
||||
|
||||
private final CompetitorResults positionedCompetitors;
|
||||
|
||||
public RaceLogFinishPositioningEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogFinishPositioningEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.positionedCompetitors = positionedCompetitors;
|
||||
}
|
||||
|
||||
|
||||
public RaceLogFinishPositioningEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
CompetitorResults positionedCompetitors) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompetitorResults getPositionedCompetitorsIDsNamesMaxPointsReasons() {
|
||||
return positionedCompetitors;
|
||||
|
||||
+13
-8
@@ -1,22 +1,27 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogFinishPositioningListChangedEventImpl extends RaceLogFinishPositioningEventImpl implements RaceLogFinishPositioningListChangedEvent {
|
||||
|
||||
public class RaceLogFinishPositioningListChangedEventImpl extends RaceLogFinishPositioningEventImpl implements
|
||||
RaceLogFinishPositioningListChangedEvent {
|
||||
|
||||
private static final long serialVersionUID = -8167472925561954739L;
|
||||
|
||||
public RaceLogFinishPositioningListChangedEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> competitors, int pPassId, CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, author, pTimePoint, pId, competitors, pPassId, positionedCompetitors);
|
||||
|
||||
public RaceLogFinishPositioningListChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId,
|
||||
CompetitorResults positionedCompetitors) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId, positionedCompetitors);
|
||||
}
|
||||
|
||||
public RaceLogFinishPositioningListChangedEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
int pPassId, CompetitorResults positionedCompetitors) {
|
||||
super(pTimePoint, author, pPassId, positionedCompetitors);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+15
-7
@@ -1,28 +1,35 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFixedMarkPassingEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
|
||||
public class RaceLogFixedMarkPassingEventImpl extends RaceLogEventImpl implements RaceLogFixedMarkPassingEvent {
|
||||
|
||||
private final Integer zeroBasedIndexOfWaypointOfPassing;
|
||||
|
||||
|
||||
private final TimePoint timePointOfPassing;
|
||||
|
||||
public RaceLogFixedMarkPassingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
|
||||
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogFixedMarkPassingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId,
|
||||
TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
|
||||
this.timePointOfPassing = timePoint;
|
||||
this.zeroBasedIndexOfWaypointOfPassing = zeroBasedIndexOfWaypointOfPassing;
|
||||
}
|
||||
|
||||
public RaceLogFixedMarkPassingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Competitor competitor, int pPassId, TimePoint timePoint, Integer zeroBasedIndexOfWaypointOfPassing) {
|
||||
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId, timePoint,
|
||||
zeroBasedIndexOfWaypointOfPassing);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -1796278009919318553L;
|
||||
|
||||
@Override
|
||||
@@ -42,6 +49,7 @@ public class RaceLogFixedMarkPassingEventImpl extends RaceLogEventImpl implement
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return getInvolvedBoats().get(0).getName()+" at mark "+getZeroBasedIndexOfPassedWaypoint()+" at "+getTimePointOfFixedPassing();
|
||||
return getInvolvedBoats().get(0).getName() + " at mark " + getZeroBasedIndexOfPassedWaypoint() + " at "
|
||||
+ getTimePointOfFixedPassing();
|
||||
}
|
||||
}
|
||||
+10
-5
@@ -1,12 +1,10 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -17,13 +15,20 @@ public class RaceLogFlagEventImpl extends RaceLogEventImpl implements RaceLogFla
|
||||
private final Flags lowerFlag;
|
||||
private final boolean isDisplayed;
|
||||
|
||||
public RaceLogFlagEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Flags pUpperFlag, Flags pLowerFlag, boolean pIsDisplayed) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogFlagEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, Flags pUpperFlag, Flags pLowerFlag,
|
||||
boolean pIsDisplayed) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.upperFlag = pUpperFlag;
|
||||
this.lowerFlag = pLowerFlag;
|
||||
this.isDisplayed = pIsDisplayed;
|
||||
}
|
||||
|
||||
public RaceLogFlagEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId, Flags pUpperFlag,
|
||||
Flags pLowerFlag, boolean pIsDisplayed) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, pUpperFlag, pLowerFlag, pIsDisplayed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flags getUpperFlag() {
|
||||
return upperFlag;
|
||||
@@ -49,4 +54,4 @@ public class RaceLogFlagEventImpl extends RaceLogEventImpl implements RaceLogFla
|
||||
return "upperFlag=" + upperFlag + ", lowerFlag=" + lowerFlag + ", isDisplayed=" + isDisplayed;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+9
-6
@@ -1,26 +1,29 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogGateLineOpeningTimeEventImpl extends RaceLogEventImpl implements RaceLogGateLineOpeningTimeEvent {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 793529890804809490L;
|
||||
private final GateLineOpeningTimes gateLineOpeningTimes;
|
||||
|
||||
public RaceLogGateLineOpeningTimeEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId,
|
||||
public RaceLogGateLineOpeningTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId,
|
||||
long gateLaunchStopTime, long golfDownTime) {
|
||||
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId);
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.gateLineOpeningTimes = new GateLineOpeningTimes(gateLaunchStopTime, golfDownTime);
|
||||
}
|
||||
|
||||
public RaceLogGateLineOpeningTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
long gateLaunchStopTime, long golfDownTime) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, gateLaunchStopTime, golfDownTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.AbstractLogImpl;
|
||||
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.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.tracking.Track;
|
||||
import com.sap.sailing.domain.tracking.impl.PartialNavigableSetView;
|
||||
@@ -55,7 +54,7 @@ public class RaceLogImpl extends AbstractLogImpl<RaceLogEvent, RaceLogEventVisit
|
||||
|
||||
@Override
|
||||
protected RaceLogEvent createRevokeEvent(AbstractLogEventAuthor author, RaceLogEvent toRevoke, String reason) {
|
||||
return RaceLogEventFactory.INSTANCE.createRevokeEvent(author, getCurrentPassId(), toRevoke, reason);
|
||||
return new RaceLogRevokeEventImpl(author, getCurrentPassId(), toRevoke, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-5
@@ -1,20 +1,22 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogPassChangeEventImpl extends RaceLogEventImpl implements RaceLogPassChangeEvent {
|
||||
private static final long serialVersionUID = -3737606977320640630L;
|
||||
|
||||
public RaceLogPassChangeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogPassChangeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
}
|
||||
|
||||
public RaceLogPassChangeEventImpl(TimePoint pTimePoint, AbstractLogEventAuthor author, int pPassId) {
|
||||
super(pTimePoint, author, pPassId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-6
@@ -1,25 +1,28 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPathfinderEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogPathfinderEventImpl extends RaceLogEventImpl implements RaceLogPathfinderEvent {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -1654474931330970804L;
|
||||
private final String pathfinderId;
|
||||
|
||||
public RaceLogPathfinderEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint pTimePoint, Serializable pId, List<Competitor> pCompetitors, int pPassId, String pathfinderId) {
|
||||
super(createdAt, author, pTimePoint, pId, pCompetitors, pPassId);
|
||||
public RaceLogPathfinderEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, String pathfinderId) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.pathfinderId = pathfinderId;
|
||||
}
|
||||
|
||||
public RaceLogPathfinderEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
String pathfinderId) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, pathfinderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
|
||||
+10
-7
@@ -1,25 +1,28 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogProtestStartTimeEventImpl extends RaceLogEventImpl implements RaceLogProtestStartTimeEvent {
|
||||
private static final long serialVersionUID = -1800827552916395996L;
|
||||
|
||||
|
||||
private final TimePoint protestStartTime;
|
||||
|
||||
public RaceLogProtestStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint protestStartTime) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
|
||||
public RaceLogProtestStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, TimePoint protestStartTime) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.protestStartTime = protestStartTime;
|
||||
}
|
||||
|
||||
public RaceLogProtestStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
TimePoint protestStartTime) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, protestStartTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
|
||||
+8
-5
@@ -1,12 +1,10 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -15,12 +13,17 @@ public class RaceLogRaceStatusEventImpl extends RaceLogEventImpl implements Race
|
||||
|
||||
private final RaceLogRaceStatus nextStatus;
|
||||
|
||||
public RaceLogRaceStatusEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, RaceLogRaceStatus nextStatus) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogRaceStatusEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, RaceLogRaceStatus nextStatus) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.nextStatus = nextStatus;
|
||||
}
|
||||
|
||||
public RaceLogRaceStatusEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
RaceLogRaceStatus nextStatus) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, nextStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceLogRaceStatus getNextStatus() {
|
||||
return nextStatus;
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ public class RaceLogRevokeEventImpl extends RevokeEventImpl<RaceLogEventVisitor>
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
|
||||
}
|
||||
|
||||
public RaceLogRevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RaceLogRevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int passId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo,
|
||||
String reason) {
|
||||
super(createdAt, author, logicalTimePoint, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
super(createdAt, logicalTimePoint, author, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
|
||||
}
|
||||
|
||||
|
||||
+8
-6
@@ -1,27 +1,29 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartOfTrackingEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogStartOfTrackingEventImpl extends RaceLogEventImpl implements RaceLogStartOfTrackingEvent {
|
||||
private static final long serialVersionUID = -4134608549471817247L;
|
||||
|
||||
public RaceLogStartOfTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint startOfTracking, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId) {
|
||||
super(createdAt, author, startOfTracking, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogStartOfTrackingEventImpl(TimePoint createdAt, TimePoint startOfTracking,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId) {
|
||||
super(createdAt, startOfTracking, author, pId, pPassId);
|
||||
}
|
||||
|
||||
public RaceLogStartOfTrackingEventImpl(TimePoint startOfTracking, AbstractLogEventAuthor author, int pPassId) {
|
||||
super(startOfTracking, author, pPassId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return "startOfTrackingTime=" + getLogicalTimePoint();
|
||||
|
||||
+8
-6
@@ -1,12 +1,10 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -17,13 +15,17 @@ public class RaceLogStartProcedureChangedEventImpl extends RaceLogEventImpl impl
|
||||
|
||||
private final RacingProcedureType startProcedureType;
|
||||
|
||||
public RaceLogStartProcedureChangedEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint pTimePoint, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, RacingProcedureType startProcedureType) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
|
||||
public RaceLogStartProcedureChangedEventImpl(TimePoint createdAt, TimePoint pTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId, RacingProcedureType startProcedureType) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.startProcedureType = startProcedureType;
|
||||
}
|
||||
|
||||
public RaceLogStartProcedureChangedEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int pPassId, RacingProcedureType startProcedureType) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, startProcedureType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingProcedureType getStartProcedureType() {
|
||||
return startProcedureType;
|
||||
|
||||
+8
-5
@@ -1,12 +1,10 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -15,12 +13,17 @@ public class RaceLogStartTimeEventImpl extends RaceLogRaceStatusEventImpl implem
|
||||
private static final long serialVersionUID = 8185811395997196162L;
|
||||
private final TimePoint startTime;
|
||||
|
||||
public RaceLogStartTimeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, TimePoint pStartTime) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId, RaceLogRaceStatus.SCHEDULED);
|
||||
public RaceLogStartTimeEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, TimePoint pStartTime, RaceLogRaceStatus nextStatus) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId, nextStatus);
|
||||
this.startTime = pStartTime;
|
||||
}
|
||||
|
||||
public RaceLogStartTimeEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
TimePoint pStartTime) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, pStartTime, RaceLogRaceStatus.SCHEDULED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TimePoint getStartTime() {
|
||||
return startTime;
|
||||
|
||||
+13
-5
@@ -1,6 +1,7 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
@@ -9,17 +10,24 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogSuppressedMarkPassingsEven
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl implements RaceLogSuppressedMarkPassingsEvent {
|
||||
public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl implements
|
||||
RaceLogSuppressedMarkPassingsEvent {
|
||||
|
||||
private static final long serialVersionUID = 3665678555023150888L;
|
||||
|
||||
private final Integer indexOfFirstSuppressedWaypoint;
|
||||
|
||||
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId,
|
||||
List<Competitor> pInvolvedBoats, int pPassId, Integer indexOfFirstSuppressedWaypoint) {
|
||||
super(createdAt, author, logicalTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, List<Competitor> pInvolvedBoats, int pPassId,
|
||||
Integer indexOfFirstSuppressedWaypoint) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pInvolvedBoats, pPassId);
|
||||
this.indexOfFirstSuppressedWaypoint = indexOfFirstSuppressedWaypoint;
|
||||
}
|
||||
|
||||
public RaceLogSuppressedMarkPassingsEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Competitor competitor, int pPassId, Integer indexOfFirstSuppressedWaypoint) {
|
||||
this(now(), logicalTimePoint, author, randId(), Collections.singletonList(competitor), pPassId,
|
||||
indexOfFirstSuppressedWaypoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,6 +42,6 @@ public class RaceLogSuppressedMarkPassingsEventImpl extends RaceLogEventImpl imp
|
||||
|
||||
@Override
|
||||
public String getShortInfo() {
|
||||
return getInvolvedBoats().get(0).getName()+" at mark "+getZeroBasedIndexOfFirstSuppressedWaypoint();
|
||||
return getInvolvedBoats().get(0).getName() + " at mark " + getZeroBasedIndexOfFirstSuppressedWaypoint();
|
||||
}
|
||||
}
|
||||
+8
-5
@@ -1,12 +1,10 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.Wind;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -16,12 +14,17 @@ public class RaceLogWindFixEventImpl extends RaceLogEventImpl implements RaceLog
|
||||
private final Wind windFix;
|
||||
private final boolean isMagnetic;
|
||||
|
||||
public RaceLogWindFixEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint pTimePoint,
|
||||
Serializable pId, List<Competitor> pInvolvedBoats, int pPassId, Wind windFix, boolean isMagnetic) {
|
||||
super(createdAt, author, pTimePoint, pId, pInvolvedBoats, pPassId);
|
||||
public RaceLogWindFixEventImpl(TimePoint createdAt, TimePoint pTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, Wind windFix, boolean isMagnetic) {
|
||||
super(createdAt, pTimePoint, author, pId, pPassId);
|
||||
this.windFix = windFix;
|
||||
this.isMagnetic = isMagnetic;
|
||||
}
|
||||
|
||||
public RaceLogWindFixEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int pPassId, Wind windFix, boolean isMagnetic) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, windFix, isMagnetic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
|
||||
+8
-5
@@ -1,14 +1,12 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.scoring.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogAdditionalScoringInformationEventImpl extends RaceLogEventImpl implements RaceLogAdditionalScoringInformationEvent {
|
||||
@@ -16,11 +14,16 @@ public class RaceLogAdditionalScoringInformationEventImpl extends RaceLogEventIm
|
||||
|
||||
private final AdditionalScoringInformationType informationType;
|
||||
|
||||
public RaceLogAdditionalScoringInformationEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, List<Competitor> competitors, int pPassId, AdditionalScoringInformationType informationType) {
|
||||
super(createdAt, author, logicalTimePoint, pId, competitors, pPassId);
|
||||
public RaceLogAdditionalScoringInformationEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, AdditionalScoringInformationType informationType) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId);
|
||||
this.informationType = informationType;
|
||||
}
|
||||
|
||||
public RaceLogAdditionalScoringInformationEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int pPassId, AdditionalScoringInformationType informationType) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, informationType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
|
||||
+32
-26
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.state.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -9,14 +8,25 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.CompetitorResults;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.AdditionalScoringInformationFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.DependentStartTimeResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceStatusAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.AdditionalScoringInformationType;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.RaceLogAdditionalScoringInformationEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.scoring.impl.RaceLogAdditionalScoringInformationEventImpl;
|
||||
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.racingprocedure.RacingProcedure;
|
||||
@@ -42,7 +52,6 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
private static final Logger logger = Logger.getLogger(RaceStateImpl.class.getName());
|
||||
|
||||
private final AbstractLogEventAuthor author;
|
||||
private final RaceLogEventFactory factory;
|
||||
|
||||
public static ReadonlyRaceState create(RaceLogResolver raceLogResolver, RaceLog raceLog) {
|
||||
return create(raceLogResolver, raceLog, /* forRaceLogIdentifier */ null, Collections.<SimpleRaceLogIdentifier, ReadonlyRaceState>emptyMap());
|
||||
@@ -60,22 +69,19 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
*/
|
||||
public static RaceState create(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, ConfigurationLoader<RegattaConfiguration> configuration) {
|
||||
return new RaceStateImpl(raceLogResolver, raceLog, author,
|
||||
RaceLogEventFactory.INSTANCE,
|
||||
new RacingProcedureFactoryImpl(author, RaceLogEventFactory.INSTANCE, configuration));
|
||||
new RacingProcedureFactoryImpl(author, configuration));
|
||||
}
|
||||
|
||||
public RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory eventFactory,
|
||||
public RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RacingProcedureFactory procedureFactory) {
|
||||
this(raceLogResolver, raceLog, author, eventFactory, new RaceStatusAnalyzer.StandardClock(), procedureFactory);
|
||||
this(raceLogResolver, raceLog, author, new RaceStatusAnalyzer.StandardClock(), procedureFactory);
|
||||
}
|
||||
|
||||
private RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RaceLogEventFactory eventFactory, RaceStatusAnalyzer.Clock analyzersClock,
|
||||
private RaceStateImpl(RaceLogResolver raceLogResolver, RaceLog raceLog, AbstractLogEventAuthor author, RaceStatusAnalyzer.Clock analyzersClock,
|
||||
RacingProcedureFactory procedureFactory) {
|
||||
super(raceLogResolver, raceLog, /* forRaceLogIdentifier */ null, analyzersClock, procedureFactory,
|
||||
Collections.<SimpleRaceLogIdentifier, ReadonlyRaceState>emptyMap(), /* update */ true);
|
||||
this.author = author;
|
||||
this.factory = eventFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,7 +113,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
|
||||
@Override
|
||||
public void setRacingProcedure(TimePoint timePoint, RacingProcedureType newType) {
|
||||
raceLog.add(factory.createStartProcedureChangedEvent(timePoint, author, raceLog.getCurrentPassId(), newType));
|
||||
raceLog.add(new RaceLogStartProcedureChangedEventImpl(timePoint, author, raceLog.getCurrentPassId(), newType));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,7 +121,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
RacingProcedurePrerequisite.FulfillmentFunction function = new RacingProcedurePrerequisite.FulfillmentFunction() {
|
||||
@Override
|
||||
public void execute() {
|
||||
raceLog.add(factory.createStartTimeEvent(now, author, raceLog.getCurrentPassId(), startTime));
|
||||
raceLog.add(new RaceLogStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), startTime));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -124,12 +130,12 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
|
||||
@Override
|
||||
public void forceNewStartTime(TimePoint now, TimePoint startTime) {
|
||||
raceLog.add(factory.createStartTimeEvent(now, author, raceLog.getCurrentPassId(), startTime));
|
||||
raceLog.add(new RaceLogStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), startTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestNewDependentStartTime(final TimePoint now, final Duration startTimeDifference, final SimpleRaceLogIdentifier dependentRace, RaceLogResolver raceLogResolver, RacingProcedurePrerequisite.Resolver resolver) {
|
||||
final RaceLogDependentStartTimeEvent dependentStartTimeEvent = factory.createDependentStartTimeEvent(now, author, raceLog.getCurrentPassId(), dependentRace, startTimeDifference);
|
||||
final RaceLogDependentStartTimeEvent dependentStartTimeEvent = new RaceLogDependentStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), dependentRace, startTimeDifference);
|
||||
|
||||
RacingProcedurePrerequisite.FulfillmentFunction function = new RacingProcedurePrerequisite.FulfillmentFunction() {
|
||||
@Override
|
||||
@@ -148,60 +154,60 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
|
||||
@Override
|
||||
public void forceNewDependentStartTime(TimePoint now, final Duration startTimeDifference, final SimpleRaceLogIdentifier dependentOnRace) {
|
||||
raceLog.add(factory.createDependentStartTimeEvent(now, author, raceLog.getCurrentPassId(), dependentOnRace, startTimeDifference));
|
||||
raceLog.add(new RaceLogDependentStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), dependentOnRace, startTimeDifference));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFinishingTime(TimePoint timePoint) {
|
||||
raceLog.add(factory.createRaceStatusEvent(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHING));
|
||||
raceLog.add(new RaceLogRaceStatusEventImpl(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHING));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFinishedTime(TimePoint timePoint) {
|
||||
raceLog.add(factory.createRaceStatusEvent(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHED));
|
||||
raceLog.add(new RaceLogRaceStatusEventImpl(timePoint, author, raceLog.getCurrentPassId(), RaceLogRaceStatus.FINISHED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProtestTime(TimePoint now, TimePoint timePoint) {
|
||||
raceLog.add(factory.createProtestStartTimeEvent(now, author, raceLog.getCurrentPassId(), timePoint));
|
||||
raceLog.add(new RaceLogProtestStartTimeEventImpl(now, author, raceLog.getCurrentPassId(), timePoint));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdvancePass(TimePoint timePoint) {
|
||||
raceLog.add(factory.createPassChangeEvent(timePoint, author, raceLog.getCurrentPassId() + 1));
|
||||
raceLog.add(new RaceLogPassChangeEventImpl(timePoint, author, raceLog.getCurrentPassId() + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAborted(TimePoint timePoint, boolean isPostponed, Flags reasonFlag) {
|
||||
Flags markerFlag = isPostponed ? Flags.AP : Flags.NOVEMBER;
|
||||
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), markerFlag, reasonFlag, true));
|
||||
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), markerFlag, reasonFlag, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGeneralRecall(TimePoint timePoint) {
|
||||
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), Flags.FIRSTSUBSTITUTE, Flags.NONE, true));
|
||||
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), Flags.FIRSTSUBSTITUTE, Flags.NONE, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFinishPositioningListChanged(TimePoint timePoint, CompetitorResults positionedCompetitors) {
|
||||
raceLog.add(factory.createFinishPositioningListChangedEvent(
|
||||
raceLog.add(new RaceLogFinishPositioningListChangedEventImpl(
|
||||
timePoint, author, raceLog.getCurrentPassId(), positionedCompetitors));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFinishPositioningConfirmed(TimePoint timePoint) {
|
||||
raceLog.add(factory.createFinishPositioningConfirmedEvent(
|
||||
raceLog.add(new RaceLogFinishPositioningConfirmedEventImpl(
|
||||
timePoint, author, raceLog.getCurrentPassId(), getFinishPositioningList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCourseDesign(TimePoint timePoint, CourseBase courseDesign) {
|
||||
raceLog.add(factory.createCourseDesignChangedEvent(timePoint, author, raceLog.getCurrentPassId(), courseDesign));
|
||||
raceLog.add(new RaceLogCourseDesignChangedEventImpl(timePoint, author, raceLog.getCurrentPassId(), courseDesign));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindFix(TimePoint timePoint, Wind wind, boolean isMagnetic) {
|
||||
raceLog.add(factory.createWindFixEvent(timePoint, author, raceLog.getCurrentPassId(), wind, isMagnetic));
|
||||
raceLog.add(new RaceLogWindFixEventImpl(timePoint, author, raceLog.getCurrentPassId(), wind, isMagnetic));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,7 +215,7 @@ public class RaceStateImpl extends ReadonlyRaceStateImpl implements RaceState {
|
||||
final RaceLogAdditionalScoringInformationEvent event = new AdditionalScoringInformationFinder(raceLog).analyze(/*filterBy*/informationType);
|
||||
if (enable) {
|
||||
if (event == null) {
|
||||
raceLog.add(factory.createAdditionalScoringInformationEvent(timePoint, UUID.randomUUID(), author, raceLog.getCurrentPassId(), informationType));
|
||||
raceLog.add(new RaceLogAdditionalScoringInformationEventImpl(timePoint, author, raceLog.getCurrentPassId(), informationType));
|
||||
}
|
||||
} else {
|
||||
if (event != null) {
|
||||
|
||||
+2
-3
@@ -6,7 +6,6 @@ import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
|
||||
@@ -25,9 +24,9 @@ import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class BasicRacingProcedureImpl extends BaseRacingProcedure {
|
||||
|
||||
public BasicRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
|
||||
public BasicRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RacingProcedureConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, factory, configuration, raceLogResolver);
|
||||
super(raceLog, author, configuration, raceLogResolver);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+36
-49
@@ -6,7 +6,6 @@ import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishingTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
@@ -33,13 +32,13 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
private final static long startPhaseESSThreeUpInterval = 3 * 60 * 1000; // minutes * seconds * milliseconds
|
||||
private final static long startPhaseESSTwoUpInterval = 2 * 60 * 1000; // minutes * seconds * milliseconds
|
||||
private final static long startPhaseESSOneUpInterval = 1 * 60 * 1000; // minutes * seconds * milliseconds
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private final ESSConfiguration configuration;
|
||||
|
||||
public ESSRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RaceLogEventFactory factory, ESSConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, factory, configuration, raceLogResolver);
|
||||
|
||||
public ESSRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, ESSConfiguration configuration,
|
||||
RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, configuration, raceLogResolver);
|
||||
this.configuration = configuration;
|
||||
update();
|
||||
}
|
||||
@@ -48,7 +47,7 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
public RacingProcedureType getType() {
|
||||
return RacingProcedureType.ESS;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RacingProcedurePrerequisite checkPrerequisitesForStart(TimePoint now, TimePoint startTime,
|
||||
FulfillmentFunction function) {
|
||||
@@ -66,12 +65,11 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
|
||||
@Override
|
||||
protected Collection<RaceStateEvent> createStartStateEvents(TimePoint startTime) {
|
||||
return Arrays.<RaceStateEvent> asList(
|
||||
new RaceStateEventImpl(startTime.minus(startPhaseAPDownInterval), RaceStateEvents.ESS_AP_DOWN),
|
||||
new RaceStateEventImpl(startTime.minus(startPhaseESSThreeUpInterval), RaceStateEvents.ESS_THREE_UP),
|
||||
new RaceStateEventImpl(startTime.minus(startPhaseESSTwoUpInterval), RaceStateEvents.ESS_TWO_UP),
|
||||
new RaceStateEventImpl(startTime.minus(startPhaseESSOneUpInterval), RaceStateEvents.ESS_ONE_UP),
|
||||
new RaceStateEventImpl(startTime, RaceStateEvents.START));
|
||||
return Arrays.<RaceStateEvent> asList(new RaceStateEventImpl(startTime.minus(startPhaseAPDownInterval),
|
||||
RaceStateEvents.ESS_AP_DOWN), new RaceStateEventImpl(startTime.minus(startPhaseESSThreeUpInterval),
|
||||
RaceStateEvents.ESS_THREE_UP), new RaceStateEventImpl(startTime.minus(startPhaseESSTwoUpInterval),
|
||||
RaceStateEvents.ESS_TWO_UP), new RaceStateEventImpl(startTime.minus(startPhaseESSOneUpInterval),
|
||||
RaceStateEvents.ESS_ONE_UP), new RaceStateEventImpl(startTime, RaceStateEvents.START));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -91,62 +89,51 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
@Override
|
||||
public FlagPoleState getActiveFlags(TimePoint startTime, TimePoint now) {
|
||||
if (now.before(startTime.minus(startPhaseAPDownInterval))) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.AP, true), new FlagPole(Flags.ESSTHREE, false)), null,
|
||||
Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.AP, true), new FlagPole(Flags.ESSTHREE, false)),
|
||||
null, Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
|
||||
startTime.minus(startPhaseAPDownInterval));
|
||||
} else if (now.before(startTime.minus(startPhaseESSThreeUpInterval))) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
|
||||
startTime.minus(startPhaseAPDownInterval),
|
||||
Arrays.asList(new FlagPole(Flags.ESSTHREE, true), new FlagPole(Flags.ESSTWO, false)),
|
||||
startTime.minus(startPhaseESSThreeUpInterval));
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.AP, false), new FlagPole(Flags.ESSTHREE, false)),
|
||||
startTime.minus(startPhaseAPDownInterval), Arrays.asList(new FlagPole(Flags.ESSTHREE, true),
|
||||
new FlagPole(Flags.ESSTWO, false)), startTime.minus(startPhaseESSThreeUpInterval));
|
||||
} else if (now.before(startTime.minus(startPhaseESSTwoUpInterval))) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.ESSTHREE, true), new FlagPole(Flags.ESSTWO, false)),
|
||||
startTime.minus(startPhaseESSThreeUpInterval),
|
||||
Arrays.asList(new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.ESSTHREE, true),
|
||||
new FlagPole(Flags.ESSTWO, false)), startTime.minus(startPhaseESSThreeUpInterval), Arrays.asList(
|
||||
new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
|
||||
startTime.minus(startPhaseESSTwoUpInterval));
|
||||
} else if (now.before(startTime.minus(startPhaseESSOneUpInterval))) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.ESSTWO, true), new FlagPole(Flags.ESSONE, false)),
|
||||
startTime.minus(startPhaseESSTwoUpInterval),
|
||||
Arrays.asList(new FlagPole(Flags.ESSONE, true)),
|
||||
startTime.minus(startPhaseESSTwoUpInterval), Arrays.asList(new FlagPole(Flags.ESSONE, true)),
|
||||
startTime.minus(startPhaseESSOneUpInterval));
|
||||
} if (now.before(startTime)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.ESSONE, true)),
|
||||
startTime.minus(startPhaseESSOneUpInterval),
|
||||
Arrays.asList(new FlagPole(Flags.ESSONE, false)),
|
||||
}
|
||||
if (now.before(startTime)) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.ESSONE, true)),
|
||||
startTime.minus(startPhaseESSOneUpInterval), Arrays.asList(new FlagPole(Flags.ESSONE, false)),
|
||||
startTime);
|
||||
} else {
|
||||
if (isIndividualRecallDisplayed(now)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.XRAY, true)),
|
||||
getIndividualRecallDisplayedTime(),
|
||||
Arrays.asList(new FlagPole(Flags.XRAY, false)),
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.XRAY, true)),
|
||||
getIndividualRecallDisplayedTime(), Arrays.asList(new FlagPole(Flags.XRAY, false)),
|
||||
getIndividualRecallRemovalTime());
|
||||
} else if (isFinished(now)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
|
||||
} else if (isInFinishingPhase(now)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, true)),
|
||||
getFinishingTime(),
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)),
|
||||
null);
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, true)), getFinishingTime(),
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)), null);
|
||||
} else {
|
||||
TimePoint recallRemoved = getIndividualRecallRemovalTime();
|
||||
return new FlagPoleState(Collections.<FlagPole>emptyList(), recallRemoved == null ? startTime : recallRemoved);
|
||||
return new FlagPoleState(Collections.<FlagPole> emptyList(), recallRemoved == null ? startTime
|
||||
: recallRemoved);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected RacingProcedureChangedListeners<? extends RacingProcedureChangedListener> createChangedListenerContainer() {
|
||||
return new ESSChangedListeners();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ESSChangedListeners getChangedListeners() {
|
||||
return (ESSChangedListeners) super.getChangedListeners();
|
||||
@@ -156,7 +143,7 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
public void addChangedListener(ESSChangedListener listener) {
|
||||
getChangedListeners().add(listener);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TimePoint getTimeLimit(TimePoint startTime) {
|
||||
TimePoint firstBoatTime = new FinishingTimeFinder(raceLog).analyze();
|
||||
@@ -165,12 +152,12 @@ public class ESSRacingProcedureImpl extends BaseRacingProcedure implements ESSRa
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean hasIndividualRecallByDefault() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ESSConfiguration getConfiguration() {
|
||||
return (ESSConfiguration) super.getConfiguration();
|
||||
|
||||
+24
-26
@@ -5,11 +5,12 @@ import java.util.Collection;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogGateLineOpeningTimeEvent.GateLineOpeningTimes;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.GateLineOpeningTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.PathfinderFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
|
||||
@@ -43,14 +44,15 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
private boolean gateLineOpeningTimesHasBeenSet;
|
||||
private String cachedPathfinder;
|
||||
|
||||
public GateStartRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
|
||||
public GateStartRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
GateStartConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, factory, configuration, raceLogResolver);
|
||||
super(raceLog, author, configuration, raceLogResolver);
|
||||
this.gateLineOpeningTimeAnalyzer = new GateLineOpeningTimeFinder(raceLog);
|
||||
this.pathfinderAnalyzer = new PathfinderFinder(raceLog);
|
||||
|
||||
long defaultGolfDownTime = getDefaultGolfDownTime();
|
||||
this.cachedGateLineOpeningTimes = new GateLineOpeningTimes(GateStartRacingProcedure.DefaultGateLaunchStopTime, defaultGolfDownTime);
|
||||
this.cachedGateLineOpeningTimes = new GateLineOpeningTimes(GateStartRacingProcedure.DefaultGateLaunchStopTime,
|
||||
defaultGolfDownTime);
|
||||
this.gateLineOpeningTimesHasBeenSet = false;
|
||||
|
||||
update();
|
||||
@@ -78,7 +80,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
public RacingProcedurePrerequisite checkPrerequisitesForStart(TimePoint now, TimePoint startTime,
|
||||
FulfillmentFunction function) {
|
||||
if (startTime.before(now)) {
|
||||
if (getConfiguration().hasPathfinder() != null && getConfiguration().hasPathfinder() && getPathfinder() == null) {
|
||||
if (getConfiguration().hasPathfinder() != null && getConfiguration().hasPathfinder()
|
||||
&& getPathfinder() == null) {
|
||||
return new PathfinderPrerequisite(function, this, now, startTime);
|
||||
} else if (!gateLineOpeningTimesHasBeenSet) {
|
||||
return new GateLaunchTimePrerequisite(function, this, now, startTime, getDefaultGolfDownTime());
|
||||
@@ -125,8 +128,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
switch (event.getEventName()) {
|
||||
case START:
|
||||
if (!gateLineOpeningTimesHasBeenSet) {
|
||||
setGateLineOpeningTimes(event.getTimePoint(),
|
||||
cachedGateLineOpeningTimes.getGateLaunchStopTime(), cachedGateLineOpeningTimes.getGolfDownTime());
|
||||
setGateLineOpeningTimes(event.getTimePoint(), cachedGateLineOpeningTimes.getGateLaunchStopTime(),
|
||||
cachedGateLineOpeningTimes.getGolfDownTime());
|
||||
}
|
||||
rescheduleGateShutdownTime(event.getTimePoint());
|
||||
return true;
|
||||
@@ -147,35 +150,29 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
TimePoint gateShutdownTime = getGateShutdownTimePoint(startTime);
|
||||
if (now.before(startTime.minus(startPhaseClassOverGolfUpIntervall))) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, false), new FlagPole(Flags.PAPA,
|
||||
false)), null, Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, false)),
|
||||
startTime.minus(startPhaseClassOverGolfUpIntervall));
|
||||
false)), null, Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
|
||||
false)), startTime.minus(startPhaseClassOverGolfUpIntervall));
|
||||
} else if (now.before(startTime.minus(startPhasePapaUpInterval))) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
|
||||
false)), startTime.minus(startPhaseClassOverGolfUpIntervall),
|
||||
Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, true)),
|
||||
startTime.minus(startPhasePapaUpInterval));
|
||||
false)), startTime.minus(startPhaseClassOverGolfUpIntervall), Arrays.asList(new FlagPole(classFlag,
|
||||
Flags.GOLF, true), new FlagPole(Flags.PAPA, true)), startTime.minus(startPhasePapaUpInterval));
|
||||
} else if (now.before(startTime.minus(startPhasePapaDownInterval))) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
|
||||
true)), startTime.minus(startPhasePapaUpInterval),
|
||||
Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA, false)),
|
||||
startTime.minus(startPhasePapaDownInterval));
|
||||
true)), startTime.minus(startPhasePapaUpInterval), Arrays.asList(new FlagPole(classFlag,
|
||||
Flags.GOLF, true), new FlagPole(Flags.PAPA, false)), startTime.minus(startPhasePapaDownInterval));
|
||||
} else if (now.before(startTime)) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(classFlag, Flags.GOLF, true), new FlagPole(Flags.PAPA,
|
||||
false)), startTime.minus(startPhasePapaDownInterval),
|
||||
Arrays.asList(new FlagPole(classFlag, false), new FlagPole(Flags.GOLF, true)), startTime);
|
||||
false)), startTime.minus(startPhasePapaDownInterval), Arrays.asList(new FlagPole(classFlag, false),
|
||||
new FlagPole(Flags.GOLF, true)), startTime);
|
||||
} else if (now.before(gateShutdownTime)) {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.GOLF, true)), startTime,
|
||||
Arrays.asList(new FlagPole(Flags.GOLF, false)), gateShutdownTime);
|
||||
} else {
|
||||
if (isFinished(now)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, false)), getFinishedTime());
|
||||
} else if (isInFinishingPhase(now)) {
|
||||
return new FlagPoleState(
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, true)),
|
||||
getFinishingTime(),
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)),
|
||||
null);
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.BLUE, true)), getFinishingTime(),
|
||||
Arrays.asList(new FlagPole(Flags.BLUE, false)), null);
|
||||
} else {
|
||||
return new FlagPoleState(Arrays.asList(new FlagPole(Flags.GOLF, false)), gateShutdownTime);
|
||||
}
|
||||
@@ -204,7 +201,8 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
|
||||
@Override
|
||||
public void setGateLineOpeningTimes(TimePoint now, long gateLaunchStopTime, long golfDownTime) {
|
||||
raceLog.add(factory.createGateLineOpeningTimeEvent(now, author, raceLog.getCurrentPassId(), gateLaunchStopTime, golfDownTime));
|
||||
raceLog.add(new RaceLogGateLineOpeningTimeEventImpl(now, author, raceLog.getCurrentPassId(), gateLaunchStopTime,
|
||||
golfDownTime));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -214,7 +212,7 @@ public class GateStartRacingProcedureImpl extends BaseRacingProcedure implements
|
||||
|
||||
@Override
|
||||
public void setPathfinder(TimePoint timePoint, String sailingId) {
|
||||
raceLog.add(factory.createPathfinderEvent(timePoint, author, raceLog.getCurrentPassId(), sailingId));
|
||||
raceLog.add(new RaceLogPathfinderEventImpl(timePoint, author, raceLog.getCurrentPassId(), sailingId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+28
-26
@@ -8,7 +8,6 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogChangedListener;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishedTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.FinishingTimeFinder;
|
||||
@@ -19,6 +18,7 @@ import com.sap.sailing.domain.abstractlog.race.analyzing.impl.IsInFinishingPhase
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.IsIndividualRecallDisplayedAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.StartTimeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.WeakRaceLogChangedVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEventScheduler;
|
||||
@@ -52,7 +52,6 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
|
||||
protected final RaceLog raceLog;
|
||||
protected final AbstractLogEventAuthor author;
|
||||
protected final RaceLogEventFactory factory;
|
||||
private final RacingProcedureConfiguration configuration;
|
||||
|
||||
private final RacingProcedureChangedListeners<? extends RacingProcedureChangedListener> changedListeners;
|
||||
@@ -66,7 +65,6 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
|
||||
private boolean cachedIsIndividualRecallDisplayed;
|
||||
|
||||
|
||||
/**
|
||||
* When calling me, call {@link BaseRacingProcedure#update()} afterwards!
|
||||
*
|
||||
@@ -74,14 +72,13 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
* is required for a {@link StartTimeFinder} in order to make individual recall timeouts depend on start
|
||||
* time rather than the time the individual recall was issued
|
||||
*/
|
||||
public BaseRacingProcedure(RaceLog raceLog, AbstractLogEventAuthor author, RaceLogEventFactory factory,
|
||||
public BaseRacingProcedure(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RacingProcedureConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
if (configuration == null) {
|
||||
throw new IllegalArgumentException("configuration must not be null");
|
||||
}
|
||||
this.raceLog = raceLog;
|
||||
this.author = author;
|
||||
this.factory = factory;
|
||||
this.configuration = configuration;
|
||||
this.changedListeners = createChangedListenerContainer();
|
||||
this.isRecallDisplayedAnalyzer = new IsIndividualRecallDisplayedAnalyzer(raceLog);
|
||||
@@ -94,18 +91,18 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
this.raceLog.addListener(this.raceLogListener);
|
||||
this.cachedIsIndividualRecallDisplayed = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void detach() {
|
||||
raceLog.removeListener(raceLogListener);
|
||||
changedListeners.removeAll();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addChangedListener(RacingProcedureChangedListener listener) {
|
||||
changedListeners.addBaseListener(listener);
|
||||
}
|
||||
|
||||
|
||||
public void removeChangedListener(RacingProcedureChangedListener listener) {
|
||||
changedListeners.remove(listener);
|
||||
};
|
||||
@@ -155,7 +152,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TimePoint getIndividualRecallDisplayedTime() {
|
||||
if (hasIndividualRecall()) {
|
||||
@@ -163,7 +160,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TimePoint getIndividualRecallRemovalTime() {
|
||||
TimePoint displayed = getIndividualRecallDisplayedTime();
|
||||
@@ -179,8 +176,11 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
if (raceStartTime != null) {
|
||||
referenceTimePoint = raceStartTime;
|
||||
} else {
|
||||
logger.warning("An individual recall was set but we don't have a start time set for the race; using individual recall set time "+
|
||||
displayed+" + timeout ("+individualRecallRemovalTimeout+") for implicit termination of individual recall");
|
||||
logger.warning("An individual recall was set but we don't have a start time set for the race; using individual recall set time "
|
||||
+ displayed
|
||||
+ " + timeout ("
|
||||
+ individualRecallRemovalTimeout
|
||||
+ ") for implicit termination of individual recall");
|
||||
referenceTimePoint = displayed;
|
||||
}
|
||||
return referenceTimePoint.plus(individualRecallRemovalTimeout);
|
||||
@@ -190,12 +190,14 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
|
||||
@Override
|
||||
public void displayIndividualRecall(TimePoint displayTime) {
|
||||
raceLog.add(factory.createFlagEvent(displayTime, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE, true));
|
||||
raceLog.add(new RaceLogFlagEventImpl(displayTime, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE,
|
||||
true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeIndividualRecall(TimePoint timePoint) {
|
||||
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE, false));
|
||||
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), Flags.XRAY, Flags.NONE,
|
||||
false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,11 +210,11 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasIndividualRecall() {
|
||||
return configuration.hasInidividualRecall() == null ?
|
||||
hasIndividualRecallByDefault() : configuration.hasInidividualRecall();
|
||||
return configuration.hasInidividualRecall() == null ? hasIndividualRecallByDefault() : configuration
|
||||
.hasInidividualRecall();
|
||||
}
|
||||
|
||||
protected abstract boolean hasIndividualRecallByDefault();
|
||||
@@ -244,23 +246,23 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
unscheduleStateEvent(RaceStateEvents.INDIVIDUAL_RECALL_TIMEOUT);
|
||||
scheduleStateEvents(new RaceStateEventImpl(removalTime, RaceStateEvents.INDIVIDUAL_RECALL_TIMEOUT));
|
||||
}
|
||||
|
||||
|
||||
protected void scheduleStateEvents(RaceStateEvent stateEvent) {
|
||||
scheduleStateEvents(Arrays.asList(stateEvent));
|
||||
}
|
||||
|
||||
|
||||
protected void scheduleStateEvents(Collection<RaceStateEvent> stateEvents) {
|
||||
if (scheduler != null) {
|
||||
scheduler.scheduleStateEvents(stateEvents);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void unscheduleStateEvent(RaceStateEvents raceStateEventName) {
|
||||
if (scheduler != null) {
|
||||
scheduler.unscheduleStateEvent(raceStateEventName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RacingProcedureConfiguration getConfiguration() {
|
||||
return configuration;
|
||||
@@ -276,7 +278,7 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
scheduler.scheduleStateEvents(createStartStateEvents(state.getStartTime()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAdvancePass(ReadonlyRaceState state) {
|
||||
unscheduleAllEvents();
|
||||
@@ -288,21 +290,21 @@ public abstract class BaseRacingProcedure extends BaseRaceStateChangedListener i
|
||||
scheduler.unscheduleAllEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected boolean isFinished(TimePoint at) {
|
||||
IsFinishedAnalyzer analyzer = new IsFinishedAnalyzer(raceLog, finishedTimeFinder, at);
|
||||
return analyzer.analyze();
|
||||
}
|
||||
|
||||
|
||||
protected boolean isInFinishingPhase(TimePoint at) {
|
||||
IsInFinishingPhaseAnalyzer analyzer = new IsInFinishingPhaseAnalyzer(raceLog, finishingTimeFinder, at);
|
||||
return analyzer.analyze();
|
||||
}
|
||||
|
||||
|
||||
protected TimePoint getFinishingTime() {
|
||||
return finishingTimeFinder.analyze();
|
||||
}
|
||||
|
||||
|
||||
protected TimePoint getFinishedTime() {
|
||||
return finishedTimeFinder.analyze();
|
||||
}
|
||||
|
||||
+2
-5
@@ -2,7 +2,6 @@ package com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedureFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.ReadonlyRacingProcedure;
|
||||
@@ -13,17 +12,15 @@ import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
public class RacingProcedureFactoryImpl extends ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
|
||||
|
||||
private final AbstractLogEventAuthor author;
|
||||
private final RaceLogEventFactory factory;
|
||||
|
||||
public RacingProcedureFactoryImpl(AbstractLogEventAuthor author, RaceLogEventFactory factory,
|
||||
public RacingProcedureFactoryImpl(AbstractLogEventAuthor author,
|
||||
ConfigurationLoader<RegattaConfiguration> configuration) {
|
||||
super(configuration);
|
||||
this.author = author;
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReadonlyRacingProcedure createRacingProcedure(RacingProcedureType type, RaceLog raceLog, RaceLogResolver raceLogResolver) {
|
||||
return createProcedure(type, raceLog, author, factory, raceLogResolver);
|
||||
return createProcedure(type, raceLog, author, raceLogResolver);
|
||||
}
|
||||
}
|
||||
+7
-8
@@ -3,7 +3,6 @@ package com.sap.sailing.domain.abstractlog.race.state.racingprocedure.impl;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.NoAddingRaceLogWrapper;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.RacingProcedure;
|
||||
@@ -38,20 +37,20 @@ public class ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
|
||||
}
|
||||
|
||||
protected ReadonlyRacingProcedure createProcedure(RacingProcedureType type, RaceLog raceLog,
|
||||
AbstractLogEventAuthor author, RaceLogEventFactory factory, RaceLogResolver raceLogResolver) {
|
||||
AbstractLogEventAuthor author, RaceLogResolver raceLogResolver) {
|
||||
RegattaConfiguration loadedConfiguration = configuration.load();
|
||||
switch (type) {
|
||||
case ESS:
|
||||
return new ESSRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getESSConfiguration(), raceLogResolver);
|
||||
return new ESSRacingProcedureImpl(raceLog, author, loadedConfiguration.getESSConfiguration(), raceLogResolver);
|
||||
case GateStart:
|
||||
return new GateStartRacingProcedureImpl(raceLog, author, factory,
|
||||
return new GateStartRacingProcedureImpl(raceLog, author,
|
||||
loadedConfiguration.getGateStartConfiguration(), raceLogResolver);
|
||||
case RRS26:
|
||||
return new RRS26RacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getRRS26Configuration(), raceLogResolver);
|
||||
return new RRS26RacingProcedureImpl(raceLog, author, loadedConfiguration.getRRS26Configuration(), raceLogResolver);
|
||||
case BASIC:
|
||||
return new BasicRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getBasicConfiguration(), raceLogResolver);
|
||||
return new BasicRacingProcedureImpl(raceLog, author, loadedConfiguration.getBasicConfiguration(), raceLogResolver);
|
||||
case LEAGUE:
|
||||
return new LeagueRacingProcedureImpl(raceLog, author, factory, loadedConfiguration.getLeagueConfiguration(), raceLogResolver);
|
||||
return new LeagueRacingProcedureImpl(raceLog, author, loadedConfiguration.getLeagueConfiguration(), raceLogResolver);
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unknown racing procedure " + type.toString());
|
||||
}
|
||||
@@ -63,7 +62,7 @@ public class ReadonlyRacingProcedureFactory implements RacingProcedureFactory {
|
||||
AbstractLogEventAuthor author = new LogEventAuthorImpl("Illegal Author", 128);
|
||||
// Wrap the racelog to disable adding...
|
||||
RaceLog wrappedRaceLog = new NoAddingRaceLogWrapper(raceLog);
|
||||
return createProcedure(type, wrappedRaceLog, author, RaceLogEventFactory.INSTANCE, raceLogResolver);
|
||||
return createProcedure(type, wrappedRaceLog, author, raceLogResolver);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-3
@@ -6,7 +6,6 @@ import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
|
||||
@@ -34,8 +33,8 @@ public class LeagueRacingProcedureImpl extends BaseRacingProcedure implements Le
|
||||
private final static Flags startmodeFlag = Flags.PAPA;
|
||||
|
||||
public LeagueRacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RaceLogEventFactory factory, LeagueConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, factory, configuration, raceLogResolver);
|
||||
LeagueConfiguration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, configuration, raceLogResolver);
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -6,10 +6,10 @@ import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RRS26StartModeFlagFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RaceLogResolver;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.RacingProcedureTypeAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.RaceStateEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.RaceStateEvents;
|
||||
@@ -40,8 +40,8 @@ public class RRS26RacingProcedureImpl extends BaseRacingProcedure implements RRS
|
||||
private boolean startmodeFlagHasBeenSet;
|
||||
|
||||
public RRS26RacingProcedureImpl(RaceLog raceLog, AbstractLogEventAuthor author,
|
||||
RaceLogEventFactory factory, RRS26Configuration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, factory, configuration, raceLogResolver);
|
||||
RRS26Configuration configuration, RaceLogResolver raceLogResolver) {
|
||||
super(raceLog, author, configuration, raceLogResolver);
|
||||
|
||||
RacingProcedureTypeAnalyzer procedureAnalyzer = new RacingProcedureTypeAnalyzer(raceLog);
|
||||
if (configuration.getStartModeFlags() != null) {
|
||||
@@ -189,7 +189,7 @@ public class RRS26RacingProcedureImpl extends BaseRacingProcedure implements RRS
|
||||
|
||||
@Override
|
||||
public void setStartModeFlag(TimePoint timePoint, Flags startMode) {
|
||||
raceLog.add(factory.createFlagEvent(timePoint, author, raceLog.getCurrentPassId(), startMode, Flags.NONE, true));
|
||||
raceLog.add(new RaceLogFlagEventImpl(timePoint, author, raceLog.getCurrentPassId(), startMode, Flags.NONE, true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@ import java.io.Serializable;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
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.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.shared.analyzing.OpenEndedDeviceMappingCloser;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceMapping;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
@@ -23,7 +23,7 @@ public class RaceLogOpenEndedDeviceMappingCloser extends
|
||||
@Override
|
||||
protected RaceLogCloseOpenEndedDeviceMappingEvent createCloseEvent(TimePoint logicalTimePoint,
|
||||
Serializable eventToCloseId) {
|
||||
return RaceLogEventFactory.INSTANCE.createCloseOpenEndedDeviceMappingEvent(
|
||||
return new RaceLogCloseOpenEndedDeviceMappingEventImpl(
|
||||
logicalTimePoint, author, getLog().getCurrentPassId(), eventToCloseId, closingTimePoint);
|
||||
}
|
||||
|
||||
|
||||
+9
-3
@@ -19,13 +19,19 @@ extends AbstractDeviceMappingEventImpl<RaceLogEventVisitor, ItemT> implements Ra
|
||||
private static final long serialVersionUID = -5114645637316367845L;
|
||||
private final RaceLogEventData raceLogEventData;
|
||||
|
||||
public AbstractRaceLogDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, int passId, ItemT mappedTo, DeviceIdentifier device,
|
||||
public AbstractRaceLogDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, int passId, ItemT mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, id, mappedTo, device, from, to);
|
||||
super(createdAt, logicalTimePoint, author, id, mappedTo, device, from, to);
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
|
||||
}
|
||||
|
||||
public AbstractRaceLogDeviceMappingEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, ItemT mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
this(now(), logicalTimePoint, author, randId(), passId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPassId() {
|
||||
return raceLogEventData.getPassId();
|
||||
|
||||
+13
-7
@@ -12,18 +12,24 @@ import com.sap.sailing.domain.abstractlog.shared.events.impl.BaseCloseOpenEndedD
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogCloseOpenEndedDeviceMappingEventImpl extends BaseCloseOpenEndedDeviceMappingEventImpl<RaceLogEventVisitor>
|
||||
implements RaceLogCloseOpenEndedDeviceMappingEvent {
|
||||
public class RaceLogCloseOpenEndedDeviceMappingEventImpl extends
|
||||
BaseCloseOpenEndedDeviceMappingEventImpl<RaceLogEventVisitor> implements
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent {
|
||||
private static final long serialVersionUID = -5114645637316367845L;
|
||||
private final RaceLogEventData raceLogEventData;
|
||||
|
||||
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, int passId, Serializable deviceMappingEventId,
|
||||
|
||||
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, int passId, Serializable deviceMappingEventId,
|
||||
TimePoint closingTimePoint) {
|
||||
super(createdAt, author, logicalTimePoint, id, deviceMappingEventId, closingTimePoint);
|
||||
super(createdAt, logicalTimePoint, author, id, deviceMappingEventId, closingTimePoint);
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
|
||||
}
|
||||
|
||||
|
||||
public RaceLogCloseOpenEndedDeviceMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int passId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
|
||||
this(now(), logicalTimePoint, author, randId(), passId, deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPassId() {
|
||||
return raceLogEventData.getPassId();
|
||||
|
||||
+7
-4
@@ -1,13 +1,11 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
@@ -16,11 +14,16 @@ public class RaceLogDefineMarkEventImpl extends RaceLogEventImpl implements Race
|
||||
|
||||
private final Mark mark;
|
||||
|
||||
public RaceLogDefineMarkEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RaceLogDefineMarkEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, int pPassId, Mark mark) {
|
||||
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId);
|
||||
this.mark = mark;
|
||||
}
|
||||
|
||||
public RaceLogDefineMarkEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int pPassId, Mark mark) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, mark);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
|
||||
+11
-10
@@ -1,34 +1,35 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogDenoteForTrackingEventImpl extends RaceLogEventImpl implements
|
||||
RaceLogDenoteForTrackingEvent {
|
||||
public class RaceLogDenoteForTrackingEventImpl extends RaceLogEventImpl implements RaceLogDenoteForTrackingEvent {
|
||||
private static final long serialVersionUID = 6937741283401976385L;
|
||||
|
||||
private final String raceName;
|
||||
private final BoatClass boatClass;
|
||||
private final Serializable raceId;
|
||||
|
||||
public RaceLogDenoteForTrackingEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int pPassId,
|
||||
String raceName, BoatClass boatClass, Serializable raceId) {
|
||||
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
|
||||
public RaceLogDenoteForTrackingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId, String raceName,
|
||||
BoatClass boatClass, Serializable raceId) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId);
|
||||
this.raceName = raceName;
|
||||
this.boatClass = boatClass;
|
||||
this.raceId = raceId;
|
||||
}
|
||||
|
||||
public RaceLogDenoteForTrackingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
String raceName, BoatClass boatClass, Serializable raceId) {
|
||||
this(now(), logicalTimePoint, author, randId(), pPassId, raceName, boatClass, raceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accept(RaceLogEventVisitor visitor) {
|
||||
visitor.visit(this);
|
||||
@@ -43,7 +44,7 @@ RaceLogDenoteForTrackingEvent {
|
||||
public BoatClass getBoatClass() {
|
||||
return boatClass;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Serializable getRaceId() {
|
||||
return raceId;
|
||||
|
||||
+10
-4
@@ -10,10 +10,16 @@ import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogDeviceCompetitorMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Competitor>
|
||||
implements RaceLogDeviceCompetitorMappingEvent {
|
||||
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int pPassId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, pId, pPassId, mappedTo, device, from, to);
|
||||
implements RaceLogDeviceCompetitorMappingEvent {
|
||||
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId, Competitor mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
public RaceLogDeviceCompetitorMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
int pPassId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(logicalTimePoint, author, pPassId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -1494030544804758753L;
|
||||
|
||||
+11
-5
@@ -9,13 +9,19 @@ import com.sap.sailing.domain.base.Mark;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogDeviceMarkMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Mark>
|
||||
implements RaceLogDeviceMarkMappingEvent {
|
||||
public class RaceLogDeviceMarkMappingEventImpl extends AbstractRaceLogDeviceMappingEventImpl<Mark> implements
|
||||
RaceLogDeviceMarkMappingEvent {
|
||||
private static final long serialVersionUID = -7223543830755457196L;
|
||||
|
||||
public RaceLogDeviceMarkMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, int pPassId, Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, pId, pPassId, mappedTo, device, from, to);
|
||||
public RaceLogDeviceMarkMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId, Mark mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
public RaceLogDeviceMarkMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author, int pPassId,
|
||||
Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(logicalTimePoint, author, pPassId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+13
-3
@@ -22,13 +22,23 @@ public class RaceLogRegisterCompetitorEventImpl extends BaseRegisterCompetitorEv
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public RaceLogRegisterCompetitorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, int passId, Competitor competitor)
|
||||
public RaceLogRegisterCompetitorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, int passId, Competitor competitor)
|
||||
throws IllegalArgumentException {
|
||||
super(createdAt, author, logicalTimePoint, id, competitor);
|
||||
super(createdAt, logicalTimePoint, author, id, competitor);
|
||||
this.raceLogEventData = new RaceLogEventDataImpl(null, passId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public RaceLogRegisterCompetitorEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int passId, Competitor competitor)
|
||||
throws IllegalArgumentException {
|
||||
this(now(), logicalTimePoint, author, randId(), passId, competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPassId() {
|
||||
return raceLogEventData.getPassId();
|
||||
|
||||
+8
-5
@@ -1,22 +1,25 @@
|
||||
package com.sap.sailing.domain.abstractlog.race.tracking.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventVisitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogStartTrackingEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RaceLogStartTrackingEventImpl extends RaceLogEventImpl implements
|
||||
RaceLogStartTrackingEvent {
|
||||
private static final long serialVersionUID = 6017954368580125221L;
|
||||
|
||||
public RaceLogStartTrackingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, int pPassId) {
|
||||
super(createdAt, author, logicalTimePoint, pId, Collections.<Competitor>emptyList(), pPassId);
|
||||
public RaceLogStartTrackingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, int pPassId) {
|
||||
super(createdAt, logicalTimePoint, author, pId, pPassId);
|
||||
}
|
||||
|
||||
public RaceLogStartTrackingEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, int pPassId) {
|
||||
super(logicalTimePoint, author, pPassId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+7
-1
@@ -15,7 +15,13 @@ implements RegattaLogCloseOpenEndedDeviceMappingEvent {
|
||||
public RegattaLogCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, Serializable deviceMappingEventId,
|
||||
TimePoint closingTimePoint) {
|
||||
super(createdAt, author, logicalTimePoint, id, deviceMappingEventId, closingTimePoint);
|
||||
super(createdAt, logicalTimePoint, author, id, deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
public RegattaLogCloseOpenEndedDeviceMappingEventImpl(AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable deviceMappingEventId,
|
||||
TimePoint closingTimePoint) {
|
||||
super(logicalTimePoint, author, deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+13
-5
@@ -10,11 +10,19 @@ import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public class RegattaLogDeviceCompetitorMappingEventImpl extends AbstractDeviceMappingEventImpl<RegattaLogEventVisitor, Competitor>
|
||||
implements RegattaLogDeviceCompetitorMappingEvent {
|
||||
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
Serializable pId, Competitor mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, pId, mappedTo, device, from, to);
|
||||
public class RegattaLogDeviceCompetitorMappingEventImpl extends
|
||||
AbstractDeviceMappingEventImpl<RegattaLogEventVisitor, Competitor> implements
|
||||
RegattaLogDeviceCompetitorMappingEvent {
|
||||
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, Competitor mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
super(createdAt, logicalTimePoint, author, pId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
public RegattaLogDeviceCompetitorMappingEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Competitor mappedTo, DeviceIdentifier device,
|
||||
TimePoint from, TimePoint to) {
|
||||
super(logicalTimePoint, author, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
private static final long serialVersionUID = -1494030544804758753L;
|
||||
|
||||
+7
-2
@@ -14,9 +14,14 @@ public class RegattaLogDeviceMarkMappingEventImpl extends AbstractDeviceMappingE
|
||||
implements RegattaLogDeviceMarkMappingEvent {
|
||||
private static final long serialVersionUID = -7223543830755457196L;
|
||||
|
||||
public RegattaLogDeviceMarkMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RegattaLogDeviceMarkMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, pId, mappedTo, device, from, to);
|
||||
super(createdAt, logicalTimePoint, author, pId, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
public RegattaLogDeviceMarkMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Mark mappedTo, DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(logicalTimePoint, author, mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+12
-3
@@ -17,9 +17,18 @@ public class RegattaLogRegisterCompetitorEventImpl extends BaseRegisterCompetito
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public RegattaLogRegisterCompetitorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, Competitor competitor) throws IllegalArgumentException {
|
||||
super(createdAt, author, logicalTimePoint, id, competitor);
|
||||
public RegattaLogRegisterCompetitorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, Competitor competitor) throws IllegalArgumentException {
|
||||
super(createdAt, logicalTimePoint, author, id, competitor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public RegattaLogRegisterCompetitorEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Competitor competitor) throws IllegalArgumentException {
|
||||
super(logicalTimePoint, author, competitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -12,10 +12,10 @@ import com.sap.sse.common.TimePoint;
|
||||
public class RegattaLogRevokeEventImpl extends RevokeEventImpl<RegattaLogEventVisitor> implements RegattaLogRevokeEvent {
|
||||
private static final long serialVersionUID = -3470191515219206588L;
|
||||
|
||||
public RegattaLogRevokeEventImpl(TimePoint createdAt, AbstractLogEventAuthor author, TimePoint logicalTimePoint,
|
||||
public RegattaLogRevokeEventImpl(TimePoint createdAt, TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable pId, Serializable revokedEventId, String revokedEventType, String revokedEventShortInfo,
|
||||
String reason) {
|
||||
super(createdAt, author, logicalTimePoint, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
super(createdAt, logicalTimePoint, author, pId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
}
|
||||
|
||||
public RegattaLogRevokeEventImpl(AbstractLogEventAuthor author, RegattaLogEvent toRevoke, String reason) {
|
||||
|
||||
+3
-3
@@ -15,9 +15,9 @@ public abstract class RegattaLogSetCompetitorHandicapInfoEventImpl extends Abstr
|
||||
|
||||
private final Competitor competitor;
|
||||
|
||||
protected RegattaLogSetCompetitorHandicapInfoEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, Competitor competitor) {
|
||||
super(createdAt, author, logicalTimePoint, pId);
|
||||
protected RegattaLogSetCompetitorHandicapInfoEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, Competitor competitor) {
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.competitor = competitor;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@ public class RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventI
|
||||
private final Duration timeOnDistanceAllowancePerNauticalMile;
|
||||
|
||||
public RegattaLogSetCompetitorTimeOnDistanceAllowancePerNauticalMileEventImpl(TimePoint createdAt,
|
||||
AbstractLogEventAuthor author, TimePoint logicalTimePoint, Serializable pId, Competitor competitor,
|
||||
TimePoint logicalTimePoint, AbstractLogEventAuthor author, Serializable pId, Competitor competitor,
|
||||
Duration timeOnDistanceAllowancePerNauticalMile) {
|
||||
super(createdAt, author, logicalTimePoint, pId, competitor);
|
||||
super(createdAt, logicalTimePoint, author, pId, competitor);
|
||||
this.timeOnDistanceAllowancePerNauticalMile = timeOnDistanceAllowancePerNauticalMile;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@ public class RegattaLogSetCompetitorTimeOnTimeFactorEventImpl extends RegattaLog
|
||||
private static final long serialVersionUID = -7891407213804859604L;
|
||||
private final Double timeOnTimeFactor;
|
||||
|
||||
public RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, Competitor competitor, Double timeOnTimeFactor) {
|
||||
super(createdAt, author, logicalTimePoint, pId, competitor);
|
||||
public RegattaLogSetCompetitorTimeOnTimeFactorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, Competitor competitor, Double timeOnTimeFactor) {
|
||||
super(createdAt, logicalTimePoint, author, pId, competitor);
|
||||
this.timeOnTimeFactor = timeOnTimeFactor;
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -1,7 +1,6 @@
|
||||
package com.sap.sailing.domain.abstractlog.regatta.tracking.analyzing.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
@@ -12,7 +11,6 @@ import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogCloseOpe
|
||||
import com.sap.sailing.domain.abstractlog.shared.analyzing.OpenEndedDeviceMappingCloser;
|
||||
import com.sap.sailing.domain.racelogtracking.DeviceMapping;
|
||||
import com.sap.sse.common.TimePoint;
|
||||
import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public class RegattaLogOpenEndedDeviceMappingCloser extends
|
||||
OpenEndedDeviceMappingCloser<RegattaLog, RegattaLogEvent, RegattaLogEventVisitor, RegattaLogCloseOpenEndedDeviceMappingEvent> {
|
||||
@@ -25,7 +23,7 @@ public class RegattaLogOpenEndedDeviceMappingCloser extends
|
||||
@Override
|
||||
protected RegattaLogCloseOpenEndedDeviceMappingEvent createCloseEvent(TimePoint logicalTimePoint,
|
||||
Serializable eventToCloseId) {
|
||||
return new RegattaLogCloseOpenEndedDeviceMappingEventImpl(MillisecondsTimePoint.now(), author,
|
||||
logicalTimePoint, UUID.randomUUID(), eventToCloseId, closingTimePoint);
|
||||
return new RegattaLogCloseOpenEndedDeviceMappingEventImpl(author,
|
||||
logicalTimePoint, eventToCloseId, closingTimePoint);
|
||||
}
|
||||
}
|
||||
+9
-3
@@ -18,16 +18,22 @@ DeviceMappingEvent<VisitorT, ItemType> {
|
||||
private final TimePoint from;
|
||||
private final TimePoint to;
|
||||
|
||||
public AbstractDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable id, ItemType mappedTo,
|
||||
public AbstractDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable id, ItemType mappedTo,
|
||||
DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
super(createdAt, author, logicalTimePoint, id);
|
||||
super(createdAt, logicalTimePoint, author, id);
|
||||
this.mappedTo = mappedTo;
|
||||
this.device = device;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public AbstractDeviceMappingEventImpl(TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, ItemType mappedTo,
|
||||
DeviceIdentifier device, TimePoint from, TimePoint to) {
|
||||
this(now(), logicalTimePoint, author, randId(), mappedTo, device, from, to);
|
||||
}
|
||||
|
||||
public ItemType getMappedTo() {
|
||||
return mappedTo;
|
||||
}
|
||||
|
||||
+10
-6
@@ -8,20 +8,24 @@ import com.sap.sailing.domain.abstractlog.shared.events.CloseOpenEndedDeviceMapp
|
||||
import com.sap.sse.common.TimePoint;
|
||||
|
||||
public abstract class BaseCloseOpenEndedDeviceMappingEventImpl<VisitorT> extends AbstractLogEventImpl<VisitorT>
|
||||
implements CloseOpenEndedDeviceMappingEvent<VisitorT> {
|
||||
implements CloseOpenEndedDeviceMappingEvent<VisitorT> {
|
||||
private static final long serialVersionUID = -2401732623610224918L;
|
||||
|
||||
|
||||
private final Serializable deviceMappingEventId;
|
||||
private final TimePoint closingTimePoint;
|
||||
|
||||
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, Serializable deviceMappingEventId,
|
||||
TimePoint closingTimePoint) {
|
||||
super(createdAt, author, logicalTimePoint, pId);
|
||||
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, Serializable deviceMappingEventId, TimePoint closingTimePoint) {
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
this.deviceMappingEventId = deviceMappingEventId;
|
||||
this.closingTimePoint = closingTimePoint;
|
||||
}
|
||||
|
||||
public BaseCloseOpenEndedDeviceMappingEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Serializable deviceMappingEventId, TimePoint closingTimePoint) {
|
||||
this(now(), logicalTimePoint, author, randId(), deviceMappingEventId, closingTimePoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getDeviceMappingEventId() {
|
||||
return deviceMappingEventId;
|
||||
|
||||
+17
-4
@@ -17,13 +17,26 @@ public abstract class BaseRegisterCompetitorEventImpl<VisitorT> extends Abstract
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public BaseRegisterCompetitorEventImpl(TimePoint createdAt, AbstractLogEventAuthor author,
|
||||
TimePoint logicalTimePoint, Serializable pId, Competitor competitor) throws IllegalArgumentException {
|
||||
super(createdAt, author, logicalTimePoint, pId);
|
||||
public BaseRegisterCompetitorEventImpl(TimePoint createdAt, TimePoint logicalTimePoint,
|
||||
AbstractLogEventAuthor author, Serializable pId, Competitor competitor) throws IllegalArgumentException {
|
||||
super(createdAt, logicalTimePoint, author, pId);
|
||||
checkCompetitor(competitor);
|
||||
this.competitor = competitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws IllegalArgumentException
|
||||
* if {@code competitor} is null
|
||||
*/
|
||||
public BaseRegisterCompetitorEventImpl(TimePoint logicalTimePoint, AbstractLogEventAuthor author,
|
||||
Competitor competitor) throws IllegalArgumentException {
|
||||
this(now(), logicalTimePoint, author, randId(), competitor);
|
||||
}
|
||||
|
||||
private static void checkCompetitor(Competitor competitor) throws IllegalArgumentException {
|
||||
if (competitor == null) {
|
||||
throw new IllegalArgumentException("Competitor may not be null");
|
||||
}
|
||||
this.competitor = competitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -34,5 +34,5 @@ public interface LeaderboardSearchResultBase extends Hit {
|
||||
* that is referenced by the leaderboard as its {@link Leaderboard#getDefaultCourseArea() default course area}, the
|
||||
* event is returned; <code>null</code> otherwise.
|
||||
*/
|
||||
EventBase getEvent();
|
||||
Iterable<? extends EventBase> getEvents();
|
||||
}
|
||||
+12
-11
@@ -18,8 +18,9 @@ import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.impl.RegattaLogRegisterCompetitorEventImpl;
|
||||
@@ -109,7 +110,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
final LogEventAuthorImpl author = new LogEventAuthorImpl("Me", 0);
|
||||
final Map<Competitor, RaceLogRegisterCompetitorEvent> competitorOnRaceLogRegistrationEvents = new HashMap<>();
|
||||
for (Competitor c : compLists[0]) {
|
||||
final RaceLogRegisterCompetitorEvent registerCompetitorEvent = RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(), author, passId, c);
|
||||
final RaceLogRegisterCompetitorEvent registerCompetitorEvent = new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, passId, c);
|
||||
raceLog.add(registerCompetitorEvent);
|
||||
competitorOnRaceLogRegistrationEvents.put(c, registerCompetitorEvent);
|
||||
}
|
||||
@@ -125,7 +126,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
// we're now revoking a competitor registration on the race log and assert
|
||||
// that the competitor is gone from the list:
|
||||
final Competitor competitorToRevokeFromRaceLog = compLists[0].get(2);
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createRevokeEvent(author, passId, competitorOnRaceLogRegistrationEvents.get(competitorToRevokeFromRaceLog), "Test revoking"));
|
||||
raceLog.add(new RaceLogRevokeEventImpl(author, passId, competitorOnRaceLogRegistrationEvents.get(competitorToRevokeFromRaceLog), "Test revoking"));
|
||||
actualForRace = new HashSet<>(); // try another time; cache should of course yield an equal result (although
|
||||
// we're not asserting here that the result actually comes from the cache)
|
||||
Util.addAll(competitorProviderFlexibleLeaderboard.getAllCompetitors(
|
||||
@@ -149,7 +150,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
flexibleLeaderboard.addRaceColumn("R1", /* medalRace */ false);
|
||||
RegattaLog regattaLog = flexibleLeaderboard.getRegattaLog();
|
||||
for (Competitor c : compLists[0]) {
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), MillisecondsTimePoint.now(), UUID.randomUUID(), c));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), UUID.randomUUID(), c));
|
||||
}
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
Set<Competitor> actual = new HashSet<>();
|
||||
@@ -167,11 +168,11 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
flexibleLeaderboard.addRaceColumn("R1", /* medalRace */ false);
|
||||
RegattaLog regattaLog = flexibleLeaderboard.getRegattaLog();
|
||||
for (Competitor c : compLists[0]) {
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), MillisecondsTimePoint.now(), UUID.randomUUID(), c));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), UUID.randomUUID(), c));
|
||||
}
|
||||
RaceLog raceLog = flexibleLeaderboard.getRacelog("R1", LeaderboardNameConstants.DEFAULT_FLEET_NAME);
|
||||
for (Competitor c : compLists[1]) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), 1, c));
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), 1, c));
|
||||
}
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
expected.addAll(compLists[1]);
|
||||
@@ -251,7 +252,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
public void testSimpleCompetitorListOnOneRaceLogInRegattaLeaderboard() {
|
||||
RaceLog raceLog = regattaLeaderboard.getRacelog("R1", "Yellow");
|
||||
for (Competitor c : compLists[0]) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), 1, c));
|
||||
raceLog.add(new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), new LogEventAuthorImpl("Me", 0), 1, c));
|
||||
}
|
||||
Set<Competitor> expected = new HashSet<>(compLists[0]);
|
||||
Set<Competitor> actual = new HashSet<>();
|
||||
@@ -269,7 +270,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
final Map<Competitor, RegattaLogRegisterCompetitorEvent> competitorOnRegattaLogRegistrationEvents = new HashMap<>();
|
||||
final LogEventAuthorImpl author = new LogEventAuthorImpl("Me", 0);
|
||||
for (Competitor c : compLists[0]) {
|
||||
final RegattaLogRegisterCompetitorEventImpl registerCompetitorEvent = new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID.randomUUID(), c);
|
||||
final RegattaLogRegisterCompetitorEventImpl registerCompetitorEvent = new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID.randomUUID(), c);
|
||||
regattaLog.add(registerCompetitorEvent);
|
||||
competitorOnRegattaLogRegistrationEvents.put(c, registerCompetitorEvent);
|
||||
}
|
||||
@@ -302,13 +303,13 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
final RegattaLog regattaLog = regattaLeaderboard.getRegatta().getRegattaLog();
|
||||
final LogEventAuthorImpl author = new LogEventAuthorImpl("Me", 0);
|
||||
for (Competitor c : compLists[0]) {
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, MillisecondsTimePoint.now(), UUID.randomUUID(), c));
|
||||
regattaLog.add(new RegattaLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), MillisecondsTimePoint.now(), author, UUID.randomUUID(), c));
|
||||
}
|
||||
final RaceLog raceLog = regattaLeaderboard.getRacelog("R1", "Yellow");
|
||||
final int passId = 1;
|
||||
final Map<Competitor, RaceLogRegisterCompetitorEvent> competitorOnRaceLogRegistrationEvents = new HashMap<>();
|
||||
for (Competitor c : compLists[passId]) {
|
||||
final RaceLogRegisterCompetitorEvent registerCompetitorEvent = RaceLogEventFactory.INSTANCE.createRegisterCompetitorEvent(MillisecondsTimePoint.now(), author, passId, c);
|
||||
final RaceLogRegisterCompetitorEvent registerCompetitorEvent = new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(), author, passId, c);
|
||||
raceLog.add(registerCompetitorEvent);
|
||||
competitorOnRaceLogRegistrationEvents.put(c, registerCompetitorEvent);
|
||||
}
|
||||
@@ -335,7 +336,7 @@ public class CompetitorProviderCacheInvalidationTest extends AbstractLeaderboard
|
||||
// But now it gets interesting: we're revoking a competitor registration on the race log and assert
|
||||
// that the competitor is gone from the list:
|
||||
final Competitor competitorToRevokeFromRaceLog = compLists[passId].get(2);
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createRevokeEvent(author, passId, competitorOnRaceLogRegistrationEvents.get(competitorToRevokeFromRaceLog), "Test revoking"));
|
||||
raceLog.add(new RaceLogRevokeEventImpl(author, passId, competitorOnRaceLogRegistrationEvents.get(competitorToRevokeFromRaceLog), "Test revoking"));
|
||||
actualForRaceYellow = new HashSet<>(); // try another time; cache should of course yield an equal result (although
|
||||
// we're not asserting here that the result actually comes from the cache)
|
||||
Util.addAll(competitorProviderRegattaLeaderboard.getAllCompetitors(
|
||||
|
||||
+2
-2
@@ -1213,11 +1213,11 @@ public class LeaderboardScoringAndRankingTest extends AbstractLeaderboardTest {
|
||||
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
|
||||
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
|
||||
RaceLog raceLogForRace2 = leaderboardHighPoint10Or8AndLastBreaksTie.getRaceColumnByName("R2").getRaceLog(leaderboardHighPoint10Or8AndLastBreaksTie.getFleet(null));
|
||||
raceLogForRace2.add(new RaceLogAdditionalScoringInformationEventImpl(now, new LogEventAuthorImpl("Plopp", 1), later, "12345678", Collections.<Competitor>emptyList(), 0, AdditionalScoringInformationType.UNKNOWN));
|
||||
raceLogForRace2.add(new RaceLogAdditionalScoringInformationEventImpl(now, later, new LogEventAuthorImpl("Plopp", 1), "12345678", 0, AdditionalScoringInformationType.UNKNOWN));
|
||||
assertEquals(new Double(20), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
|
||||
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
|
||||
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
|
||||
raceLogForRace2.add(new RaceLogAdditionalScoringInformationEventImpl(now, new LogEventAuthorImpl("Plopp", 1), later.plus(Duration.ONE_MINUTE), "123456789873773762", Collections.<Competitor>emptyList(), 0, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
|
||||
raceLogForRace2.add(new RaceLogAdditionalScoringInformationEventImpl(now, later.plus(Duration.ONE_MINUTE), new LogEventAuthorImpl("Plopp", 1), "123456789873773762", 0, AdditionalScoringInformationType.MAX_POINTS_DECREASE_MAX_SCORE));
|
||||
assertEquals(new Double(18), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[0], later));
|
||||
assertEquals(new Double(16), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[1], later));
|
||||
assertEquals(new Double(2), leaderboardHighPoint10Or8AndLastBreaksTie.getTotalPoints(competitors[9], later));
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ public interface LeaderboardSearchResult extends LeaderboardSearchResultBase {
|
||||
* If there is a connection between an {@link Event} and the {@link #getLeaderboard() leaderboard}, e.g., because
|
||||
* the {@link Event} has a {@link Event#getLeaderboardGroups() leaderboard group} that is part of {@link #getLeaderboardGroups()} or
|
||||
* the event has a course area attached to its {@link Event#getVenue() venue} that is referenced by the leaderboard as
|
||||
* its {@link Leaderboard#getDefaultCourseArea() default course area}, the event is returned; <code>null</code> otherwise.
|
||||
* its {@link Leaderboard#getDefaultCourseArea() default course area}, the event is part of the resulting iterable.
|
||||
*/
|
||||
Event getEvent();
|
||||
Iterable<Event> getEvents();
|
||||
}
|
||||
+5
-5
@@ -19,17 +19,17 @@ public class LeaderboardSearchResultBaseImpl implements LeaderboardSearchResultB
|
||||
private final LeaderboardBase leaderboard;
|
||||
private final String regattaName;
|
||||
private final Iterable<? extends LeaderboardGroupBase> leaderboardGroups;
|
||||
private final EventBase event;
|
||||
private final Iterable<? extends EventBase> events;
|
||||
private final String boatClassName;
|
||||
|
||||
public LeaderboardSearchResultBaseImpl(LeaderboardBase leaderboard, String regattaName,
|
||||
String boatClassName, Iterable<? extends LeaderboardGroupBase> leaderboardGroups, EventBase event) {
|
||||
String boatClassName, Iterable<? extends LeaderboardGroupBase> leaderboardGroups, Iterable<? extends EventBase> events) {
|
||||
super();
|
||||
this.leaderboard = leaderboard;
|
||||
this.regattaName = regattaName;
|
||||
this.boatClassName = boatClassName;
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
this.event = event;
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,8 +53,8 @@ public class LeaderboardSearchResultBaseImpl implements LeaderboardSearchResultB
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventBase getEvent() {
|
||||
return event;
|
||||
public Iterable<? extends EventBase> getEvents() {
|
||||
return events;
|
||||
}
|
||||
|
||||
}
|
||||
+5
-5
@@ -14,17 +14,17 @@ import com.sap.sailing.domain.tracking.TrackedRace;
|
||||
|
||||
public class LeaderboardSearchResultImpl implements LeaderboardSearchResult {
|
||||
private final Leaderboard leaderboard;
|
||||
private final Event event;
|
||||
private final Set<Event> events;
|
||||
private final Set<LeaderboardGroup> leaderboardGroups;
|
||||
|
||||
public LeaderboardSearchResultImpl(Leaderboard leaderboard, Event event, Set<LeaderboardGroup> leaderboardGroups) {
|
||||
public LeaderboardSearchResultImpl(Leaderboard leaderboard, Set<Event> events, Set<LeaderboardGroup> leaderboardGroups) {
|
||||
this.leaderboard = leaderboard;
|
||||
if (leaderboardGroups == null) {
|
||||
this.leaderboardGroups = Collections.emptySet();
|
||||
} else {
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
}
|
||||
this.event = event;
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,8 +49,8 @@ public class LeaderboardSearchResultImpl implements LeaderboardSearchResult {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Event getEvent() {
|
||||
return event;
|
||||
public Iterable<Event> getEvents() {
|
||||
return events;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import com.sap.sailing.gwt.dispatch.client.exceptions.DispatchException;
|
||||
import com.sap.sailing.gwt.home.communication.SailingAction;
|
||||
import com.sap.sailing.gwt.home.communication.SailingDispatchContext;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.search.KeywordQuery;
|
||||
import com.sap.sse.common.search.Result;
|
||||
|
||||
@@ -57,7 +58,7 @@ public class GetSearchResultsAction implements SailingAction<ListResult<SearchRe
|
||||
ListResult<SearchResultDTO> resultList = new ListResult<>();
|
||||
for (T hit : result.getHits()) {
|
||||
// TODO: for now filter all results where we no event is defined
|
||||
if (hit.getEvent() != null) {
|
||||
if (!Util.isEmpty(hit.getEvents())) {
|
||||
resultList.addValue(new SearchResultDTO(hit, baseUrl, isOnRemoteServer));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class SearchResultDTO implements DTO {
|
||||
this.leaderboardName = hit.getLeaderboard().getName();
|
||||
this.displayName = hit.getLeaderboard().getDisplayName() != null ? hit.getLeaderboard().getDisplayName() :
|
||||
(hit.getRegattaName() != null ? hit.getRegattaName() : leaderboardName);
|
||||
EventBase event = hit.getEvent();
|
||||
EventBase event = hit.getEvents().iterator().next();
|
||||
if (event != null) {
|
||||
this.eventId = (UUID) event.getId();
|
||||
this.eventName = event.getName();
|
||||
|
||||
+21
-18
@@ -15,42 +15,45 @@ public class EventDatesFormatterUtil {
|
||||
private final static DateTimeFormat monthFormat = DateTimeFormat.getFormat("MMMM");
|
||||
private final static DateTimeFormat yearFormat = DateTimeFormat.getFormat("yyyy");
|
||||
|
||||
private final static int ONE_DAY = 24 * 60 * 60 * 1000;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String formatDateRangeWithYear(Date from, Date to) {
|
||||
String result = "";
|
||||
if(from.getMonth() == to.getMonth()) {
|
||||
final String result;
|
||||
final String fromMonth = monthFormat.format(from);
|
||||
final String toMonth = monthFormat.format(to);
|
||||
if (fromMonth.equals(toMonth)) {
|
||||
// same month
|
||||
if(from.getDay() == to.getDay() && to.getTime() - to.getTime() <= ONE_DAY) {
|
||||
final String fromDay = dayFormat.format(from);
|
||||
final String toDay = dayFormat.format(to);
|
||||
if (fromDay.equals(toDay)) {
|
||||
// same day
|
||||
result = monthFormat.format(from) + " " + dayFormat.format(from) + ", " + yearFormat.format(from);
|
||||
result = fromMonth + " " + fromDay + ", " + yearFormat.format(from);
|
||||
} else {
|
||||
result = monthFormat.format(from) + " " + dayFormat.format(from) + " - " + dayFormat.format(to) + ", " + yearFormat.format(from);
|
||||
result = fromMonth + " " + fromDay + " - " + toDay + ", "
|
||||
+ yearFormat.format(from);
|
||||
}
|
||||
} else {
|
||||
result = dayAndMonthFormat.format(from) + " - " + dayAndMonthFormat.format(to) + ", " + yearFormat.format(from);
|
||||
result = dayAndMonthFormat.format(from) + " - " + dayAndMonthFormat.format(to) + ", "
|
||||
+ yearFormat.format(from);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String formatDateRangeWithoutYear(Date from, Date to) {
|
||||
String result = "";
|
||||
if(from.getMonth() == to.getMonth()) {
|
||||
final String result;
|
||||
final String fromMonth = monthFormat.format(from);
|
||||
final String toMonth = monthFormat.format(to);
|
||||
if (fromMonth.equals(toMonth)) {
|
||||
// same month
|
||||
if(from.getDay() == to.getDay() && to.getTime() - to.getTime() <= ONE_DAY) {
|
||||
final String fromDay = dayFormat.format(from);
|
||||
final String toDay = dayFormat.format(to);
|
||||
if (fromDay.equals(toDay)) {
|
||||
// same day
|
||||
result = monthFormat.format(from) + " " + dayFormat.format(from);
|
||||
result = fromMonth + " " + fromDay;
|
||||
} else {
|
||||
result = monthFormat.format(from) + " " + dayFormat.format(from) + " - " + dayFormat.format(to);
|
||||
result = fromMonth + " " + fromDay + " - " + toDay;
|
||||
}
|
||||
} else {
|
||||
result = dayAndMonthFormat.format(from) + " - " + dayAndMonthFormat.format(to);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -93,7 +93,7 @@ public class RaceBoardEntryPoint extends AbstractSailingEntryPoint {
|
||||
boolean showViewSimulation = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_SIMULATION, true /* default*/);
|
||||
String activeCompetitorsFilterSetName = GwtHttpRequestUtils.getStringParameter(RaceBoardViewConfiguration.PARAM_VIEW_COMPETITOR_FILTER, null /* default*/);
|
||||
final boolean canReplayWhileLiveIsPossible = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_CAN_REPLAY_DURING_LIVE_RACES, false);
|
||||
final boolean autoSelectMedia = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_AUTOSELECT_MEDIA, false);
|
||||
final boolean autoSelectMedia = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_AUTOSELECT_MEDIA, true);
|
||||
final String defaultMedia = GwtHttpRequestUtils.getStringParameter(RaceBoardViewConfiguration.PARAM_DEFAULT_MEDIA, null /* default*/);
|
||||
final boolean showMapControls = GwtHttpRequestUtils.getBooleanParameter(RaceBoardViewConfiguration.PARAM_VIEW_SHOW_MAPCONTROLS, true /* default*/);
|
||||
raceboardViewConfig = new RaceBoardViewConfiguration(activeCompetitorsFilterSetName, showLeaderboard,
|
||||
|
||||
+2
-2
@@ -85,8 +85,8 @@ public class RaceBoardViewConfiguration {
|
||||
}
|
||||
|
||||
public boolean isAutoSelectMedia() {
|
||||
return autoSelectMedia;
|
||||
}
|
||||
return autoSelectMedia;
|
||||
}
|
||||
|
||||
public String getDefaultMedia() {
|
||||
return defaultMedia;
|
||||
|
||||
+27
-21
@@ -17,7 +17,6 @@ import java.net.URLEncoder;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -64,7 +63,6 @@ import com.sap.sailing.domain.abstractlog.impl.AllEventsOfTypeFinder;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
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;
|
||||
@@ -72,7 +70,12 @@ import com.sap.sailing.domain.abstractlog.race.analyzing.impl.AbortingFlagFinder
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.LastPublishedCourseDesignFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.MarkPassingDataFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.analyzing.impl.TrackingTimesFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEndOfTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFixedMarkPassingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartOfTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogSuppressedMarkPassingsEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.impl.ReadonlyRaceStateImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.state.racingprocedure.FlagPoleState;
|
||||
@@ -83,6 +86,9 @@ import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogDefinedMarkFinder;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogOpenEndedDeviceMappingCloser;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.analyzing.impl.RaceLogTrackingStateAnalyzer;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLog;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.RegattaLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.regatta.events.RegattaLogCloseOpenEndedDeviceMappingEvent;
|
||||
@@ -4724,14 +4730,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
RaceLog raceLog = getRaceLog(dto.leaderboardName, dto.raceColumnName, dto.fleetName);
|
||||
// TODO If new is null and current is not, current should be revoked.
|
||||
if (!Util.equalsWithNull(dto.newStartOfTracking, dto.currentStartOfTracking)) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createStartOfTrackingEvent(
|
||||
dto.newStartOfTracking, new LogEventAuthorImpl(dto.authorName, dto.authorPriority), UUID
|
||||
.randomUUID(), new ArrayList<Competitor>(), raceLog.getCurrentPassId()));
|
||||
raceLog.add(new RaceLogStartOfTrackingEventImpl(
|
||||
dto.newStartOfTracking, new LogEventAuthorImpl(dto.authorName, dto.authorPriority),
|
||||
raceLog.getCurrentPassId()));
|
||||
}
|
||||
if (!Util.equalsWithNull(dto.newEndOfTracking, dto.currentEndOfTracking)) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createEndOfTrackingEvent(
|
||||
dto.newEndOfTracking, new LogEventAuthorImpl(dto.authorName, dto.authorPriority), UUID
|
||||
.randomUUID(), new ArrayList<Competitor>(), raceLog.getCurrentPassId()));
|
||||
raceLog.add(new RaceLogEndOfTrackingEventImpl(
|
||||
dto.newEndOfTracking, new LogEventAuthorImpl(dto.authorName, dto.authorPriority),
|
||||
raceLog.getCurrentPassId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4968,7 +4974,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
public void addMarkToRaceLog(String leaderboardName, String raceColumnName, String fleetName, MarkDTO markDTO) {
|
||||
Mark mark = convertToMark(markDTO, false);
|
||||
RaceLog raceLog = getRaceLog(leaderboardName, raceColumnName, fleetName);
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createDefineMarkEvent(MillisecondsTimePoint.now(),
|
||||
RaceLogEvent event = new RaceLogDefineMarkEventImpl(MillisecondsTimePoint.now(),
|
||||
getService().getServerAuthor(), raceLog.getCurrentPassId(), mark);
|
||||
raceLog.add(event);
|
||||
}
|
||||
@@ -4988,7 +4994,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
if (eventToRevoke != null){
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createRevokeEvent(getService().getServerAuthor(), raceLog.getCurrentPassId(), eventToRevoke, "Revoked by AdminConsole (RaceLogTracking)");
|
||||
RaceLogEvent event = new RaceLogRevokeEventImpl(getService().getServerAuthor(), raceLog.getCurrentPassId(), eventToRevoke, "Revoked by AdminConsole (RaceLogTracking)");
|
||||
raceLog.add(event);
|
||||
} else {
|
||||
logger.warning("Could not revoke event for mark "+markDTO.getIdAsString()+". Mark not found in RaceLog.");
|
||||
@@ -5054,7 +5060,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
RaceLogEvent event = RaceLogEventFactory.INSTANCE.createCourseDesignChangedEvent(MillisecondsTimePoint.now(),
|
||||
RaceLogEvent event = new RaceLogCourseDesignChangedEventImpl(MillisecondsTimePoint.now(),
|
||||
getService().getServerAuthor(), raceLog.getCurrentPassId(), course);
|
||||
raceLog.add(event);
|
||||
}
|
||||
@@ -5259,13 +5265,13 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
TimePoint to = mapping.getTimeRange().hasOpenEnd() ? null : mapping.getTimeRange().to();
|
||||
if (dto.mappedTo instanceof MarkDTO) {
|
||||
Mark mark = convertToMark(((MarkDTO) dto.mappedTo), true);
|
||||
event = RaceLogEventFactory.INSTANCE.createDeviceMarkMappingEvent(now, getService().getServerAuthor(),
|
||||
mapping.getDevice(), mark, raceLog.getCurrentPassId(), from, to);
|
||||
event = new RaceLogDeviceMarkMappingEventImpl(now, getService().getServerAuthor(),
|
||||
raceLog.getCurrentPassId(), mark, mapping.getDevice(), from, to);
|
||||
} else if (dto.mappedTo instanceof CompetitorDTO) {
|
||||
Competitor competitor = getService().getCompetitorStore().getExistingCompetitorByIdAsString(
|
||||
((CompetitorDTO) dto.mappedTo).getIdAsString());
|
||||
event = RaceLogEventFactory.INSTANCE.createDeviceCompetitorMappingEvent(now, getService().getServerAuthor(),
|
||||
mapping.getDevice(), competitor, raceLog.getCurrentPassId(), from, to);
|
||||
event = new RaceLogDeviceCompetitorMappingEventImpl(now, getService().getServerAuthor(),
|
||||
raceLog.getCurrentPassId(), competitor, mapping.getDevice(), from, to);
|
||||
} else {
|
||||
throw new RuntimeException("Can only map devices to competitors or marks");
|
||||
}
|
||||
@@ -5283,12 +5289,12 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
TimePoint to = mapping.getTimeRange().hasOpenEnd() ? null : mapping.getTimeRange().to();
|
||||
if (dto.mappedTo instanceof MarkDTO) {
|
||||
Mark mark = convertToMark(((MarkDTO) dto.mappedTo), true);
|
||||
event = new RegattaLogDeviceMarkMappingEventImpl(now, getService().getServerAuthor(), now, UUID.randomUUID(),
|
||||
event = new RegattaLogDeviceMarkMappingEventImpl(now, now, getService().getServerAuthor(), UUID.randomUUID(),
|
||||
mark, mapping.getDevice(), from, to);
|
||||
} else if (dto.mappedTo instanceof CompetitorDTO) {
|
||||
Competitor competitor = getService().getCompetitorStore().getExistingCompetitorByIdAsString(
|
||||
((CompetitorDTO) dto.mappedTo).getIdAsString());
|
||||
event = new RegattaLogDeviceCompetitorMappingEventImpl(now, getService().getServerAuthor(), now, UUID.randomUUID(),
|
||||
event = new RegattaLogDeviceCompetitorMappingEventImpl(now, now, getService().getServerAuthor(), UUID.randomUUID(),
|
||||
competitor, mapping.getDevice(), from, to);
|
||||
} else {
|
||||
throw new RuntimeException("Can only map devices to competitors or marks");
|
||||
@@ -5530,8 +5536,8 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
}
|
||||
if (dateOfMarkPassing != null) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createFixedMarkPassingEvent(MillisecondsTimePoint.now(), getService()
|
||||
.getServerAuthor(), UUID.randomUUID(), Arrays.asList(competitor), raceLog.getCurrentPassId(),
|
||||
raceLog.add(new RaceLogFixedMarkPassingEventImpl(MillisecondsTimePoint.now(), getService()
|
||||
.getServerAuthor(), competitor, raceLog.getCurrentPassId(),
|
||||
new MillisecondsTimePoint(dateOfMarkPassing), indexOfWaypoint));
|
||||
}
|
||||
}
|
||||
@@ -5578,8 +5584,8 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
}
|
||||
if (create) {
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createSuppressedMarkPassingsEvent(MillisecondsTimePoint.now(), getService()
|
||||
.getServerAuthor(), UUID.randomUUID(), Arrays.asList(competitor), raceLog.getCurrentPassId(),
|
||||
raceLog.add(new RaceLogSuppressedMarkPassingsEventImpl(MillisecondsTimePoint.now(), getService()
|
||||
.getServerAuthor(), competitor, raceLog.getCurrentPassId(),
|
||||
newZeroBasedIndexOfSuppressedMarkPassing));
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -22,13 +22,13 @@ public class LeaderboardSearchResultDTO implements IsSerializable {
|
||||
private String leaderboardDisplayName;
|
||||
private String regattaName;
|
||||
private String boatClassName;
|
||||
private EventBaseDTO event;
|
||||
private Iterable<EventBaseDTO> events;
|
||||
private Iterable<LeaderboardGroupBaseDTO> leaderboardGroups;
|
||||
|
||||
LeaderboardSearchResultDTO() {} // for GWT RPC serialization only
|
||||
|
||||
public LeaderboardSearchResultDTO(String baseURL, boolean isOnRemoteServer, String leaderboardName, String leaderboardDisplayName,
|
||||
String regattaName, String boatClassName, EventBaseDTO event,
|
||||
String regattaName, String boatClassName, Iterable<EventBaseDTO> events,
|
||||
Iterable<LeaderboardGroupBaseDTO> leaderboardGroups) {
|
||||
super();
|
||||
this.baseURL = baseURL;
|
||||
@@ -37,7 +37,7 @@ public class LeaderboardSearchResultDTO implements IsSerializable {
|
||||
this.leaderboardDisplayName = leaderboardDisplayName;
|
||||
this.regattaName = regattaName;
|
||||
this.boatClassName = boatClassName;
|
||||
this.event = event;
|
||||
this.events = events;
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ public class LeaderboardSearchResultDTO implements IsSerializable {
|
||||
return boatClassName;
|
||||
}
|
||||
|
||||
public EventBaseDTO getEvent() {
|
||||
return event;
|
||||
public Iterable<EventBaseDTO> getEvents() {
|
||||
return events;
|
||||
}
|
||||
|
||||
public Iterable<LeaderboardGroupBaseDTO> getLeaderboardGroups() {
|
||||
@@ -81,9 +81,9 @@ public class LeaderboardSearchResultDTO implements IsSerializable {
|
||||
sb.append(getLeaderboardDisplayName());
|
||||
sb.append(")");
|
||||
}
|
||||
if (getEvent() != null) {
|
||||
sb.append(", Event ");
|
||||
sb.append(getEvent().getName());
|
||||
if (getEvents() != null) {
|
||||
sb.append(", Events ");
|
||||
sb.append(getEvents());
|
||||
}
|
||||
sb.append(", ");
|
||||
sb.append("Boat class: ");
|
||||
|
||||
+3
-3
@@ -15,8 +15,8 @@ import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.impl.CompetitorImpl;
|
||||
@@ -83,8 +83,8 @@ public class StoreAndLoadDeviceIdentifierTest extends AbstractMongoDBTest {
|
||||
createFactories(forStoring);
|
||||
Competitor c = new CompetitorImpl("a", "a", null, null, null, null, null, /* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null);
|
||||
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceCompetitorMappingEvent(now(), author, device,
|
||||
c, 0, now(), now()));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(now(), author, 0,
|
||||
c, device, now(), now()));
|
||||
|
||||
createFactories(forLoading);
|
||||
|
||||
|
||||
+54
-42
@@ -22,18 +22,29 @@ import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogPassChangeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogRevokeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseAreaChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRevokeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogCloseOpenEndedDeviceMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDefineMarkEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDenoteForTrackingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceCompetitorMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogDeviceMarkMappingEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.RaceLogRegisterCompetitorEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogCloseOpenEndedDeviceMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDefineMarkEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDenoteForTrackingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogRegisterCompetitorEventImpl;
|
||||
import com.sap.sailing.domain.base.BoatClass;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
@@ -58,8 +69,7 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
.getMongoObjectFactory(getMongoService(), new MockSmartphoneImeiServiceFinderFactory());
|
||||
protected DomainObjectFactoryImpl domainFactory = (DomainObjectFactoryImpl) PersistenceFactory.INSTANCE
|
||||
.getDomainObjectFactory(getMongoService(), DomainFactory.INSTANCE,
|
||||
new MockSmartphoneImeiServiceFinderFactory());
|
||||
protected RaceLogEventRestoreFactory eventFactory = RaceLogEventRestoreFactory.INSTANCE;
|
||||
new MockSmartphoneImeiServiceFinderFactory());
|
||||
|
||||
protected RaceLogIdentifier logIdentifier;
|
||||
|
||||
@@ -76,7 +86,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
logIdentifier = mock(RaceLogIdentifier.class);
|
||||
when(logIdentifier.getIdentifier()).thenReturn(new com.sap.sse.common.Util.Triple<String, String, String>("a", "b", UUID.randomUUID().toString()));
|
||||
when(logIdentifier.getIdentifier()).thenReturn(
|
||||
new com.sap.sse.common.Util.Triple<String, String, String>("a", "b", UUID.randomUUID().toString()));
|
||||
}
|
||||
|
||||
public void assertBaseFields(RaceLogEvent expectedEvent, RaceLogEvent actualEvent) {
|
||||
@@ -87,15 +98,15 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
assertEquals(expectedEvent.getInvolvedBoats().size(), Util.size(actualEvent.getInvolvedBoats()));
|
||||
assertEquals(expectedEvent.getPassId(), actualEvent.getPassId());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@Test
|
||||
public void testStoreEventWithoutAuthorLoadsCompatibilityAuthor() {
|
||||
RaceLogFlagEvent expectedEvent = eventFactory.createFlagEvent(expectedEventTime,
|
||||
null, expectedId, expectedInvolvedBoats, expectedPassId, Flags.NONE, Flags.NONE, true);
|
||||
RaceLogFlagEvent expectedEvent = new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), expectedEventTime, null,
|
||||
expectedId, expectedPassId, Flags.NONE, Flags.NONE, true);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogFlagEvent actualEvent = loadEvent(dbObject);
|
||||
|
||||
|
||||
assertNull(expectedEvent.getAuthor());
|
||||
assertNotNull(actualEvent.getAuthor());
|
||||
assertEquals(AbstractLogEventAuthor.PRIORITY_COMPATIBILITY, actualEvent.getAuthor().getPriority());
|
||||
@@ -108,8 +119,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
Flags lowerFlag = Flags.BRAVO;
|
||||
boolean isDisplayed = true;
|
||||
|
||||
RaceLogFlagEvent expectedEvent = eventFactory.createFlagEvent(expectedEventTime,
|
||||
author, expectedId, expectedInvolvedBoats, expectedPassId, upperFlag, lowerFlag, isDisplayed);
|
||||
RaceLogFlagEvent expectedEvent = new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), expectedEventTime,
|
||||
author, expectedId, expectedPassId, upperFlag, lowerFlag, isDisplayed);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogFlagEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -124,8 +135,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
public void testStoreAndLoadCourseAreaChangedEvent() {
|
||||
Serializable courseAreaId = UUID.randomUUID();
|
||||
|
||||
RaceLogCourseAreaChangedEvent expectedEvent = eventFactory.createCourseAreaChangedEvent(
|
||||
expectedEventTime, author, expectedId, expectedInvolvedBoats, expectedPassId, courseAreaId);
|
||||
RaceLogCourseAreaChangedEvent expectedEvent = new RaceLogCourseAreaChangeEventImpl(MillisecondsTimePoint.now(),
|
||||
expectedEventTime, author, expectedId, expectedPassId, courseAreaId);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogCourseAreaChangedEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -136,8 +147,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
|
||||
@Test
|
||||
public void testStoreAndLoadPassChangeEvent() {
|
||||
RaceLogPassChangeEvent expectedEvent = eventFactory.createPassChangeEvent(expectedEventTime,
|
||||
author, expectedId, expectedInvolvedBoats, expectedPassId);
|
||||
RaceLogPassChangeEvent expectedEvent = new RaceLogPassChangeEventImpl(MillisecondsTimePoint.now(),
|
||||
expectedEventTime, author, expectedId, expectedPassId);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogPassChangeEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -148,8 +159,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
@Test
|
||||
public void testStoreAndLoadRaceStatusEvent() {
|
||||
RaceLogRaceStatus status = RaceLogRaceStatus.SCHEDULED;
|
||||
RaceLogRaceStatusEvent expectedEvent = eventFactory.createRaceStatusEvent(expectedEventTime,
|
||||
author, expectedId, expectedInvolvedBoats, expectedPassId, status);
|
||||
RaceLogRaceStatusEvent expectedEvent = new RaceLogRaceStatusEventImpl(MillisecondsTimePoint.now(),
|
||||
expectedEventTime, author, expectedId, expectedPassId, status);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogRaceStatusEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -161,8 +172,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
@Test
|
||||
public void testStoreAndLoadStartTimeEvent() {
|
||||
TimePoint startTime = new MillisecondsTimePoint(1337);
|
||||
RaceLogStartTimeEvent expectedEvent = eventFactory.createStartTimeEvent(expectedEventTime,
|
||||
author, expectedId, expectedInvolvedBoats, expectedPassId, startTime);
|
||||
RaceLogStartTimeEvent expectedEvent = new RaceLogStartTimeEventImpl(MillisecondsTimePoint.now(),
|
||||
expectedEventTime, author, expectedId, expectedPassId, startTime, RaceLogRaceStatus.SCHEDULED);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogStartTimeEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -178,8 +189,9 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
null, /* timeOnDistanceAllowancePerNauticalMile */null);
|
||||
TimePoint from = new MillisecondsTimePoint(20);
|
||||
TimePoint to = new MillisecondsTimePoint(30);
|
||||
RaceLogDeviceCompetitorMappingEvent expectedEvent = eventFactory.createDeviceCompetitorMappingEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, device, mappedTo, expectedPassId, from, to);
|
||||
RaceLogDeviceCompetitorMappingEvent expectedEvent = new RaceLogDeviceCompetitorMappingEventImpl(
|
||||
expectedEventTime, expectedEventTime, author, expectedId, expectedPassId,
|
||||
mappedTo, device, from, to);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogDeviceCompetitorMappingEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -197,8 +209,9 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
Mark mappedTo = DomainFactory.INSTANCE.getOrCreateMark("abc", "abc");
|
||||
TimePoint from = new MillisecondsTimePoint(20);
|
||||
TimePoint to = new MillisecondsTimePoint(30);
|
||||
RaceLogDeviceMarkMappingEvent expectedEvent = eventFactory.createDeviceMarkMappingEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, device, mappedTo, expectedPassId, from, to);
|
||||
RaceLogDeviceMarkMappingEvent expectedEvent = new RaceLogDeviceMarkMappingEventImpl(
|
||||
expectedEventTime, expectedEventTime, author, expectedId, expectedPassId,
|
||||
mappedTo, device, from, to);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogDeviceMarkMappingEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -212,12 +225,12 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
|
||||
@Test
|
||||
public void testStoreAndLoadDenoteForTrackingEvent() {
|
||||
String raceName = "race";
|
||||
BoatClass boatClass = DomainFactory.INSTANCE.getOrCreateBoatClass("49er");
|
||||
UUID raceId = UUID.randomUUID();
|
||||
RaceLogDenoteForTrackingEvent expectedEvent = eventFactory.createDenoteForTrackingEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, expectedPassId, raceName, boatClass,
|
||||
raceId);
|
||||
String raceName = "race";
|
||||
BoatClass boatClass = DomainFactory.INSTANCE.getOrCreateBoatClass("49er");
|
||||
UUID raceId = UUID.randomUUID();
|
||||
RaceLogDenoteForTrackingEvent expectedEvent = new RaceLogDenoteForTrackingEventImpl(
|
||||
expectedEventTime, expectedEventTime, author, expectedId, expectedPassId,
|
||||
raceName, boatClass, raceId);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogDenoteForTrackingEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -234,9 +247,8 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
String revokedEventType = "type";
|
||||
String revokedEventShortInfo = "short info";
|
||||
String reason = "reason";
|
||||
RaceLogRevokeEvent expectedEvent = eventFactory.createRevokeEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, expectedPassId, revokedEventId,
|
||||
revokedEventType, revokedEventShortInfo, reason);
|
||||
RaceLogRevokeEvent expectedEvent = new RaceLogRevokeEventImpl(expectedEventTime, expectedEventTime, author,
|
||||
expectedId, expectedPassId, revokedEventId, revokedEventType, revokedEventShortInfo, reason);
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogRevokeEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -250,10 +262,10 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
|
||||
@Test
|
||||
public void testStoreAndLoadRegisterCompetitorEvent() {
|
||||
RaceLogRegisterCompetitorEvent expectedEvent = eventFactory.createRegisterCompetitorEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, expectedPassId,
|
||||
DomainFactory.INSTANCE.getOrCreateCompetitor("comp", "comp", null, null, null, null, null,
|
||||
/* timeOnTimeFactor */ null, /* timeOnDistanceAllowancePerNauticalMile */ null));
|
||||
RaceLogRegisterCompetitorEvent expectedEvent = new RaceLogRegisterCompetitorEventImpl(expectedEventTime,
|
||||
expectedEventTime, author, expectedId, expectedPassId, DomainFactory.INSTANCE.getOrCreateCompetitor(
|
||||
"comp", "comp", null, null, null, null, null,
|
||||
/* timeOnTimeFactor */null, /* timeOnDistanceAllowancePerNauticalMile */null));
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogRegisterCompetitorEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -264,9 +276,9 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
|
||||
@Test
|
||||
public void testStoreAndLoadDefineMarkEvent() {
|
||||
RaceLogDefineMarkEvent expectedEvent = eventFactory.createDefineMarkEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, expectedPassId,
|
||||
DomainFactory.INSTANCE.getOrCreateMark("mytestmark"));
|
||||
RaceLogDefineMarkEvent expectedEvent = new RaceLogDefineMarkEventImpl(MillisecondsTimePoint.now(),
|
||||
expectedEventTime, author, expectedId, expectedPassId,
|
||||
DomainFactory.INSTANCE.getOrCreateMark("mytestmark"));
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogDefineMarkEvent actualEvent = loadEvent(dbObject);
|
||||
@@ -277,9 +289,9 @@ public class StoreAndLoadRaceLogEventsTest extends AbstractMongoDBTest {
|
||||
|
||||
@Test
|
||||
public void testStoreAndLoadCloseOpenDeviceMappingEvent() {
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent expectedEvent = eventFactory.createCloseOpenEndedDeviceMappingEvent(
|
||||
expectedEventTime, author, expectedEventTime, expectedId, expectedPassId,
|
||||
UUID.randomUUID(), new MillisecondsTimePoint(49));
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent expectedEvent = new RaceLogCloseOpenEndedDeviceMappingEventImpl(
|
||||
expectedEventTime, expectedEventTime, author, expectedId, expectedPassId, UUID.randomUUID(),
|
||||
new MillisecondsTimePoint(49));
|
||||
|
||||
DBObject dbObject = mongoFactory.storeRaceLogEntry(logIdentifier, expectedEvent);
|
||||
RaceLogCloseOpenEndedDeviceMappingEvent actualEvent = loadEvent(dbObject);
|
||||
|
||||
+2
-5
@@ -6,7 +6,6 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -15,9 +14,8 @@ import com.mongodb.DBObject;
|
||||
import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
@@ -36,7 +34,6 @@ public class StoreAndLoadRaceLogsTest extends AbstractMongoDBTest {
|
||||
.getMongoObjectFactory(getMongoService());
|
||||
protected DomainObjectFactoryImpl domainFactory = (DomainObjectFactoryImpl) PersistenceFactory.INSTANCE
|
||||
.getDomainObjectFactory(getMongoService(), DomainFactory.INSTANCE);
|
||||
protected RaceLogEventFactory eventFactory = RaceLogEventFactory.INSTANCE;
|
||||
|
||||
public StoreAndLoadRaceLogsTest() throws UnknownHostException, MongoException {
|
||||
super();
|
||||
@@ -99,7 +96,7 @@ public class StoreAndLoadRaceLogsTest extends AbstractMongoDBTest {
|
||||
}
|
||||
|
||||
private RaceLogFlagEvent createRaceLogFlagEvent(Serializable id) {
|
||||
return eventFactory.createFlagEvent(new MillisecondsTimePoint(42), new LogEventAuthorImpl("Test author", /* priority */ 1), id, Collections.<Competitor> emptyList(),
|
||||
return new RaceLogFlagEventImpl(MillisecondsTimePoint.now(), new MillisecondsTimePoint(42), new LogEventAuthorImpl("Test author", /* priority */ 1), id,
|
||||
42, Flags.ALPHA, Flags.BRAVO, true);
|
||||
}
|
||||
|
||||
|
||||
+4
-3
@@ -13,8 +13,9 @@ import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceCompetitorMappingEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.tracking.impl.RaceLogDeviceMarkMappingEventImpl;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
import com.sap.sailing.domain.base.Mark;
|
||||
@@ -86,8 +87,8 @@ public class StoreGPSFixTrackTest extends AbstractMongoDBTest {
|
||||
store.storeFix(device2, fix4);
|
||||
|
||||
RaceLog raceLog = new RaceLogImpl("racelog");
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceCompetitorMappingEvent(time0, author, device1, comp, 0, time0, time1));
|
||||
raceLog.add(RaceLogEventFactory.INSTANCE.createDeviceMarkMappingEvent(time0, author, device2, mark, 0, time0, time1));
|
||||
raceLog.add(new RaceLogDeviceCompetitorMappingEventImpl(time0, author, 0, comp, device1, time0, time1));
|
||||
raceLog.add(new RaceLogDeviceMarkMappingEventImpl(time0, author, 0, mark, device2, time0, time1));
|
||||
|
||||
DynamicGPSFixMovingTrackImpl<Competitor> track1 = new DynamicGPSFixMovingTrackImpl<>(comp, 0);
|
||||
store.loadCompetitorTrack(track1, raceLog, comp);
|
||||
|
||||
+4
-3
@@ -10,9 +10,10 @@ import org.junit.Test;
|
||||
|
||||
import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogProtestStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.base.Fleet;
|
||||
import com.sap.sailing.domain.base.Series;
|
||||
import com.sap.sailing.domain.base.impl.FleetImpl;
|
||||
@@ -50,9 +51,9 @@ public class TestRaceLogRemovalInRegatta extends AbstractTestStoringAndRetrievin
|
||||
Fleet blueFleet = qualification.getFleetByName(blueFleetName);
|
||||
RaceLog yellowLog = qualification.getRaceColumnByName(raceColumnName).getRaceLog(yellowFleet);
|
||||
RaceLog blueLog = qualification.getRaceColumnByName(raceColumnName).getRaceLog(blueFleet);
|
||||
RaceLogProtestStartTimeEvent expectedEventYellow = RaceLogEventFactory.INSTANCE.createProtestStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogProtestStartTimeEvent expectedEventYellow = new RaceLogProtestStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
yellowLog.add(expectedEventYellow);
|
||||
RaceLogStartTimeEvent expectedEventBlue = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogStartTimeEvent expectedEventBlue = new RaceLogStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
blueLog.add(expectedEventBlue);
|
||||
// these events are now expected to be stored persistently in the race log store
|
||||
//getLastError() is now deprecated - seems to run fine without (at least locally)
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ import com.mongodb.DBObject;
|
||||
import com.mongodb.MongoException;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.domain.persistence.PersistenceFactory;
|
||||
import com.sap.sailing.domain.persistence.impl.DomainObjectFactoryImpl;
|
||||
@@ -71,7 +71,7 @@ public class TestStoringAndRetrievingRaceLogEventData extends AbstractMongoDBTes
|
||||
@Test
|
||||
public void storeRaceLogFlagEvent() throws UnknownHostException, MongoException, InterruptedException {
|
||||
TimePoint now = MillisecondsTimePoint.now();
|
||||
RaceLogFlagEvent rcEvent = RaceLogEventFactory.INSTANCE.createFlagEvent(now, author, 0, Flags.AP, Flags.ALPHA, true);
|
||||
RaceLogFlagEvent rcEvent = new RaceLogFlagEventImpl(now, author, 0, Flags.AP, Flags.ALPHA, true);
|
||||
{
|
||||
DBObject rcEventForMongo = ((MongoObjectFactoryImpl) PersistenceFactory.INSTANCE.getDefaultMongoObjectFactory())
|
||||
.storeRaceLogFlagEvent(rcEvent);
|
||||
|
||||
+31
-18
@@ -27,7 +27,6 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogDependentStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
@@ -41,7 +40,21 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.SimpleRaceLogIdentifier;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseAreaChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogDependentStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogEventComparator;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.SimpleRaceLogIdentifierImpl;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
@@ -107,7 +120,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogProtestStartTimeEvent() {
|
||||
RaceLogProtestStartTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createProtestStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogProtestStartTimeEvent expectedEvent = new RaceLogProtestStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, expectedEvent);
|
||||
RaceLog loadedRaceLog = retrieveRaceLog();
|
||||
loadedRaceLog.lockForRead();
|
||||
@@ -126,7 +139,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testThatRemoveRaceColumnAlsoRemovesPersistentRaceLog() {
|
||||
RaceLogProtestStartTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createProtestStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogProtestStartTimeEvent expectedEvent = new RaceLogProtestStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
Fleet defaultFleet = leaderboard.getFleet(null);
|
||||
RaceColumn raceColumn = leaderboard.getRaceColumnByName(raceColumnName);
|
||||
raceColumn.getRaceLog(defaultFleet).add(expectedEvent);
|
||||
@@ -152,7 +165,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
when(service.getMongoObjectFactory()).thenReturn(mongoObjectFactory);
|
||||
when(service.getLeaderboardByName(leaderboardName)).thenReturn(leaderboard);
|
||||
doCallRealMethod().when(service).renameLeaderboardColumn(Matchers.anyString(), Matchers.anyString(), Matchers.anyString());
|
||||
RaceLogProtestStartTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createProtestStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogProtestStartTimeEvent expectedEvent = new RaceLogProtestStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
Fleet defaultFleet = leaderboard.getFleet(null);
|
||||
RaceColumn raceColumn = leaderboard.getRaceColumnByName(raceColumnName);
|
||||
raceColumn.getRaceLog(defaultFleet).add(expectedEvent);
|
||||
@@ -195,7 +208,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogStartProcedureChangedEvent() {
|
||||
RaceLogStartProcedureChangedEvent expectedEvent = RaceLogEventFactory.INSTANCE.createStartProcedureChangedEvent(now, author, 0, RacingProcedureType.ESS);
|
||||
RaceLogStartProcedureChangedEvent expectedEvent = new RaceLogStartProcedureChangedEventImpl(now, author, 0, RacingProcedureType.ESS);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, expectedEvent);
|
||||
|
||||
@@ -217,7 +230,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogGateLineOpeningTimeEvent() {
|
||||
RaceLogGateLineOpeningTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createGateLineOpeningTimeEvent(now, author, 0, 1234l, 54321l);
|
||||
RaceLogGateLineOpeningTimeEvent expectedEvent = new RaceLogGateLineOpeningTimeEventImpl(now, author, 0, 1234l, 54321l);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, expectedEvent);
|
||||
|
||||
@@ -239,7 +252,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogPathfinderEvent() {
|
||||
RaceLogPathfinderEvent expectedEvent = RaceLogEventFactory.INSTANCE.createPathfinderEvent(now, author, 0, "GER 20");
|
||||
RaceLogPathfinderEvent expectedEvent = new RaceLogPathfinderEventImpl(now, author, 0, "GER 20");
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, expectedEvent);
|
||||
|
||||
@@ -261,7 +274,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogPassChangeEvent() {
|
||||
RaceLogPassChangeEvent event = RaceLogEventFactory.INSTANCE.createPassChangeEvent(now, author, 0);
|
||||
RaceLogPassChangeEvent event = new RaceLogPassChangeEventImpl(now, author, 0);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -288,7 +301,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new com.sap.sse.common.Util.Triple<Serializable, String, MaxPointsReason>(storedCompetitor.getId(), storedCompetitor.getName(), MaxPointsReason.NONE));
|
||||
|
||||
RaceLogFinishPositioningConfirmedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningConfirmedEvent(now, author, 0, storedPositioningList);
|
||||
RaceLogFinishPositioningConfirmedEvent event = new RaceLogFinishPositioningConfirmedEventImpl(now, author, 0, storedPositioningList);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -309,7 +322,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithBackwardsCompatibleRaceLogFinishPositioningConfirmedEvent() {
|
||||
RaceLogFinishPositioningConfirmedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningConfirmedEvent(now, author, 0, null);
|
||||
RaceLogFinishPositioningConfirmedEvent event = new RaceLogFinishPositioningConfirmedEventImpl(now, author, 0, null);
|
||||
|
||||
createAndStoreOldRaceLogFinishPositioningConfirmedEventDBEntry();
|
||||
|
||||
@@ -358,7 +371,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new com.sap.sse.common.Util.Triple<Serializable, String, MaxPointsReason>(storedCompetitor.getId(), storedCompetitor.getName(), MaxPointsReason.NONE));
|
||||
|
||||
RaceLogFinishPositioningListChangedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningListChangedEvent(now, author, 0, storedPositioningList);
|
||||
RaceLogFinishPositioningListChangedEvent event = new RaceLogFinishPositioningListChangedEventImpl(now, author, 0, storedPositioningList);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -385,7 +398,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogCourseAreaChangeEvent() {
|
||||
final UUID uuid = UUID.randomUUID();
|
||||
RaceLogCourseAreaChangedEvent event = RaceLogEventFactory.INSTANCE.createCourseAreaChangedEvent(now, author, 0, uuid);
|
||||
RaceLogCourseAreaChangedEvent event = new RaceLogCourseAreaChangeEventImpl(now, author, 0, uuid);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -409,7 +422,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogRaceStatusEvent() {
|
||||
|
||||
RaceLogRaceStatusEvent event = RaceLogEventFactory.INSTANCE.createRaceStatusEvent(now, author, 0, RaceLogRaceStatus.SCHEDULED);
|
||||
RaceLogRaceStatusEvent event = new RaceLogRaceStatusEventImpl(now, author, 0, RaceLogRaceStatus.SCHEDULED);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -432,7 +445,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogStartTimeEvent() {
|
||||
|
||||
RaceLogStartTimeEvent event = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now, author, 0, now);
|
||||
RaceLogStartTimeEvent event = new RaceLogStartTimeEventImpl(now, author, 0, now);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -456,7 +469,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogFlagEvent() {
|
||||
|
||||
RaceLogFlagEvent event = RaceLogEventFactory.INSTANCE.createFlagEvent(now, author, 0, Flags.FIRSTSUBSTITUTE, Flags.NONE, true);
|
||||
RaceLogFlagEvent event = new RaceLogFlagEventImpl(now, author, 0, Flags.FIRSTSUBSTITUTE, Flags.NONE, true);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -480,7 +493,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogCourseDesignChangedEvent() {
|
||||
CourseBase course = createCourseBase();
|
||||
RaceLogCourseDesignChangedEvent event = RaceLogEventFactory.INSTANCE.createCourseDesignChangedEvent(now, author, 0, course);
|
||||
RaceLogCourseDesignChangedEvent event = new RaceLogCourseDesignChangedEventImpl(now, author, 0, course);
|
||||
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
|
||||
@@ -503,7 +516,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
@Test
|
||||
public void testStoreAndRetrieveSimpleLeaderboardWithRaceLogWindFixEvent() {
|
||||
Wind wind = createWindFix();
|
||||
RaceLogWindFixEvent event = RaceLogEventFactory.INSTANCE.createWindFixEvent(now, author, 0, wind, /* isMagnetic */ false);
|
||||
RaceLogWindFixEvent event = new RaceLogWindFixEventImpl(now, author, 0, wind, /* isMagnetic */ false);
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
RaceLog loadedRaceLog = retrieveRaceLog();
|
||||
loadedRaceLog.lockForRead();
|
||||
@@ -527,7 +540,7 @@ public class TestStoringAndRetrievingRaceLogInLeaderboards extends RaceLogMongoD
|
||||
final String COLUMN = "column";
|
||||
final String FLEET = "fleet";
|
||||
final SimpleRaceLogIdentifier srli = new SimpleRaceLogIdentifierImpl(PARENT, COLUMN, FLEET);
|
||||
RaceLogDependentStartTimeEvent event = RaceLogEventFactory.INSTANCE.createDependentStartTimeEvent(
|
||||
RaceLogDependentStartTimeEvent event = new RaceLogDependentStartTimeEventImpl(
|
||||
now, author, 0, srli, Duration.ONE_MINUTE);
|
||||
addAndStoreRaceLogEvent(leaderboard, raceColumnName, event);
|
||||
RaceLog loadedRaceLog = retrieveRaceLog();
|
||||
|
||||
+27
-15
@@ -20,7 +20,6 @@ import com.sap.sailing.domain.abstractlog.race.RaceLog;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseAreaChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogCourseDesignChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventFactory;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningConfirmedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFinishPositioningListChangedEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogFlagEvent;
|
||||
@@ -33,6 +32,19 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogStartProcedureChangedEvent
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogWindFixEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.CompetitorResultsImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseAreaChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningConfirmedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFinishPositioningListChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogFlagEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogGateLineOpeningTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPassChangeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogPathfinderEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogProtestStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartProcedureChangedEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogStartTimeEventImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogWindFixEventImpl;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.base.CourseBase;
|
||||
import com.sap.sailing.domain.base.DomainFactory;
|
||||
@@ -84,7 +96,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogProtestStartTimeEvent() {
|
||||
RaceLogProtestStartTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createProtestStartTimeEvent(now, author, 0, MillisecondsTimePoint.now());
|
||||
RaceLogProtestStartTimeEvent expectedEvent = new RaceLogProtestStartTimeEventImpl(now, author, 0, MillisecondsTimePoint.now());
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, expectedEvent);
|
||||
RaceLog loadedRaceLog = retrieveRaceLog();
|
||||
loadedRaceLog.lockForRead();
|
||||
@@ -103,7 +115,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogStartProcedureChangedEvent() {
|
||||
RaceLogStartProcedureChangedEvent expectedEvent = RaceLogEventFactory.INSTANCE.createStartProcedureChangedEvent(now, author, 0, RacingProcedureType.ESS);
|
||||
RaceLogStartProcedureChangedEvent expectedEvent = new RaceLogStartProcedureChangedEventImpl(now, author, 0, RacingProcedureType.ESS);
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, expectedEvent);
|
||||
RaceLog loadedRaceLog = retrieveRaceLog();
|
||||
loadedRaceLog.lockForRead();
|
||||
@@ -122,7 +134,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogPathfinderEvent() {
|
||||
RaceLogPathfinderEvent expectedEvent = RaceLogEventFactory.INSTANCE.createPathfinderEvent(now, author, 0, "GER 20");
|
||||
RaceLogPathfinderEvent expectedEvent = new RaceLogPathfinderEventImpl(now, author, 0, "GER 20");
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, expectedEvent);
|
||||
|
||||
@@ -144,7 +156,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogGateLineOpeningTimeEvent() {
|
||||
RaceLogGateLineOpeningTimeEvent expectedEvent = RaceLogEventFactory.INSTANCE.createGateLineOpeningTimeEvent(now, author, 0, 1234l, 54321l);
|
||||
RaceLogGateLineOpeningTimeEvent expectedEvent = new RaceLogGateLineOpeningTimeEventImpl(now, author, 0, 1234l, 54321l);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, expectedEvent);
|
||||
|
||||
@@ -166,7 +178,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogPassChangeEvent() {
|
||||
RaceLogPassChangeEvent event = RaceLogEventFactory.INSTANCE.createPassChangeEvent(now, author, 0);
|
||||
RaceLogPassChangeEvent event = new RaceLogPassChangeEventImpl(now, author, 0);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -192,7 +204,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new com.sap.sse.common.Util.Triple<Serializable, String, MaxPointsReason>(storedCompetitor.getId(), storedCompetitor.getName(), MaxPointsReason.NONE));
|
||||
|
||||
RaceLogFinishPositioningListChangedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningListChangedEvent(now, author, 0, storedPositioningList);
|
||||
RaceLogFinishPositioningListChangedEvent event = new RaceLogFinishPositioningListChangedEventImpl(now, author, 0, storedPositioningList);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -223,7 +235,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
CompetitorResults storedPositioningList = new CompetitorResultsImpl();
|
||||
storedPositioningList.add(new com.sap.sse.common.Util.Triple<Serializable, String, MaxPointsReason>(storedCompetitor.getId(), storedCompetitor.getName(), MaxPointsReason.NONE));
|
||||
|
||||
RaceLogFinishPositioningConfirmedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningConfirmedEvent(now, author, 0, storedPositioningList);
|
||||
RaceLogFinishPositioningConfirmedEvent event = new RaceLogFinishPositioningConfirmedEventImpl(now, author, 0, storedPositioningList);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -249,7 +261,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithBackwardsCompatibleRaceLogFinishPositioningConfirmedEvent() {
|
||||
RaceLogFinishPositioningConfirmedEvent event = RaceLogEventFactory.INSTANCE.createFinishPositioningConfirmedEvent(now, author, 0, null);
|
||||
RaceLogFinishPositioningConfirmedEvent event = new RaceLogFinishPositioningConfirmedEventImpl(now, author, 0, null);
|
||||
|
||||
createAndStoreOldRaceLogFinishPositioningConfirmedEventDBEntry();
|
||||
|
||||
@@ -295,7 +307,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogCourseAreaChangeEvent() {
|
||||
final UUID uuid = UUID.randomUUID();
|
||||
RaceLogCourseAreaChangedEvent event = RaceLogEventFactory.INSTANCE.createCourseAreaChangedEvent(now, author, 0, uuid);
|
||||
RaceLogCourseAreaChangedEvent event = new RaceLogCourseAreaChangeEventImpl(now, author, 0, uuid);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -318,7 +330,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogRaceStatusEvent() {
|
||||
|
||||
RaceLogRaceStatusEvent event = RaceLogEventFactory.INSTANCE.createRaceStatusEvent(now, author, 0, RaceLogRaceStatus.SCHEDULED);
|
||||
RaceLogRaceStatusEvent event = new RaceLogRaceStatusEventImpl(now, author, 0, RaceLogRaceStatus.SCHEDULED);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -341,7 +353,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogStartTimeEvent() {
|
||||
|
||||
RaceLogStartTimeEvent event = RaceLogEventFactory.INSTANCE.createStartTimeEvent(now, author, 0, now);
|
||||
RaceLogStartTimeEvent event = new RaceLogStartTimeEventImpl(now, author, 0, now);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -365,7 +377,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogFlagEvent() {
|
||||
|
||||
RaceLogFlagEvent event = RaceLogEventFactory.INSTANCE.createFlagEvent(now, author, 0, Flags.FIRSTSUBSTITUTE, Flags.NONE, true);
|
||||
RaceLogFlagEvent event = new RaceLogFlagEventImpl(now, author, 0, Flags.FIRSTSUBSTITUTE, Flags.NONE, true);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -389,7 +401,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogCourseDesignChangedEvent() {
|
||||
CourseBase course = createCourseBase();
|
||||
RaceLogCourseDesignChangedEvent event = RaceLogEventFactory.INSTANCE.createCourseDesignChangedEvent(now, author, 0, course);
|
||||
RaceLogCourseDesignChangedEvent event = new RaceLogCourseDesignChangedEventImpl(now, author, 0, course);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
@@ -412,7 +424,7 @@ public class TestStoringAndRetrievingRaceLogInRegatta extends AbstractTestStorin
|
||||
@Test
|
||||
public void testStoreAndRetrieveRegattaWithRaceLogWindFixEvent() {
|
||||
Wind wind = createWindFix();
|
||||
RaceLogWindFixEvent event = RaceLogEventFactory.INSTANCE.createWindFixEvent(now, author, 0, wind, /* isMagnetic */ false);
|
||||
RaceLogWindFixEvent event = new RaceLogWindFixEventImpl(now, author, 0, wind, /* isMagnetic */ false);
|
||||
|
||||
addAndStoreRaceLogEvent(regatta, raceColumnName, event);
|
||||
|
||||
|
||||
+2
-1
@@ -1,12 +1,13 @@
|
||||
package com.sap.sailing.server.gateway.deserialization.impl;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.configuration.RacingProcedureConfiguration;
|
||||
import com.sap.sailing.domain.base.configuration.impl.LeagueConfigurationImpl;
|
||||
import com.sap.sailing.domain.base.configuration.procedures.LeagueConfiguration;
|
||||
import com.sap.sailing.domain.common.racelog.Flags;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializer;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class LeagueConfigurationJsonDeserializer extends RacingProcedureConfigurationJsonDeserializer implements
|
||||
JsonDeserializer<RacingProcedureConfiguration> {
|
||||
|
||||
+2
-1
@@ -1,5 +1,7 @@
|
||||
package com.sap.sailing.server.gateway.deserialization.impl;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import com.sap.sailing.domain.base.configuration.RacingProcedureConfiguration;
|
||||
import com.sap.sailing.domain.base.configuration.RegattaConfiguration;
|
||||
import com.sap.sailing.domain.base.configuration.impl.RegattaConfigurationImpl;
|
||||
@@ -12,7 +14,6 @@ import com.sap.sailing.domain.common.racelog.RacingProcedureType;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializer;
|
||||
import com.sap.sailing.server.gateway.serialization.impl.RegattaConfigurationJsonSerializer;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
public class RegattaConfigurationJsonDeserializer implements JsonDeserializer<RegattaConfiguration> {
|
||||
|
||||
|
||||
-3
@@ -10,7 +10,6 @@ import org.json.simple.JSONObject;
|
||||
import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor;
|
||||
import com.sap.sailing.domain.abstractlog.impl.LogEventAuthorImpl;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEvent;
|
||||
import com.sap.sailing.domain.abstractlog.race.RaceLogEventRestoreFactory;
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializationException;
|
||||
import com.sap.sailing.server.gateway.deserialization.JsonDeserializer;
|
||||
@@ -21,11 +20,9 @@ import com.sap.sse.common.impl.MillisecondsTimePoint;
|
||||
|
||||
public abstract class BaseRaceLogEventDeserializer implements JsonDeserializer<RaceLogEvent> {
|
||||
|
||||
protected RaceLogEventRestoreFactory factory;
|
||||
protected JsonDeserializer<Competitor> competitorDeserializer;
|
||||
|
||||
public BaseRaceLogEventDeserializer(JsonDeserializer<Competitor> competitorDeserializer) {
|
||||
this.factory = RaceLogEventRestoreFactory.INSTANCE;
|
||||
this.competitorDeserializer = competitorDeserializer;
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user