Removed unused methods of SailingService

This commit is contained in:
Steffen Schaefer committed 2015-09-15 14:26:08 +02:00
1 parent 6a1591a9ef
commit ac23ea69e4
3 files changed
-83

No files matched your search

@@ -1,6 +1,5 @@
package com.sap.sailing.gwt.ui.client;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@@ -387,12 +386,8 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
Util.Pair<String, LeaderboardType> checkLeaderboardName(String leaderboardName);
/** for backward compatibility with the regatta overview */
List<RaceGroupDTO> getRegattaStructureForEvent(UUID eventId);
/** the replacement service for getRegattaStructureForEvent() */
List<RaceGroupDTO> getRegattaStructureOfEvent(UUID eventId);
List<RegattaOverviewEntryDTO> getRaceStateEntriesForRaceGroup(UUID eventId, List<UUID> visibleCourseAreas,
List<String> visibleRegattas, boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay)
throws Exception;
@@ -618,8 +613,6 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
void inviteBuoyTenderViaEmail(String serverUrlWithoutTrailingSlash, EventDTO eventDto, String leaderboardName,
String emails, String localeInfoName) throws MailException;
ArrayList<LeaderboardGroupDTO> getLeaderboardGroupsByEventId(UUID id);
boolean doesRegattaLogContainCompetitors(String name) throws DoesNotHaveRegattaLogException;
@@ -1,6 +1,5 @@
package com.sap.sailing.gwt.ui.client;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@@ -500,8 +499,6 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
void getRegattaStructureForEvent(UUID eventId, AsyncCallback<List<RaceGroupDTO>> asyncCallback);
void getRegattaStructureOfEvent(UUID eventId, AsyncCallback<List<RaceGroupDTO>> callback);
void getRaceStateEntriesForRaceGroup(UUID eventId, List<UUID> visibleCourseAreas,
List<String> visibleRegattas, boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay,
AsyncCallback<List<RegattaOverviewEntryDTO>> markedAsyncCallback);
@@ -720,8 +717,6 @@ public interface SailingServiceAsync extends ServerInfoRetriever, FileStorageMan
void inviteBuoyTenderViaEmail(String serverUrlWithoutTrailingSlash, EventDTO eventDto, String leaderboardName,
String emails, String localeInfoName, AsyncCallback<Void> callback);
void getLeaderboardGroupsByEventId(UUID id, AsyncCallback<ArrayList<LeaderboardGroupDTO>> callback);
void doesRegattaLogContainCompetitors(String name, AsyncCallback<Boolean> regattaLogCallBack);
void getRaceIdentifier(String regattaLikeName, String raceColumnName, String fleetName, AsyncCallback<RegattaAndRaceIdentifier> asyncCallback);
@@ -3576,63 +3576,6 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
}
return raceGroups;
}
/** the replacement service for getRegattaStructureForEvent() */
@Override
public List<RaceGroupDTO> getRegattaStructureOfEvent(UUID eventId) {
List<RaceGroupDTO> raceGroups = new ArrayList<RaceGroupDTO>();
Event event = getService().getEvent(eventId);
Map<Leaderboard, LeaderboardGroup> leaderboardWithLeaderboardGroups = new HashMap<Leaderboard, LeaderboardGroup>();
for(LeaderboardGroup leaderboardGroup: event.getLeaderboardGroups()) {
for(Leaderboard leaderboard: leaderboardGroup.getLeaderboards()) {
leaderboardWithLeaderboardGroups.put(leaderboard, leaderboardGroup);
}
}
if (event != null) {
for(LeaderboardGroup leaderboardGroup: event.getLeaderboardGroups()) {
for(Leaderboard leaderboard: leaderboardGroup.getLeaderboards()) {
RaceGroupDTO raceGroup = new RaceGroupDTO(leaderboard.getName());
for (CourseArea courseArea : event.getVenue().getCourseAreas()) {
if (leaderboard.getDefaultCourseArea() != null && leaderboard.getDefaultCourseArea() == courseArea) {
raceGroup.courseAreaIdAsString = courseArea.getId().toString();
break;
}
}
raceGroup.displayName = getRegattaNameFromLeaderboard(leaderboard);
if(leaderboardWithLeaderboardGroups.containsKey(leaderboard)) {
raceGroup.leaderboardGroupName = leaderboardWithLeaderboardGroups.get(leaderboard).getName();
}
if (leaderboard instanceof RegattaLeaderboard) {
RegattaLeaderboard regattaLeaderboard = (RegattaLeaderboard) leaderboard;
raceGroup.boatClass = regattaLeaderboard.getRegatta().getBoatClass().getDisplayName();
for (Series series : regattaLeaderboard.getRegatta().getSeries()) {
RaceGroupSeriesDTO seriesDTO = new RaceGroupSeriesDTO(series.getName());
raceGroup.getSeries().add(seriesDTO);
for (Fleet fleet : series.getFleets()) {
FleetDTO fleetDTO = new FleetDTO(fleet.getName(), fleet.getOrdering(), fleet.getColor());
seriesDTO.getFleets().add(fleetDTO);
}
seriesDTO.getRaceColumns().addAll(convertToRaceColumnDTOs(series.getRaceColumns()));
}
} else {
RaceGroupSeriesDTO seriesDTO = new RaceGroupSeriesDTO(LeaderboardNameConstants.DEFAULT_SERIES_NAME);
raceGroup.getSeries().add(seriesDTO);
FleetDTO fleetDTO = new FleetDTO(LeaderboardNameConstants.DEFAULT_FLEET_NAME, 0, null);
seriesDTO.getFleets().add(fleetDTO);
seriesDTO.getRaceColumns().addAll(convertToRaceColumnDTOs(leaderboard.getRaceColumns()));
for(Competitor c: leaderboard.getCompetitors()) {
if(c.getBoat() != null && c.getBoat().getBoatClass() != null) {
raceGroup.boatClass = c.getBoat().getBoatClass().getDisplayName();
}
}
}
raceGroups.add(raceGroup);
}
}
}
return raceGroups;
}
/**
* The name of the regatta to be shown on the regatta overview webpage is retrieved from the name of the {@link Leaderboard}. Since regattas are
@@ -5751,20 +5694,6 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
getRaceLogTrackingAdapter().inviteBuoyTenderViaEmail(event, leaderboard, serverUrlWithoutTrailingSlash,
emails, getLocale(localeInfoName));
}
@Override
public ArrayList<LeaderboardGroupDTO> getLeaderboardGroupsByEventId(UUID id) {
Event event = getService().getEvent(id);
if (event == null) {
throw new RuntimeException("Event not found");
}
ArrayList<LeaderboardGroupDTO> result = new ArrayList<>();
for (LeaderboardGroup lg : event.getLeaderboardGroups()) {
result.add(convertToLeaderboardGroupDTO(lg, /* withGeoLocationData */false, true));
}
return result;
}
@Override
public boolean doesRegattaLogContainCompetitors(String leaderboardName) throws DoesNotHaveRegattaLogException {