mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-05 11:53:53 +00:00
renamed TracTrac-specific stuff accordingly
This commit is contained in:
1 parent
f2a93777ac
commit
6589894f16
10 files changed
+12
-11
No files matched your search
+1
-1
@@ -25,5 +25,5 @@ public interface DomainObjectFactory {
|
||||
*
|
||||
* @return messages in ascending sequence number order; always a valid but perhaps empty list
|
||||
*/
|
||||
List<SailMasterMessage> loadMessage(int firstSequenceNumber);
|
||||
List<SailMasterMessage> loadMessages(int firstSequenceNumber);
|
||||
}
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SailMasterMessage> loadMessage(int firstSequenceNumber) {
|
||||
public List<SailMasterMessage> loadMessages(int firstSequenceNumber) {
|
||||
DBCollection rawMessages = database.getCollection(CollectionNames.RAW_MESSAGES.name());
|
||||
BasicDBObject query = new BasicDBObject();
|
||||
if (firstSequenceNumber != -1) {
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class StoreAndForwardTest {
|
||||
DBCollection lastMessageCountCollection = db.getCollection(CollectionNames.LAST_MESSAGE_COUNT.name());
|
||||
Long lastMessageCount = (Long) lastMessageCountCollection.findOne().get(FieldNames.LAST_MESSAGE_COUNT.name());
|
||||
assertEquals((Long) 1l, lastMessageCount);
|
||||
List<SailMasterMessage> rawMessages = domainObjectFactory.loadMessage(0);
|
||||
List<SailMasterMessage> rawMessages = domainObjectFactory.loadMessages(0);
|
||||
assertEquals(1, rawMessages.size());
|
||||
assertEquals(rawMessage, rawMessages.get(0).getMessage());
|
||||
assertEquals(0l, (long) rawMessages.get(0).getSequenceNumber());
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public interface SailingService extends RemoteService {
|
||||
|
||||
List<EventDAO> listEvents();
|
||||
|
||||
Pair<String, List<RaceRecordDAO>> listRacesInEvent(String eventJsonURL) throws Exception;
|
||||
Pair<String, List<RaceRecordDAO>> listTracTracRacesInEvent(String eventJsonURL) throws Exception;
|
||||
|
||||
void track(RaceRecordDAO rr, String liveURI, String storedURI, boolean trackWind, boolean correctWindByDeclination) throws Exception;
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public interface SailingServiceAsync {
|
||||
/**
|
||||
* The string returned in the callback's pair is the common event name
|
||||
*/
|
||||
void listRacesInEvent(String eventJsonURL, AsyncCallback<Pair<String, List<RaceRecordDAO>>> callback);
|
||||
void listTracTracRacesInEvent(String eventJsonURL, AsyncCallback<Pair<String, List<RaceRecordDAO>>> callback);
|
||||
|
||||
/**
|
||||
* @param liveURI may be <code>null</code> or the empty string in which case the server will
|
||||
|
||||
+1
-1
@@ -368,7 +368,7 @@ public class TracTracEventManagementPanel extends FormPanel implements EventDisp
|
||||
final String jsonURL = jsonURLBox.getValue();
|
||||
final String liveDataURI = liveURIBox.getValue();
|
||||
final String storedDataURI = storedURIBox.getValue();
|
||||
sailingService.listRacesInEvent(jsonURL, new AsyncCallback<Pair<String, List<RaceRecordDAO>>>() {
|
||||
sailingService.listTracTracRacesInEvent(jsonURL, new AsyncCallback<Pair<String, List<RaceRecordDAO>>>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
TracTracEventManagementPanel.this.errorReporter.reportError("Error trying to list races: "
|
||||
|
||||
+2
-2
@@ -321,10 +321,10 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<String, List<RaceRecordDAO>> listRacesInEvent(String eventJsonURL) throws MalformedURLException, IOException,
|
||||
public Pair<String, List<RaceRecordDAO>> listTracTracRacesInEvent(String eventJsonURL) throws MalformedURLException, IOException,
|
||||
ParseException, org.json.simple.parser.ParseException, URISyntaxException {
|
||||
com.sap.sailing.util.Util.Pair<String,List<RaceRecord>> raceRecords;
|
||||
raceRecords = getService().getRaceRecords(new URL(eventJsonURL));
|
||||
raceRecords = getService().getTracTracRaceRecords(new URL(eventJsonURL));
|
||||
List<RaceRecordDAO> result = new ArrayList<RaceRecordDAO>();
|
||||
for (RaceRecord raceRecord : raceRecords.getB()) {
|
||||
result.add(new RaceRecordDAO(raceRecord.getID(), raceRecord.getEventName(), raceRecord.getName(),
|
||||
|
||||
@@ -191,7 +191,7 @@ public class AdminApp extends Servlet {
|
||||
private void listRacesInEvent(HttpServletRequest req, HttpServletResponse resp) throws IOException, ParseException,
|
||||
org.json.simple.parser.ParseException, URISyntaxException {
|
||||
URL jsonURL = new URL(req.getParameter(PARAM_NAME_EVENT_JSON_URL));
|
||||
List<RaceRecord> raceRecords = getService().getRaceRecords(jsonURL).getB();
|
||||
List<RaceRecord> raceRecords = getService().getTracTracRaceRecords(jsonURL).getB();
|
||||
JSONArray result = new JSONArray();
|
||||
for (RaceRecord raceRecord : raceRecords) {
|
||||
JSONObject jsonRaceRecord = new JSONObject();
|
||||
|
||||
@@ -135,7 +135,8 @@ public interface RacingEventService {
|
||||
* calls to individually start tracking races of this event, rather than tracking <em>all</em> races in the event which
|
||||
* is hardly ever useful. The returned pair's first component is the event name.
|
||||
*/
|
||||
Pair<String, List<RaceRecord>> getRaceRecords(URL jsonURL) throws IOException, ParseException, org.json.simple.parser.ParseException, URISyntaxException;
|
||||
Pair<String, List<RaceRecord>> getTracTracRaceRecords(URL jsonURL) throws IOException, ParseException,
|
||||
org.json.simple.parser.ParseException, URISyntaxException;
|
||||
|
||||
boolean isRaceBeingTracked(RaceDefinition r);
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ public class RacingEventServiceImpl implements RacingEventService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pair<String, List<RaceRecord>> getRaceRecords(URL jsonURL) throws IOException, ParseException, org.json.simple.parser.ParseException, URISyntaxException {
|
||||
public Pair<String, List<RaceRecord>> getTracTracRaceRecords(URL jsonURL) throws IOException, ParseException, org.json.simple.parser.ParseException, URISyntaxException {
|
||||
JSONService jsonService = getDomainFactory().parseJSONURL(jsonURL);
|
||||
return new Pair<String, List<RaceRecord>>(jsonService.getEventName(), jsonService.getRaceRecords());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user