added missing dependency to gwt.ui.test project; use WindSource[] instead of Collection<WindSource> in API

This commit is contained in:
Axel Uhl
2011-12-29 11:44:15 +01:00
parent 420e940b1c
commit 9db25beeba
4 changed files with 21 additions and 31 deletions
@@ -12,7 +12,8 @@ Require-Bundle: com.sap.sailing.gwt.ui,
com.sap.sailing.server,
com.google.gwt.osgi;bundle-version="2.4.0",
org.junit4,
com.sap.sailing.server.api
com.sap.sailing.server.api,
com.sap.sailing.domain.common
Bundle-ClassPath: .
Import-Package: org.osgi.framework,
org.osgi.util.tracker;version="1.5.0"
@@ -7,6 +7,7 @@ import java.util.Map;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.sap.sailing.domain.common.WindSource;
import com.sap.sailing.gwt.ui.shared.CompetitorDAO;
import com.sap.sailing.gwt.ui.shared.CompetitorInRaceDAO;
import com.sap.sailing.gwt.ui.shared.CompetitorsAndTimePointsDAO;
@@ -50,7 +51,7 @@ public interface SailingService extends RemoteService {
void removeAndUntrackedRace(EventAndRaceIdentifier eventAndRaceidentifier) throws Exception;
WindInfoForRaceDAO getWindInfo(RaceIdentifier raceIdentifier, Date from, Date to, Collection<String> windSources);
WindInfoForRaceDAO getWindInfo(RaceIdentifier raceIdentifier, Date from, Date to, WindSource[] windSources);
void setWind(RaceIdentifier raceIdentifier, WindDAO wind);
@@ -9,7 +9,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sap.sailing.domain.base.Course;
import com.sap.sailing.domain.common.WindSource;
import com.sap.sailing.domain.leaderboard.RaceInLeaderboard;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.gwt.ui.shared.CompetitorDAO;
import com.sap.sailing.gwt.ui.shared.CompetitorInRaceDAO;
import com.sap.sailing.gwt.ui.shared.CompetitorsAndTimePointsDAO;
@@ -70,18 +69,9 @@ public interface SailingServiceAsync {
void removeAndUntrackedRace(EventAndRaceIdentifier eventAndRaceidentifier, AsyncCallback<Void> callback);
/**
* Retrieves wind information for the race identified by <code>raceIdentifier</code>.
*
* @param from
* if <code>null</code>, the race start time will be used instead
* @param to
* if <code>null</code>, the {@link TrackedRace#getTimePointOfNewestEvent() time of the newest event} is
* used instead.
* @param windWources
* if <code>null</code>, all available wind sources will be queries; otherwise, only those whose
* {@link WindSource} name is contained in this collection
* @param windSources if <code>null</code>, information about all available wind sources will be provided
*/
void getWindInfo(RaceIdentifier raceIdentifier, Date from, Date to, Collection<String> windSources,
void getWindInfo(RaceIdentifier raceIdentifier, Date from, Date to, WindSource[] windSources,
AsyncCallback<WindInfoForRaceDAO> callback);
/**
@@ -507,7 +507,7 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
}
@Override
public WindInfoForRaceDAO getWindInfo(RaceIdentifier raceIdentifier, Date fromDate, Date toDate, Collection<String> windSources) {
public WindInfoForRaceDAO getWindInfo(RaceIdentifier raceIdentifier, Date fromDate, Date toDate, WindSource[] windSources) {
WindInfoForRaceDAO result = null;
TrackedRace trackedRace = getTrackedRace(raceIdentifier);
if (trackedRace != null) {
@@ -519,24 +519,22 @@ public class SailingServiceImpl extends RemoteServiceServlet implements SailingS
Map<WindSource, WindTrackInfoDAO> windTrackInfoDAOs = new HashMap<WindSource, WindTrackInfoDAO>();
result.windTrackInfoByWindSource = windTrackInfoDAOs;
if (from != null && to != null) {
for (WindSource windSource : WindSource.values()) {
if (windSources == null || windSources.contains(windSource.name())) {
WindTrackInfoDAO windTrackInfoDAO = new WindTrackInfoDAO();
windTrackInfoDAO.windFixes = new ArrayList<WindDAO>();
WindTrack windTrack = trackedRace.getWindTrack(windSource);
windTrackInfoDAO.dampeningIntervalInMilliseconds = windTrack
.getMillisecondsOverWhichToAverageWind();
Iterator<Wind> windIter = windTrack.getFixesIterator(from, /* inclusive */true);
while (windIter.hasNext()) {
Wind wind = windIter.next();
if (wind.getTimePoint().compareTo(to) > 0) {
break;
}
WindDAO windDAO = createWindDAO(wind, windTrack);
windTrackInfoDAO.windFixes.add(windDAO);
for (WindSource windSource : (windSources == null ? WindSource.values() : windSources)) {
WindTrackInfoDAO windTrackInfoDAO = new WindTrackInfoDAO();
windTrackInfoDAO.windFixes = new ArrayList<WindDAO>();
WindTrack windTrack = trackedRace.getWindTrack(windSource);
windTrackInfoDAO.dampeningIntervalInMilliseconds = windTrack
.getMillisecondsOverWhichToAverageWind();
Iterator<Wind> windIter = windTrack.getFixesIterator(from, /* inclusive */true);
while (windIter.hasNext()) {
Wind wind = windIter.next();
if (wind.getTimePoint().compareTo(to) > 0) {
break;
}
windTrackInfoDAOs.put(windSource, windTrackInfoDAO);
WindDAO windDAO = createWindDAO(wind, windTrack);
windTrackInfoDAO.windFixes.add(windDAO);
}
windTrackInfoDAOs.put(windSource, windTrackInfoDAO);
}
}
}