Removed RaceLogStore from RaceColumn implementations and all subsequent

classes
This commit is contained in:
Armin Zamani committed 2013-02-18 01:34:14 +01:00
1 parent e03d4cfe0c
commit ddea60f570
68 files changed
+331 -594

No files matched your search

@@ -38,10 +38,7 @@ import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.Util.Triple;
import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.persistence.MongoFactory;
import com.sap.sailing.domain.persistence.MongoRaceLogStoreFactory;
import com.sap.sailing.domain.persistence.MongoWindStoreFactory;
import com.sap.sailing.domain.racelog.RaceLogStore;
import com.sap.sailing.domain.racelog.impl.EmptyRaceLogStore;
import com.sap.sailing.domain.tracking.DynamicTrackedRace;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.domain.tracking.Wind;
@@ -118,8 +115,6 @@ public class AdminApp extends SailingServerHttpServlet {
private static final String PARAM_NAME_WINDSTORE = "windstore";
private static final String PARAM_NAME_RACELOGSTORE = "racelogstore";
private static final String STORE_EMPTY = "empty";
private static final String STORE_MONGO = "mongo";
@@ -471,7 +466,7 @@ public class AdminApp extends SailingServerHttpServlet {
URL jsonURL = new URL(req.getParameter(PARAM_NAME_EVENT_JSON_URL));
URI liveURI = new URI(req.getParameter(PARAM_NAME_LIVE_URI));
URI storedURI = new URI(req.getParameter(PARAM_NAME_STORED_URI));
getService().addRegatta(jsonURL, liveURI, storedURI, getWindStore(req), /* timeoutInMilliseconds */ 60000, getRaceLogStore(req));
getService().addRegatta(jsonURL, liveURI, storedURI, getWindStore(req), /* timeoutInMilliseconds */ 60000);
}
private WindStore getWindStore(HttpServletRequest req) throws UnknownHostException, MongoException {
@@ -490,29 +485,12 @@ public class AdminApp extends SailingServerHttpServlet {
}
return EmptyWindStore.INSTANCE;
}
private RaceLogStore getRaceLogStore(HttpServletRequest req) throws UnknownHostException, MongoException {
String raceLogStore = req.getParameter(PARAM_NAME_RACELOGSTORE);
if (raceLogStore != null) {
if (raceLogStore.equals(STORE_EMPTY)) {
return EmptyRaceLogStore.INSTANCE;
} else if (raceLogStore.equals(STORE_MONGO)) {
return MongoRaceLogStoreFactory.INSTANCE.getMongoRaceLogStore(
MongoFactory.INSTANCE.getDefaultMongoObjectFactory(),
MongoFactory.INSTANCE.getDefaultDomainObjectFactory());
} else {
log("Couldn't find wind store "+raceLogStore+". Using EmptyWindStore instead.");
return EmptyRaceLogStore.INSTANCE;
}
}
return EmptyRaceLogStore.INSTANCE;
}
private void addRace(HttpServletRequest req, HttpServletResponse resp) throws MongoException, Exception {
URL paramURL = new URL(req.getParameter(PARAM_NAME_PARAM_URL));
URI liveURI = new URI(req.getParameter(PARAM_NAME_LIVE_URI));
URI storedURI = new URI(req.getParameter(PARAM_NAME_STORED_URI));
getService().addTracTracRace(paramURL, liveURI, storedURI, getWindStore(req), /* timeoutInMilliseconds */ 60000, getRaceLogStore(req));
getService().addTracTracRace(paramURL, liveURI, storedURI, getWindStore(req), /* timeoutInMilliseconds */ 60000);
}
private void stopRace(HttpServletRequest req, HttpServletResponse resp) throws MalformedURLException, IOException, InterruptedException {