mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 20:03:52 +00:00
added missing files
This commit is contained in:
1 parent
8831770f00
commit
9b4ca2fe6a
2 files changed
+64
No files matched your search
+28
@@ -0,0 +1,28 @@
|
||||
package com.sap.sailing.domain.tractracadapter;
|
||||
|
||||
import com.sap.sailing.domain.base.Event;
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedEvent;
|
||||
import com.sap.sailing.domain.tractracadapter.impl.RaceCourseReceiver;
|
||||
|
||||
/**
|
||||
* Gives clients a way to refer to a specific race even though the {@link RaceDefinition} object may not have
|
||||
* been created yet, but without exposing the TracTrac internals. The {@link #getRace()} call will block
|
||||
* until the {@link RaceDefinition} has been created.
|
||||
*
|
||||
* @author Axel Uhl (d043530)
|
||||
*
|
||||
*/
|
||||
public interface RaceHandle {
|
||||
|
||||
Event getEvent();
|
||||
|
||||
/**
|
||||
* Fetch the race definition. If the race definition represented by this handle hasn't been created yet, the call
|
||||
* blocks until such a definition is provided by another call, usually by the {@link RaceCourseReceiver}.
|
||||
*/
|
||||
RaceDefinition getRace();
|
||||
|
||||
DynamicTrackedEvent getTrackedEvent();
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.sap.sailing.domain.tractracadapter.impl;
|
||||
|
||||
import com.sap.sailing.domain.base.RaceDefinition;
|
||||
import com.sap.sailing.domain.tracking.DynamicTrackedEvent;
|
||||
import com.sap.sailing.domain.tractracadapter.DomainFactory;
|
||||
import com.sap.sailing.domain.tractracadapter.RaceHandle;
|
||||
import com.tractrac.clientmodule.Event;
|
||||
|
||||
public class RaceHandleImpl implements RaceHandle {
|
||||
private final Event tractracEvent;
|
||||
private final DomainFactory domainFactory;
|
||||
private final DynamicTrackedEvent trackedEvent;
|
||||
|
||||
public RaceHandleImpl(DomainFactory domainFactory, Event tractracEvent, DynamicTrackedEvent trackedEvent) {
|
||||
this.domainFactory = domainFactory;
|
||||
this.tractracEvent = tractracEvent;
|
||||
this.trackedEvent = trackedEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public com.sap.sailing.domain.base.Event getEvent() {
|
||||
return domainFactory.createEvent(tractracEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RaceDefinition getRace() {
|
||||
// we assume there is exactly one Race per TracTrac event
|
||||
return domainFactory.getRaceDefinition(tractracEvent.getRaceList().iterator().next());
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicTrackedEvent getTrackedEvent() {
|
||||
return trackedEvent;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user