mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 20:13:52 +00:00
Added RecordCompetitorSensorFixTrack for SensorFixTrack replication
This commit is contained in:
1 parent
49387e51f2
commit
538ec12b76
6 files changed
+78
No files matched your search
+46
@@ -0,0 +1,46 @@
|
||||
package com.sap.sailing.server.operationaltransformation;
|
||||
|
||||
import com.sap.sailing.domain.base.Competitor;
|
||||
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
|
||||
import com.sap.sailing.domain.tracking.DynamicSensorFixTrack;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
|
||||
import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.RacingEventServiceOperation;
|
||||
|
||||
public class RecordCompetitorSensorFixTrack extends AbstractRaceOperation<Void> {
|
||||
private static final long serialVersionUID = -7092704633177037511L;
|
||||
private DynamicSensorFixTrack<Competitor, ?> track;
|
||||
|
||||
public RecordCompetitorSensorFixTrack(RegattaAndRaceIdentifier raceIdentifier, DynamicSensorFixTrack<Competitor, ?> track) {
|
||||
super(raceIdentifier);
|
||||
this.track = track;
|
||||
}
|
||||
|
||||
/**
|
||||
* Operations of this type can be run in parallel to other operations; subsequent operations do not have to wait
|
||||
* for this operation's completion.
|
||||
*/
|
||||
@Override
|
||||
public boolean requiresSynchronousExecution() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalApplyTo(RacingEventService toState) throws Exception {
|
||||
DynamicTrackedRace trackedRace = (DynamicTrackedRace) toState.getTrackedRace(getRaceIdentifier());
|
||||
trackedRace.addSensorTrack(track.getTrackedItem(), track.getTrackName(), track);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventServiceOperation<?> transformClientOp(RacingEventServiceOperation<?> serverOp) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RacingEventServiceOperation<?> transformServerOp(RacingEventServiceOperation<?> clientOp) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user