Merge branch 'master' into bug5275

This commit is contained in:
Axel Uhl committed 2020-05-15 10:37:05 +02:00
commit 4f431c8fc0
45 files changed
+203 -1464

No files matched your search

@@ -1,12 +0,0 @@
package com.sap.sailing.domain.common;
import java.io.Serializable;
import java.util.List;
import com.sap.sse.common.Util.Pair;
public interface PolarSheetsXYDiagramData extends Serializable {
List<Pair<Double, Double>> getPointsForAverageSpeedRegression(Tack tack, LegType legType);
}
@@ -1,6 +1,10 @@
package com.sap.sailing.domain.common.dto;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.sap.sse.common.Util;
public class PairingListTemplateDTO implements Serializable {
@@ -15,7 +19,7 @@ public class PairingListTemplateDTO implements Serializable {
private int[][] pairingListTemplate;
private double quality;
private double boatAssignmentQuality;
private Iterable<String> selectedFlightNames;
private List<String> selectedFlightNames;
public PairingListTemplateDTO() { }
@@ -50,7 +54,8 @@ public class PairingListTemplateDTO implements Serializable {
this.boatAssignmentQuality = boatAssigmentQuality;
this.quality = quality;
this.pairingListTemplate = pairingListTemplate;
this.selectedFlightNames = selectedFlightNames;
this.selectedFlightNames = new ArrayList<>();
Util.addAll(selectedFlightNames, this.selectedFlightNames);
}
public void setFlightCount(int flightCount) {
@@ -69,7 +74,7 @@ public class PairingListTemplateDTO implements Serializable {
this.boatChangeFactor = tolerance;
}
public void setSelectedFlightNames(Iterable<String> selectedFlightNames) {
public void setSelectedFlightNames(List<String> selectedFlightNames) {
this.selectedFlightNames = selectedFlightNames;
}
@@ -109,7 +114,7 @@ public class PairingListTemplateDTO implements Serializable {
return boatChangeFactor;
}
public Iterable<String> getSelectedFlightNames() {
public List<String> getSelectedFlightNames() {
return selectedFlightNames;
}
@@ -1,29 +0,0 @@
package com.sap.sailing.domain.common.impl;
import java.util.List;
import java.util.Map;
import com.sap.sailing.domain.common.LegType;
import com.sap.sailing.domain.common.PolarSheetsXYDiagramData;
import com.sap.sailing.domain.common.Tack;
import com.sap.sse.common.Util.Pair;
public class PolarSheetsXYDiagramDataImpl implements PolarSheetsXYDiagramData {
private static final long serialVersionUID = 778667444303004468L;
PolarSheetsXYDiagramDataImpl() {
}
private Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> pointsForAverageSpeedRegression;
public PolarSheetsXYDiagramDataImpl(
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> regressionSpeedDataLists) {
pointsForAverageSpeedRegression = regressionSpeedDataLists;
}
@Override
public List<Pair<Double, Double>> getPointsForAverageSpeedRegression(Tack tack, LegType legType) {
return pointsForAverageSpeedRegression.get(new Pair<LegType, Tack>(legType, tack));
}
}
@@ -70,8 +70,6 @@ public interface DomainFactory {
MarkPassing createMarkPassing(TimePoint timePoint, Waypoint waypoint, Competitor competitor);
void removeRace(String raceID);
RaceType getRaceTypeFromRaceID(String raceID);
RaceTrackingConnectivityParameters createTrackingConnectivityParameters(String hostname, int port, String raceID,
@@ -6,12 +6,10 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Logger;
@@ -401,24 +399,6 @@ public class DomainFactoryImpl implements DomainFactory {
return baseDomainFactory.createMarkPassing(timePoint, waypoint, competitor);
}
@Override
public void removeRace(String raceID) {
Regatta regatta = raceIDToRegattaCache.get(raceID);
if (regatta != null) {
Set<RaceDefinition> toRemove = new HashSet<RaceDefinition>();
RaceDefinition race = regatta.getRaceByName(raceID);
if (race != null) {
toRemove.add(race);
}
for (RaceDefinition raceToRemove : toRemove) {
regatta.removeRace(raceToRemove);
}
if (Util.isEmpty(regatta.getAllRaces())) {
raceIDToRegattaCache.remove(raceID);
}
}
}
@Override
public Nationality getOrCreateNationality(String threeLetterIOCCode) {
return baseDomainFactory.getOrCreateNationality(threeLetterIOCCode);
@@ -334,14 +334,6 @@ public interface DomainFactory {
*/
Iterable<IControl> getControlsForCourseArea(IEvent tracTracEvent, String tracTracCourseAreaName);
/**
* Since TracAPI 3.6.1 the TracAPI provides a course area name for {@link IRace} objects. Furthermore, the
* {@link IControl} control points can now tell their {@link IControl#getCourseArea() course area}. This allows us
* to fetch the {@link IControlPoint}s for a specific course area, thereby, e.g., restricting the marks of an event
* that we offer to the Race Manager app's course designer to those available on the course area.
*/
Iterable<IControlPoint> getControlPointsForCourseArea(IEvent tracTracEvent, String tracTracCourseAreaName);
/**
* Looks for an {@link IControl} in the {@code candidates} that contains two {@link IControlPoint}s that map to the
* {@code first} and {@code second} mark.
@@ -112,7 +112,6 @@ import com.tractrac.model.lib.api.event.IEvent;
import com.tractrac.model.lib.api.event.IRace;
import com.tractrac.model.lib.api.event.IRaceCompetitor;
import com.tractrac.model.lib.api.route.IControl;
import com.tractrac.model.lib.api.route.IControlPoint;
import com.tractrac.subscription.lib.api.IEventSubscriber;
import com.tractrac.subscription.lib.api.IRaceSubscriber;
import com.tractrac.subscription.lib.api.SubscriberInitializationException;
@@ -703,15 +702,6 @@ public class DomainFactoryImpl implements DomainFactory {
}
}
@Override
public Iterable<IControlPoint> getControlPointsForCourseArea(IEvent tracTracEvent, String tracTracCourseAreaName) {
final Set<IControlPoint> result = new HashSet<>();
for (final IControl control : getControlsForCourseArea(tracTracEvent, tracTracCourseAreaName)) {
result.addAll(control.getControlPoints());
}
return result;
}
@Override
public Iterable<IControl> getControlsForCourseArea(IEvent tracTracEvent, String tracTracCourseAreaName) {
final Set<IControl> result = new HashSet<>();
@@ -34,7 +34,6 @@ import com.sap.sailing.domain.tracking.impl.RaceAbortedHandler;
import com.sap.sailing.domain.tracking.impl.StartTimeUpdateHandler;
import com.sap.sse.common.IsManagedByCache;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.util.ObjectInputStreamResolvingAgainstCache;
import com.sap.sse.util.ObjectInputStreamResolvingAgainstCache.ResolveListener;
@@ -107,12 +106,8 @@ public interface DomainFactory extends SharedDomainFactory<RaceLogAndTrackedRace
PlacemarkDTO convertToPlacemarkDTO(Placemark placemark);
List<CompetitorAndBoatDTO> getCompetitorDTOList(Map<Competitor, Boat> competitors);
List<CompetitorDTO> getCompetitorDTOList(Iterable<Competitor> competitors);
List<CompetitorAndBoatDTO> getCompetitorDTOList(List<Pair<Competitor, Boat>> competitors);
TrackedRaceDTO createTrackedRaceDTO(TrackedRace trackedRace);
TrackedRaceStatisticsDTO createTrackedRaceStatisticsDTO(TrackedRace trackedRace, Leaderboard leaderboard, RaceColumn raceColumn,
@@ -57,10 +57,6 @@ public interface Series extends SeriesBase {
RaceColumnInSeries addRaceColumn(int insertIndex, String raceColumnName, TrackedRegattaRegistry trackedRegattaRegistry);
void moveRaceColumnUp(String raceColumnName);
void moveRaceColumnDown(String raceColumnName);
void removeRaceColumn(String raceColumnName);
/**
@@ -6,7 +6,6 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Logger;
import com.sap.sailing.domain.base.Boat;
@@ -79,7 +78,6 @@ import com.sap.sailing.geocoding.ReverseGeocoder;
import com.sap.sse.common.Distance;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.common.impl.MillisecondsTimePoint;
import com.sap.sse.util.ObjectInputStreamResolvingAgainstCache;
import com.sap.sse.util.ObjectInputStreamResolvingAgainstCache.ResolveListener;
@@ -385,15 +383,6 @@ public class DomainFactoryImpl extends SharedDomainFactoryImpl<RaceLogAndTracked
position.getLngDeg()), placemark.getPopulation());
}
@Override
public List<CompetitorAndBoatDTO> getCompetitorDTOList(Map<Competitor, Boat> competitors) {
List<CompetitorAndBoatDTO> result = new ArrayList<>();
for (Entry<Competitor, Boat> competitorAndBoatEntry : competitors.entrySet()) {
result.add(convertToCompetitorAndBoatDTO(competitorAndBoatEntry.getKey(), competitorAndBoatEntry.getValue()));
}
return result;
}
@Override
public List<CompetitorDTO> getCompetitorDTOList(Iterable<Competitor> competitors) {
List<CompetitorDTO> result = new ArrayList<>();
@@ -403,15 +392,6 @@ public class DomainFactoryImpl extends SharedDomainFactoryImpl<RaceLogAndTracked
return result;
}
@Override
public List<CompetitorAndBoatDTO> getCompetitorDTOList(List<Pair<Competitor, Boat>> competitors) {
List<CompetitorAndBoatDTO> result = new ArrayList<>();
for (Pair<Competitor, Boat> competitorAndBoat : competitors) {
result.add(convertToCompetitorAndBoatDTO(competitorAndBoat.getA(), competitorAndBoat.getB()));
}
return result;
}
@Override
public void addUpdateHandlers(DynamicTrackedRace trackedRace, CourseDesignUpdateHandler courseDesignHandler,
StartTimeUpdateHandler startTimeHandler, RaceAbortedHandler raceAbortedHandler,
@@ -209,57 +209,6 @@ public class SeriesImpl extends RenamableImpl implements Series, RaceColumnListe
}
}
@Override
public void moveRaceColumnUp(String raceColumnName) {
boolean didFirstColumnChange = false; // if it changes and the series starts scoring with zero, notify the change
// start at second element because first can't be moved up
for (int i=1; i<raceColumns.size(); i++) {
RaceColumnInSeries rc = raceColumns.get(i);
if (rc.getName().equals(raceColumnName)) {
raceColumns.remove(i);
if (i==1) {
didFirstColumnChange = true;
}
raceColumnListeners.notifyListenersAboutRaceColumnRemovedFromContainer(rc);
raceColumns.add(i-1, rc);
raceColumnListeners.notifyListenersAboutRaceColumnAddedToContainer(rc);
break;
}
}
if (didFirstColumnChange && startsWithZeroScore) {
notifyIsStartsWithZeroScoreChangedForFirstTwoColumns();
}
}
private void notifyIsStartsWithZeroScoreChangedForFirstTwoColumns() {
final RaceColumnInSeries first = raceColumns.get(0);
raceColumnListeners.notifyListenersAboutIsStartsWithZeroScoreChanged(first, first.isStartsWithZeroScore());
final RaceColumnInSeries second = raceColumns.get(1);
raceColumnListeners.notifyListenersAboutIsStartsWithZeroScoreChanged(second, second.isStartsWithZeroScore());
}
@Override
public void moveRaceColumnDown(String raceColumnName) {
boolean didFirstColumnChange = false; // if it changes and the series starts scoring with zero, notify the change
// end at second-last element because last can't be moved down
for (int i=0; i<raceColumns.size()-1; i++) {
RaceColumnInSeries rc = raceColumns.get(i);
if (rc.getName().equals(raceColumnName)) {
raceColumns.remove(i);
if (i==0) {
didFirstColumnChange = true;
}
raceColumnListeners.notifyListenersAboutRaceColumnRemovedFromContainer(rc);
raceColumns.add(i+1, rc);
raceColumnListeners.notifyListenersAboutRaceColumnAddedToContainer(rc);
break;
}
}
if (didFirstColumnChange && startsWithZeroScore) {
notifyIsStartsWithZeroScoreChangedForFirstTwoColumns();
}
}
@Override
public void removeRaceColumn(String raceColumnName) {
RaceColumnInSeries rc = getRaceColumnByName(raceColumnName);
@@ -331,8 +331,8 @@ public class DelegatingRegattaLeaderboardWithCompetitorElimination extends Abstr
@Override
public void addScoreCorrectionListener(ScoreCorrectionListener listener) {
if (fullLeaderboard != null) {
fullLeaderboard.addScoreCorrectionListener(listener);
if (getFullLeaderboard() != null) {
getFullLeaderboard().addScoreCorrectionListener(listener);
} else {
triggerWhenFullLeaderboardIsResolved.put(leaderboard->leaderboard.addScoreCorrectionListener(listener), true);
}
@@ -340,8 +340,8 @@ public class DelegatingRegattaLeaderboardWithCompetitorElimination extends Abstr
@Override
public void removeScoreCorrectionListener(ScoreCorrectionListener listener) {
if (fullLeaderboard != null) {
fullLeaderboard.removeScoreCorrectionListener(listener);
if (getFullLeaderboard() != null) {
getFullLeaderboard().removeScoreCorrectionListener(listener);
} else {
triggerWhenFullLeaderboardIsResolved.put(leaderboard->leaderboard.removeScoreCorrectionListener(listener), true);
}
@@ -2,9 +2,7 @@ package com.sap.sailing.gwt.ui.test;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.junit.Test;
@@ -87,7 +85,7 @@ public class GwtTestCaseColumnToggling extends GWTTestCase {
}
private void trackRace(){
final Set<TracTracRaceRecordDTO> rrDAOs = new HashSet<TracTracRaceRecordDTO>();
final List<TracTracRaceRecordDTO> rrDAOs = new ArrayList<TracTracRaceRecordDTO>();
rrDAOs.add(rrDao);
service.trackWithTracTrac(/* regattaToAddTo */null, rrDAOs, tractracTunnel ? "tcp://" + tractracTunnelHost + ":"
+ TracTracConnectionConstants.PORT_TUNNEL_LIVE : "tcp://" + TracTracConnectionConstants.HOST_NAME + ":"
@@ -645,7 +645,7 @@ public class EventListComposite extends Composite implements EventsRefresher, Le
Pair<List<CourseAreaDTO>, List<CourseAreaDTO>> courseAreasToAddAndRemove = getCourseAreasToAdd(oldEvent, updatedEvent);
final List<CourseAreaDTO> courseAreasToAdd = courseAreasToAddAndRemove.getA();
final List<CourseAreaDTO> courseAreasToRemove = courseAreasToAddAndRemove.getB();
final Iterable<UUID> updatedEventLeaderboardGroupIds = updatedEvent.getLeaderboardGroupIds();
final List<UUID> updatedEventLeaderboardGroupIds = updatedEvent.getLeaderboardGroupIds();
sailingServiceWrite.updateEvent(oldEvent.id, oldEvent.getName(), updatedEvent.getDescription(),
updatedEvent.startDate, updatedEvent.endDate, updatedEvent.venue,
updatedEvent.isPublic, updatedEventLeaderboardGroupIds,
@@ -90,7 +90,7 @@ public class LeaderboardDescriptor {
this.displayName = displayName;
}
public Iterable<UUID> getCourseAreaIds() {
public List<UUID> getCourseAreaIds() {
return courseAreaIds;
}
@@ -454,7 +454,7 @@ public class StructureImportManagementPanel extends SimplePanel implements Regat
private void createRegattas(final Iterable<RegattaDTO> selectedOriginalRegattasFromXRR, EventDTO newEvent) {
eventManagementPanel.fillEvents();
final Set<RegattaDTO> regattaConfigurationsToCreate = new HashSet<>();
final List<RegattaDTO> regattaConfigurationsToCreate = new ArrayList<>();
for (RegattaDTO originalRegattaFromXRR : selectedOriginalRegattasFromXRR) {
RegattaDTO cloneFromDefaults = new RegattaDTO(regattaDefaultsPerStructure.get(regattaStructures.get(originalRegattaFromXRR)));
cloneFromDefaults.setName(originalRegattaFromXRR.getName());
@@ -2,7 +2,6 @@ package com.sap.sailing.gwt.ui.adminconsole;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@@ -523,7 +522,7 @@ public class TracTracEventManagementPanel extends AbstractEventManagementPanel {
// because it may be an accidental omission to select that regatta for loading
List<TracTracRaceRecordDTO> allRaces = raceList.getList();
SelectionModel<? super TracTracRaceRecordDTO> selectionModel = racesTable.getSelectionModel();
final Set<TracTracRaceRecordDTO> selectedRaces = new LinkedHashSet<>();
final List<TracTracRaceRecordDTO> selectedRaces = new ArrayList<>();
for (TracTracRaceRecordDTO race : allRaces) {
if (selectionModel.isSelected(race)) {
selectedRaces.add(race);
@@ -1,7 +1,9 @@
package com.sap.sailing.gwt.ui.adminconsole;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -87,8 +89,8 @@ public class WindSourcesToExcludeSelectorPanel extends VerticalPanel implements
});
}
private Iterable<WindSource> getWindSourcesToExclude() {
Set<WindSource> result = new HashSet<WindSource>();
private List<WindSource> getWindSourcesToExclude() {
List<WindSource> result = new ArrayList<WindSource>();
for (Map.Entry<WindSource, CheckBox> e : checkboxesByWindSource.entrySet()) {
if (!e.getValue().getValue()) {
result.add(e.getKey());
@@ -17,12 +17,10 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogTagEvent;
import com.sap.sailing.domain.abstractlog.race.state.ReadonlyRaceState;
import com.sap.sailing.domain.common.CompetitorDescriptor;
import com.sap.sailing.domain.common.DetailType;
import com.sap.sailing.domain.common.LeaderboardType;
import com.sap.sailing.domain.common.LegIdentifier;
import com.sap.sailing.domain.common.MailInvitationType;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.NotFoundException;
import com.sap.sailing.domain.common.PolarSheetsXYDiagramData;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.RegattaIdentifier;
import com.sap.sailing.domain.common.WindSource;
@@ -52,7 +50,6 @@ import com.sap.sailing.domain.common.tracking.impl.PreciseCompactGPSFixMovingImp
import com.sap.sailing.domain.common.windfinder.SpotDTO;
import com.sap.sailing.expeditionconnector.ExpeditionDeviceConfiguration;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTrackDTO;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTracksDTO;
import com.sap.sailing.gwt.ui.shared.AccountWithSecurityDTO;
import com.sap.sailing.gwt.ui.shared.CompactBoatPositionsDTO;
import com.sap.sailing.gwt.ui.shared.CompactRaceMapDataDTO;
@@ -125,8 +122,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
List<RegattaDTO> getRegattas() throws UnauthorizedException;
List<RegattaDTO> getRegattasWithUpdatePermission() throws UnauthorizedException;
RegattaDTO getRegattaByName(String regattaName) throws UnauthorizedException;
List<EventDTO> getEvents() throws Exception;
@@ -150,10 +145,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
long resolutionInMilliseconds, Collection<String> windSourceTypeNames, boolean onlyUpToNewestEvent)
throws UnauthorizedException;
WindInfoForRaceDTO getAveragedWindInfo(RegattaAndRaceIdentifier raceIdentifier, Date from,
long millisecondsStepWidth, int numberOfFixes, double latDeg, double lngDeg, Collection<String> windSources)
throws NoWindException, UnauthorizedException;
boolean getPolarResults(RegattaAndRaceIdentifier raceIdentifier) throws UnauthorizedException;
SimulatorResultsDTO getSimulatorResults(LegIdentifier legIdentifier) throws UnauthorizedException;
@@ -225,8 +216,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
SwissTimingEventRecordDTO getRacesOfSwissTimingEvent(String eventJsonURL) throws UnauthorizedException, Exception;
String[] getCountryCodes() throws UnauthorizedException;
Map<CompetitorDTO, List<GPSFixDTOWithSpeedWindTackAndLegType>> getDouglasPoints(
RegattaAndRaceIdentifier raceIdentifier, Map<CompetitorDTO, TimeRange> competitorTimeRanges, double meters)
throws NoWindException, UnauthorizedException;
@@ -234,9 +223,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
Map<CompetitorDTO, List<ManeuverDTO>> getManeuvers(RegattaAndRaceIdentifier raceIdentifier,
Map<CompetitorDTO, TimeRange> competitorTimeRanges) throws NoWindException, UnauthorizedException;
List<StrippedLeaderboardDTO> getLeaderboardsByRaceAndRegatta(String raceName, RegattaIdentifier regattaIdentifier)
throws UnauthorizedException;
List<LeaderboardGroupDTO> getLeaderboardGroups(boolean withGeoLocationData) throws UnauthorizedException;
LeaderboardGroupDTO getLeaderboardGroupByName(String groupName, boolean withGeoLocationData)
@@ -298,8 +284,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
List<Util.Pair<String, String>> getLeaderboardsNamesOfMetaLeaderboard(String metaLeaderboardName)
throws UnauthorizedException;
LeaderboardType getLeaderboardType(String leaderboardName) throws UnauthorizedException;
/** for backward compatibility with the regatta overview */
List<RaceGroupDTO> getRegattaStructureForEvent(UUID eventId) throws UnauthorizedException;
@@ -307,10 +291,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
List<String> visibleRegattas, boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay,
Duration clientTimeZoneOffset) throws UnauthorizedException, Exception;
List<RegattaOverviewEntryDTO> getRaceStateEntriesForLeaderboard(String leaderboardName,
boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay, Duration clientTimeZoneOffset,
List<String> visibleRegattas) throws UnauthorizedException, Exception;
void reloadRaceLog(String leaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet)
throws UnauthorizedException, NotFoundException;
@@ -339,8 +319,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
List<DeviceConfigurationWithSecurityDTO> getDeviceConfigurations() throws UnauthorizedException;
DeviceConfigurationDTO getDeviceConfiguration(UUID id) throws UnauthorizedException;
void createOrUpdateDeviceConfiguration(DeviceConfigurationDTO configurationDTO) throws UnauthorizedException;
boolean setStartTimeAndProcedure(RaceLogSetStartTimeAndProcedureDTO dto)
@@ -355,39 +333,9 @@ public interface SailingService extends RemoteService, RemoteReplicationService
Util.Triple<Date, Date, Integer> getFinishingAndFinishTime(String leaderboardName, String raceColumnName,
String fleetName) throws UnauthorizedException, NotFoundException;
Iterable<String> getAllIgtimiAccountEmailAddresses() throws UnauthorizedException;
String getIgtimiAuthorizationUrl(String redirectProtocol, String redirectHostname, String redirectPort)
throws UnauthorizedException, Exception;
/**
* Returns all public and private tags of specified race and current user.
*
* @param leaderboardName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @param raceColumnName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @param fleetName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @return list of {@link TagDTO tags}
*/
List<TagDTO> getAllTags(String leaderboardName, String raceColumnName, String fleetName)
throws UnauthorizedException;
/**
* Returns all public {@link TagDTO tags} of specified race.
*
* @param leaderboardName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @param raceColumnName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @param fleetName
* required to identify {@link RaceLog}, must <b>NOT</b> be <code>null</code>
* @return list of public {@link TagDTO tags}
*/
List<TagDTO> getPublicTags(String leaderboardName, String raceColumnName, String fleetName)
throws UnauthorizedException;
/**
* Returns all private {@link TagDTO tags} of specified race and current user.
*
@@ -414,8 +362,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
List<TrackFileImportDeviceIdentifierDTO> getTrackFileImportDeviceIds(List<String> uuids)
throws NoCorrespondingServiceRegisteredException, TransformationException;
PolarSheetsXYDiagramData createXYDiagramForBoatClass(String itemText) throws UnauthorizedException;
/**
* @see SailingServiceAsync#getCompetitorMarkPassings(RegattaAndRaceIdentifier, CompetitorWithBoatDTO, boolean,
* com.google.gwt.user.client.rpc.AsyncCallback)
@@ -448,10 +394,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
*/
Iterable<RegattaDTO> getRegattas(String manage2SailJsonUrl) throws UnauthorizedException;
Integer getStructureImportOperationProgress() throws UnauthorizedException;
ArrayList<LeaderboardGroupDTO> getLeaderboardGroupsByEventId(UUID id) throws UnauthorizedException;
Iterable<MarkDTO> getMarksInRegattaLog(String leaderboardName)
throws UnauthorizedException, DoesNotHaveRegattaLogException;
@@ -503,9 +445,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
Iterable<MarkDTO> getMarksInTrackedRace(String leaderboardName, String raceColumnName, String fleetName)
throws UnauthorizedException;
MarkTracksDTO getMarkTracks(String leaderboardName, String raceColumnName, String fleetName)
throws UnauthorizedException;
MarkTrackDTO getMarkTrack(String leaderboardName, String raceColumnName, String fleetName, String markIdAsString)
throws UnauthorizedException;
@@ -580,8 +519,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
*/
String openRegattaRegistrationQrCode(String url) throws UnauthorizedException;
List<String> getPossibleTennants() throws UnauthorizedException;
Iterable<AccountWithSecurityDTO> getAllIgtimiAccountsWithSecurity() throws UnauthorizedException;
/**
@@ -607,12 +544,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
CompetitorDTO getCompetitor(UUID competitorId, String leaderboardName,
String regattaRegistrationLinkSecret);
boolean existsSwissTimingConfigurationForCurrentUser(String jsonUrl) throws Exception, UnauthorizedException;
boolean existsSwissTimingArchiveConfigurationForCurrentUser(String jsonUrl) throws Exception, UnauthorizedException;
boolean existsTracTracConfigurationForCurrentUser(String jsonUrl) throws Exception, UnauthorizedException;
boolean getTrackedRaceIsUsingMarkPassingCalculator(RegattaAndRaceIdentifier regattaNameAndRaceName);
ORCPerformanceCurveLegImpl[] getLegGeometry(String leaderboardName, String raceColumnName, String fleetName,
@@ -636,10 +567,6 @@ public interface SailingService extends RemoteService, RemoteReplicationService
Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(RegattaIdentifier regattaIdentifier) throws NotFoundException;
Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(RegattaAndRaceIdentifier raceIdentifier) throws NotFoundException;
Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName) throws NotFoundException;
Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName, String raceColumnName, String fleetName) throws NotFoundException;
ImpliedWindSource getImpliedWindSource(String leaderboardName, String raceColumnName, String fleetName) throws NotFoundException;
@@ -12,10 +12,8 @@ import java.util.UUID;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sap.sailing.domain.common.CompetitorDescriptor;
import com.sap.sailing.domain.common.DetailType;
import com.sap.sailing.domain.common.LeaderboardType;
import com.sap.sailing.domain.common.LegIdentifier;
import com.sap.sailing.domain.common.MailInvitationType;
import com.sap.sailing.domain.common.PolarSheetsXYDiagramData;
import com.sap.sailing.domain.common.RaceIdentifier;
import com.sap.sailing.domain.common.RegattaAndRaceIdentifier;
import com.sap.sailing.domain.common.RegattaIdentifier;
@@ -46,7 +44,6 @@ import com.sap.sailing.domain.common.windfinder.SpotDTO;
import com.sap.sailing.domain.tracking.TrackedRace;
import com.sap.sailing.expeditionconnector.ExpeditionDeviceConfiguration;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTrackDTO;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTracksDTO;
import com.sap.sailing.gwt.ui.shared.AccountWithSecurityDTO;
import com.sap.sailing.gwt.ui.shared.CompactBoatPositionsDTO;
import com.sap.sailing.gwt.ui.shared.CompactRaceMapDataDTO;
@@ -116,8 +113,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getRegattas(AsyncCallback<List<RegattaDTO>> callback);
void getRegattasWithUpdatePermission(AsyncCallback<List<RegattaDTO>> callback);
void getRegattaByName(String regattaName, AsyncCallback<RegattaDTO> asyncCallback);
/**
@@ -153,15 +148,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
long resolutionInMilliseconds, Collection<String> windSourceTypeNames, boolean onlyUpToNewestEvent,
AsyncCallback<WindInfoForRaceDTO> callback);
/**
* @param windSourceTypeNames
* if <code>null</code>, data from all available wind sources will be returned, otherwise only from those
* whose {@link WindSource} name is contained in the <code>windSources</code> collection.
*/
void getAveragedWindInfo(RegattaAndRaceIdentifier raceIdentifier, Date from, long millisecondsStepWidth,
int numberOfFixes, double latDeg, double lngDeg, Collection<String> windSourceTypeNames,
AsyncCallback<WindInfoForRaceDTO> callback);
/**
* @param onlyUpToNewestEvent
* if <code>true</code>, no wind data will be returned for time points later than
@@ -212,8 +198,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getLeaderboardsWithSecurity(AsyncCallback<List<StrippedLeaderboardDTOWithSecurity>> callback);
void getLeaderboardsByRaceAndRegatta(String raceName, RegattaIdentifier regattaIdentifier,
AsyncCallback<List<StrippedLeaderboardDTO>> callback);
/**
* The key set of the map returned contains all fleets of the race column identified by the combination of
* <code>leaderboardName</code> and <code>raceColumnName</code>. If a value is <code>null</code>, there is no
@@ -228,8 +212,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getRacesOfSwissTimingEvent(String eventJsonUrl, AsyncCallback<SwissTimingEventRecordDTO> asyncCallback);
void getCountryCodes(AsyncCallback<String[]> callback);
void getDouglasPoints(RegattaAndRaceIdentifier raceIdentifier, Map<CompetitorDTO, TimeRange> competitorTimeRanges,
double meters, AsyncCallback<Map<CompetitorDTO, List<GPSFixDTOWithSpeedWindTackAndLegType>>> callback);
@@ -341,18 +323,12 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getLeaderboardsNamesOfMetaLeaderboard(String metaLeaderboardName,
AsyncCallback<List<Util.Pair<String, String>>> callback);
void getLeaderboardType(String leaderboardName, AsyncCallback<LeaderboardType> callback);
void getRegattaStructureForEvent(UUID eventId, AsyncCallback<List<RaceGroupDTO>> asyncCallback);
void getRaceStateEntriesForRaceGroup(UUID eventId, List<UUID> visibleCourseAreas, List<String> visibleRegattas,
boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay,
Duration clientTimeZoneOffset, AsyncCallback<List<RegattaOverviewEntryDTO>> markedAsyncCallback);
void getRaceStateEntriesForLeaderboard(String leaderboardName, boolean showOnlyCurrentlyRunningRaces,
boolean showOnlyRacesOfSameDay, Duration clientTimeZoneOffset, List<String> visibleRegattas,
AsyncCallback<List<RegattaOverviewEntryDTO>> callback);
void reloadRaceLog(String leaderboardName, RaceColumnDTO raceColumnDTO, FleetDTO fleet,
AsyncCallback<Void> asyncCallback);
@@ -361,8 +337,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getRegattaLog(String leaderboardName, AsyncCallback<RegattaLogDTO> callback);
void getStructureImportOperationProgress(AsyncCallback<Integer> asyncCallback);
void getLeaderboardGroupNamesFromRemoteServer(String host, String username, String password,
AsyncCallback<List<String>> leaderboardGroupNames);
@@ -381,8 +355,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getDeviceConfigurations(AsyncCallback<List<DeviceConfigurationWithSecurityDTO>> asyncCallback);
void getDeviceConfiguration(UUID id, AsyncCallback<DeviceConfigurationDTO> callback);
void createOrUpdateDeviceConfiguration(DeviceConfigurationDTO configurationDTO, AsyncCallback<Void> callback);
/**
@@ -417,16 +389,8 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getFinishingAndFinishTime(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<Util.Triple<Date, Date, Integer>> asyncCallback);
void getAllIgtimiAccountEmailAddresses(AsyncCallback<Iterable<String>> callback);
void getIgtimiAuthorizationUrl(String redirectProtocol, String redirectHostname, String redirectPort, AsyncCallback<String> callback);
void getAllTags(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<List<TagDTO>> asyncCallback);
void getPublicTags(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<List<TagDTO>> asyncCallback);
void getPrivateTags(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<List<TagDTO>> asyncCallback);
@@ -442,8 +406,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getTrackFileImportDeviceIds(List<String> uuids,
AsyncCallback<List<TrackFileImportDeviceIdentifierDTO>> callback);
void createXYDiagramForBoatClass(String itemText, AsyncCallback<PolarSheetsXYDiagramData> asyncCallback);
void getEventsForLeaderboard(String leaderboardName, AsyncCallback<Collection<EventDTO>> callback);
/**
@@ -465,8 +427,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getCompetitorRaceLogMarkPassingData(String leaderboardName, String raceColumnName, String fleetName,
CompetitorDTO competitor, AsyncCallback<Map<Integer, Date>> callback);
void getLeaderboardGroupsByEventId(UUID id, AsyncCallback<ArrayList<LeaderboardGroupDTO>> callback);
void getMarksInRegattaLog(String leaderboardName, AsyncCallback<Iterable<MarkDTO>> callback);
void getDeviceMappings(String leaderboardName, AsyncCallback<List<DeviceMappingDTO>> asyncCallback);
@@ -502,9 +462,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getMarksInTrackedRace(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<Iterable<MarkDTO>> callback);
void getMarkTracks(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<MarkTracksDTO> callback);
void getMarkTrack(String leaderboardName, String raceColumnName, String fleetName, String markIdAsString,
AsyncCallback<MarkTrackDTO> callback);
@@ -604,11 +561,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
*/
void openRegattaRegistrationQrCode(String url, AsyncCallback<String> asyncCallback);
/**
* gets a (possibly imcomplete) list of available tennants to choose from.
*/
void getPossibleTennants(AsyncCallback<List<String>> asyncCallback);
void getAllIgtimiAccountsWithSecurity(AsyncCallback<Iterable<AccountWithSecurityDTO>> callback);
/**
@@ -635,15 +587,8 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getCompetitor(UUID competitorId, String leaderboardName, String regattaRegistrationLinkSecret,
AsyncCallback<CompetitorDTO> asyncCallback);
void existsSwissTimingConfigurationForCurrentUser(String jsonUrl, AsyncCallback<Boolean> callback);
void existsSwissTimingArchiveConfigurationForCurrentUser(String jsonUrl, AsyncCallback<Boolean> callback);
void existsTracTracConfigurationForCurrentUser(String jsonUrl, AsyncCallback<Boolean> callback);
void getTrackedRaceIsUsingMarkPassingCalculator(RegattaAndRaceIdentifier regattaNameAndRaceName, AsyncCallback<Boolean> callback);
void getLegGeometry(String leaderboardName, String raceColumnName, String fleetName, int[] zeroBasedLegIndices,
ORCPerformanceCurveLegTypes[] legTypes, AsyncCallback<ORCPerformanceCurveLegImpl[]> callback);
@@ -662,10 +607,6 @@ public interface SailingServiceAsync extends RemoteReplicationServiceAsync {
void getORCCertificateAssignmentsByBoatIdAsString(RegattaIdentifier regattaIdentifier, AsyncCallback<Map<String, ORCCertificate>> asyncCallback);
void getORCCertificateAssignmentsByBoatIdAsString(RegattaAndRaceIdentifier raceIdentifier, AsyncCallback<Map<String, ORCCertificate>> asyncCallback);
void getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName, AsyncCallback<Map<String, ORCCertificate>> asyncCallback);
void getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName, String raceColumnName, String fleetName, AsyncCallback<Map<String, ORCCertificate>> asyncCallback);
/**
@@ -10,7 +10,6 @@ import java.util.UUID;
import org.apache.shiro.authz.UnauthorizedException;
import com.sap.sailing.domain.abstractlog.Revokable;
import com.sap.sailing.domain.abstractlog.orc.RaceLogORCLegDataEvent;
import com.sap.sailing.domain.abstractlog.race.RaceLog;
import com.sap.sailing.domain.abstractlog.race.RaceLogTagEvent;
@@ -111,12 +110,6 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
String raceColumnName, String fleetName, Map<String, ORCCertificate> certificatesForBoatsWithIdAsString)
throws IOException, NotFoundException;
Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(RegattaAndRaceIdentifier raceIdentifier,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString) throws IOException, NotFoundException;
Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(String leaderboardName,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString) throws IOException, NotFoundException;
Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(RegattaIdentifier regattaIdentifier,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString) throws IOException, NotFoundException;
@@ -176,16 +169,6 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void setActiveFileStorageService(String serviceName, String localeInfoName);
/**
* Performs all the necessary steps to start tracking the race. The {@code RaceLog} needs to be denoted for
* racelog-tracking beforehand.
*
* @see RaceLogTrackingAdapter#startTracking
*/
void startRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, boolean trackWind,
boolean correctWindByDeclination)
throws UnauthorizedException, NotDenotedForRaceLogTrackingException, Exception;
void startRaceLogTracking(List<Triple<String, String, String>> leaderboardRaceColumnFleetNames, boolean trackWind,
boolean correctWindByDeclination)
throws UnauthorizedException, NotDenotedForRaceLogTrackingException, Exception;
@@ -221,7 +204,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
throws DoesNotHaveRegattaLogException, NotFoundException;
void fillRaceLogsFromPairingListTemplate(final String leaderboardName, final int flightMultiplier,
final Iterable<String> selectedFlightNames, final PairingListDTO pairingListDTO)
final List<String> selectedFlightNames, final PairingListDTO pairingListDTO)
throws NotFoundException, CompetitorRegistrationOnRaceLogDisabledException;
void setBoatRegistrationsInRegattaLog(String leaderboardName, Set<BoatDTO> boatDTOs)
@@ -240,8 +223,6 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void denoteForRaceLogTracking(String leaderboardName, String prefix) throws Exception;
void denoteForRaceLogTracking(String leaderboardName) throws Exception;
Boolean denoteForRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName)
throws NotFoundException, NotDenotableForRaceLogTrackingException;
@@ -259,13 +240,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
DataImportProgress getImportOperationProgress(UUID id) throws UnauthorizedException;
boolean unlinkBoatFromCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName,
String competitorIdAsString) throws NotFoundException;
boolean linkBoatToCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName,
String competitorIdAsString, String boatIdAsString) throws NotFoundException;
void allowCompetitorResetToDefaults(Iterable<CompetitorDTO> competitors);
void allowCompetitorResetToDefaults(List<CompetitorDTO> competitors);
UUID importMasterData(String host, String[] groupNames, boolean override, boolean compress, boolean exportWind,
boolean exportDeviceConfigurations, String targetServerUsername, String targetServerPassword,
@@ -274,7 +249,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
RegattaDTO createRegatta(String regattaName, String boatClassName, boolean canBoatsOfCompetitorsChangePerRace,
CompetitorRegistrationType competitorRegistrationType, String registrationLinkSecret, Date startDate,
Date endDate, RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal,
boolean persistent, ScoringSchemeType scoringSchemeType, Iterable<UUID> courseAreaIds,
boolean persistent, ScoringSchemeType scoringSchemeType, List<UUID> courseAreaIds,
Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference,
boolean controlTrackingFromStartAndFinishTimes, boolean autoRestartTrackingUponCompetitorSetChange, RankingMetrics rankingMetricType)
throws UnauthorizedException;
@@ -282,18 +257,12 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void removeRaceColumnsFromSeries(RegattaIdentifier regattaIdentifier, String seriesName, List<String> columnNames)
throws UnauthorizedException;
void moveRaceColumnInSeriesUp(RegattaIdentifier regattaIdentifier, String seriesName, String columnName)
throws UnauthorizedException;
void moveRaceColumnInSeriesDown(RegattaIdentifier regattaIdentifier, String seriesName, String columnName)
throws UnauthorizedException;
void updateSeries(RegattaIdentifier regattaIdentifier, String seriesName, String newSeriesName, boolean isMedal,
boolean isFleetsCanRunInParallel, int[] resultDiscardingThresholds, boolean startsWithZeroScore,
boolean firstRaceIsNonDiscardableCarryForward, boolean hasSplitFleetScore, Integer maximumNumberOfDiscards,
List<FleetDTO> fleets) throws UnauthorizedException;
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, Iterable<UUID> courseAreaUuids,
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, List<UUID> courseAreaUuids,
RegattaConfigurationDTO regattaConfiguration, Double buoyZoneRadiusInHullLengths,
boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes,
boolean autoRestartTrackingUponCompetitorSetChange, String registrationLinkSecret, CompetitorRegistrationType registrationType) throws UnauthorizedException;
@@ -316,14 +285,14 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURLAsString, String baseURLAsString,
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<UUID> leaderboardGroupIds)
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<UUID> leaderboardGroupIds)
throws UnauthorizedException;
EventDTO updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURLString,
String baseURLAsString, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<String> windFinderReviewedSpotCollectionIds)
VenueDTO venue, boolean isPublic, List<UUID> leaderboardGroupIds, String officialWebsiteURLString,
String baseURLAsString, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<String> windFinderReviewedSpotCollectionIds)
throws UnauthorizedException, IOException;
void updateLeaderboardGroup(UUID leaderboardGroupId, String oldName, String newName, String newDescription,
@@ -334,7 +303,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
boolean displayGroupsInReverseOrder, int[] overallLeaderboardDiscardThresholds,
ScoringSchemeType overallLeaderboardScoringSchemeType);
void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, Iterable<SwissTimingRaceRecordDTO> rrs, String hostname,
void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, List<SwissTimingRaceRecordDTO> rrs, String hostname,
int port, boolean trackWind, boolean correctWindByDeclination, boolean useInternalMarkPassingAlgorithm,
String updateURL, String updateUsername, String updatePassword, String eventName, String manage2SailEventUrl) throws UnauthorizedException, Exception;
@@ -349,8 +318,6 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void updateRacesDelayToLive(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers, long delayToLiveInMs);
void updateRaceDelayToLive(RegattaAndRaceIdentifier regattaAndRaceIdentifier, long delayToLiveInMs);
void updateIsMedalRace(String leaderboardName, String columnName, boolean isMedalRace);
void moveLeaderboardColumnUp(String leaderboardName, String columnName) throws UnauthorizedException;
@@ -385,20 +352,14 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void removeLeaderboardColumn(String leaderboardName, String columnName) throws UnauthorizedException;
void removeLeaderboardColumns(String leaderboardName, List<String> columnsToRemove);
void removeLeaderboardGroups(Set<String> groupNames);
void renameLeaderboardGroup(String oldName, String newName);
void removeLeaderboard(String leaderboardName) throws UnauthorizedException;
void removeLeaderboards(Collection<String> leaderboardNames) throws UnauthorizedException;
void renameLeaderboard(String leaderboardName, String newLeaderboardName) throws UnauthorizedException;
StrippedLeaderboardDTOWithSecurity updateLeaderboard(String leaderboardName, String newLeaderboardName,
String newLeaderboardDisplayName, int[] newDiscardingThreasholds, Iterable<UUID> newCourseAreaIds)
String newLeaderboardDisplayName, int[] newDiscardingThreasholds, List<UUID> newCourseAreaIds)
throws UnauthorizedException;
StrippedLeaderboardDTOWithSecurity createRegattaLeaderboardWithEliminations(String name, String displayName,
@@ -408,7 +369,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
String leaderboardDisplayName, int[] discardThresholds) throws UnauthorizedException;
StrippedLeaderboardDTOWithSecurity createFlexibleLeaderboard(String leaderboardName, String leaderboardDisplayName,
int[] discardThresholds, ScoringSchemeType scoringSchemeType, Iterable<UUID> courseAreaIds)
int[] discardThresholds, ScoringSchemeType scoringSchemeType, List<UUID> courseAreaIds)
throws UnauthorizedException;
void removeResultImportURLs(String resultProviderName, Set<UrlDTO> toRemove) throws Exception;
@@ -422,11 +383,11 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void createSwissTimingArchiveConfiguration(String jsonUrl)
throws UnauthorizedException, Exception;
void createRegattaStructure(final Iterable<RegattaDTO> regattas, final EventDTO newEvent) throws IOException;
void createRegattaStructure(final List<RegattaDTO> regattas, final EventDTO newEvent) throws IOException;
void removeWind(RegattaAndRaceIdentifier raceIdentifier, WindDTO windDTO);
void setWindSourcesToExclude(RegattaAndRaceIdentifier raceIdentifier, Iterable<WindSource> windSourcesToExclude);
void setWindSourcesToExclude(RegattaAndRaceIdentifier raceIdentifier, List<WindSource> windSourcesToExclude);
void setRaceIsKnownToStartUpwind(RegattaAndRaceIdentifier raceIdentifier, boolean raceIsKnownToStartUpwind);
@@ -435,9 +396,9 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void setWind(RegattaAndRaceIdentifier raceIdentifier, WindDTO windDTO);
void removeAndUntrackRaces(Iterable<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers);
void removeAndUntrackRaces(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers);
void stopTrackingRaces(Iterable<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) throws Exception;
void stopTrackingRaces(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) throws Exception;
void updateTracTracConfiguration(TracTracConfigurationWithSecurityDTO tracTracConfiguration)
throws UnauthorizedException, Exception;
@@ -448,7 +409,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
void createTracTracConfiguration(String name, String jsonURL, String liveDataURI, String storedDataURI,
String courseDesignUpdateURI, String tracTracUsername, String tracTracPassword) throws Exception;
void trackWithTracTrac(RegattaIdentifier regattaToAddTo, Iterable<TracTracRaceRecordDTO> rrs, String liveURI,
void trackWithTracTrac(RegattaIdentifier regattaToAddTo, List<TracTracRaceRecordDTO> rrs, String liveURI,
String storedURI, String courseDesignUpdateURI, boolean trackWind, boolean correctWindByDeclination,
Duration offsetToStartTimeOfSimulatedRace, boolean useInternalMarkPassingAlgorithm, boolean useOfficialEventsToUpdateRaceLog,
String tracTracUsername, String tracTracPassword) throws UnauthorizedException, Exception;
@@ -545,7 +506,7 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
String imageURL, String resizedImageURL, boolean visibleForPublic, TimePoint raceTimepoint)
throws UnauthorizedException;
void allowBoatResetToDefaults(Iterable<BoatDTO> boats) throws UnauthorizedException;
void allowBoatResetToDefaults(List<BoatDTO> boats) throws UnauthorizedException;
/**
* Into the first {@link RaceLog} {@link TrackedRace#getAttachedRaceLogs() attached} to the tracked race identified
@@ -692,12 +653,4 @@ public interface SailingServiceWrite extends FileStorageManagementGwtService, Sa
SuccessInfo removeTag(String leaderboardName, String raceColumnName, String fleetName, TagDTO tag)
throws UnauthorizedException;
/**
* Revoke the events in the {@code RaceLog} that are identified by the {@code eventIds}. This only affects such
* events that implement {@link Revokable}.
*
* @throws NotFoundException
*/
void revokeRaceAndRegattaLogEvents(String leaderboardName, String raceColumnName, String fleetName,
List<UUID> eventIds) throws UnauthorizedException, NotRevokableException, NotFoundException;
}
@@ -131,7 +131,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
/*throws NoCorrespondingServiceRegisteredException, TransformationException, DoesNotHaveRegattaLogException*/;
void allowBoatResetToDefaults(Iterable<BoatDTO> boats, AsyncCallback<Void> callback) throws UnauthorizedException;
void allowBoatResetToDefaults(List<BoatDTO> boats, AsyncCallback<Void> callback) throws UnauthorizedException;
void setTrackingTimes(RaceLogSetTrackingTimesDTO dto, AsyncCallback<Void> callback);
@@ -180,7 +180,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
* @param callback
*/
void fillRaceLogsFromPairingListTemplate(final String leaderboardName, final int flightMultiplier,
final Iterable<String> selectedFlightNames,PairingListDTO pairingListDTO, AsyncCallback<Void> callback);
final List<String> selectedFlightNames,PairingListDTO pairingListDTO, AsyncCallback<Void> callback);
/**
* Checks whether the user may cut the race identified by {@code radeIdentifier} into multiple races. For this, it
@@ -219,18 +219,10 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString,
AsyncCallback<Triple<Integer, Integer, Integer>> callback);
void assignORCPerformanceCurveCertificates(RegattaAndRaceIdentifier raceIdentifier,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString,
AsyncCallback<Triple<Integer, Integer, Integer>> callback);
void assignORCPerformanceCurveCertificates(String leaderboardName, String raceColumnName, String fleetName,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString,
AsyncCallback<Triple<Integer, Integer, Integer>> callback);
void assignORCPerformanceCurveCertificates(String leaderboardName,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString,
AsyncCallback<Triple<Integer, Integer, Integer>> callback);
void getORCPerformanceCurveScratchBoat(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<CompetitorDTO> asyncCallback);
@@ -278,13 +270,13 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
* be <code>null</code> or the empty string in which case the server will use the
* {@link TracTracRaceRecordDTO#storedURI} from the <code>rr</code> race record.
*/
void trackWithTracTrac(RegattaIdentifier regattaToAddTo, Iterable<TracTracRaceRecordDTO> rrs, String liveURI,
void trackWithTracTrac(RegattaIdentifier regattaToAddTo, List<TracTracRaceRecordDTO> rrs, String liveURI,
String storedURI, String courseDesignUpdateURI, boolean trackWind, boolean correctWindByDeclination,
Duration offsetToStartTimeOfSimulatedRace, boolean useInternalMarkPassingAlgorithm,
boolean useOfficialEventsToUpdateRaceLog, String tracTracUsername,
String tracTracPassword, AsyncCallback<Void> callback);
void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, Iterable<SwissTimingRaceRecordDTO> rrs, String hostname,
void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, List<SwissTimingRaceRecordDTO> rrs, String hostname,
int port, boolean trackWind, boolean correctWindByDeclination, boolean useInternalMarkPassingAlgorithm,
String updateURL, String updateUsername, String updatePassword, String eventName,
String manage2SailEventUrl, AsyncCallback<Void> asyncCallback);
@@ -299,7 +291,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void updateTracTracConfiguration(TracTracConfigurationWithSecurityDTO tracTracConfiguration,
AsyncCallback<Void> callback);
void stopTrackingRaces(Iterable<RegattaAndRaceIdentifier> racesToStopTracking, AsyncCallback<Void> asyncCallback);
void stopTrackingRaces(List<RegattaAndRaceIdentifier> racesToStopTracking, AsyncCallback<Void> asyncCallback);
/**
* Untracks the race and removes it from the regatta. It will also be removed in all leaderboards
@@ -307,7 +299,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
* @param regattaNamesAndRaceNames
* The identifier for the regatta name, and the race name to remove
*/
void removeAndUntrackRaces(Iterable<RegattaNameAndRaceName> regattaNamesAndRaceNames, AsyncCallback<Void> callback);
void removeAndUntrackRaces(List<RegattaNameAndRaceName> regattaNamesAndRaceNames, AsyncCallback<Void> callback);
void setWind(RegattaAndRaceIdentifier raceIdentifier, WindDTO wind, AsyncCallback<Void> callback);
@@ -315,12 +307,12 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void updateLeaderboard(String leaderboardName, String newLeaderboardName, String newLeaderboardDisplayName,
int[] newDiscardingThreasholds, Iterable<UUID> newCourseAreaIds,
int[] newDiscardingThreasholds, List<UUID> newCourseAreaIds,
AsyncCallback<StrippedLeaderboardDTOWithSecurity> callback);
void createFlexibleLeaderboard(String leaderboardName, String leaderboardDisplayName,
int[] discardThresholds,
ScoringSchemeType scoringSchemeType, Iterable<UUID> courseAreaIds,
ScoringSchemeType scoringSchemeType, List<UUID> courseAreaIds,
AsyncCallback<StrippedLeaderboardDTOWithSecurity> asyncCallback);
void createRegattaLeaderboard(RegattaName regattaIdentifier,
@@ -335,8 +327,6 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void removeLeaderboards(Collection<String> leaderboardNames, AsyncCallback<Void> asyncCallback);
void renameLeaderboard(String leaderboardName, String newLeaderboardName, AsyncCallback<Void> asyncCallback);
void renameLeaderboardColumn(String leaderboardName, String oldColumnName, String newColumnName,
AsyncCallback<Void> callback);
@@ -373,9 +363,6 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void updateIsMedalRace(String leaderboardName, String columnName, boolean isMedalRace, AsyncCallback<Void> callback);
void updateRaceDelayToLive(RegattaAndRaceIdentifier regattaAndRaceIdentifier, long delayToLiveInMs,
AsyncCallback<Void> callback);
void updateRacesDelayToLive(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers, long delayToLiveInMs,
AsyncCallback<Void> callback);
@@ -388,13 +375,6 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void deleteSwissTimingConfigurations(Collection<SwissTimingConfigurationWithSecurityDTO> configurations,
AsyncCallback<Void> asyncCallback);
/**
* Renames the group with the name <code>oldName</code> to the <code>newName</code>.<br />
* If there's no group with the name <code>oldName</code> or there's already a group with the name
* <code>newName</code> a {@link IllegalArgumentException} is thrown.
*/
void renameLeaderboardGroup(String oldName, String newName, AsyncCallback<Void> callback);
/**
* Removes the leaderboard groups with the given names from the service and the persistant store.
*/
@@ -415,7 +395,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void setRaceIsKnownToStartUpwind(RegattaAndRaceIdentifier raceIdentifier, boolean raceIsKnownToStartUpwind,
AsyncCallback<Void> callback);
void setWindSourcesToExclude(RegattaAndRaceIdentifier raceIdentifier, Iterable<WindSource> windSourcesToExclude,
void setWindSourcesToExclude(RegattaAndRaceIdentifier raceIdentifier, List<WindSource> windSourcesToExclude,
AsyncCallback<Void> callback);
@@ -435,14 +415,14 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURL, String baseURL,
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<UUID> leaderboardGroupIDs,
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<UUID> leaderboardGroupIDs,
AsyncCallback<EventDTO> callback);
void updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURL,
String baseURL, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<String> windFinderReviewedSpotCollectionIds, AsyncCallback<EventDTO> callback);
VenueDTO venue, boolean isPublic, List<UUID> leaderboardGroupIds, String officialWebsiteURL,
String baseURL, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<String> windFinderReviewedSpotCollectionIds, AsyncCallback<EventDTO> callback);
void createCourseAreas(UUID eventId, String[] courseAreaNames, AsyncCallback<Void> callback);
@@ -452,16 +432,10 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void removeRegattas(Collection<RegattaIdentifier> regattas, AsyncCallback<Void> asyncCallback);
void moveRaceColumnInSeriesUp(RegattaIdentifier regattaIdentifier, String seriesName, String columnName,
AsyncCallback<Void> callback);
void moveRaceColumnInSeriesDown(RegattaIdentifier regattaIdentifier, String seriesName, String columnName,
AsyncCallback<Void> callback);
void createRegatta(String regattaName, String boatClassName, boolean canBoatsOfCompetitorsChangePerRace,
CompetitorRegistrationType competitorRegistrationType, String registrationLinkSecret, Date startDate, Date endDate,
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal, boolean persistent,
ScoringSchemeType scoringSchemeType, Iterable<UUID> courseAreaIds, Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference,
ScoringSchemeType scoringSchemeType, List<UUID> courseAreaIds, Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference,
boolean controlTrackingFromStartAndFinishTimes, boolean autoRestartTrackingUponCompetitorSetChange,
RankingMetrics rankingMetricType, AsyncCallback<RegattaDTO> callback);
@@ -478,8 +452,6 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void removeResultImportURLs(String resultProviderName, Set<UrlDTO> toRemove, AsyncCallback<Void> callback);
void removeLeaderboardColumns(String leaderboardName, List<String> columnsToRemove, AsyncCallback<Void> callback);
void suppressCompetitorInLeaderboard(String leaderboardName, String competitorIdAsString, boolean suppressed,
AsyncCallback<Void> asyncCallback);
@@ -494,7 +466,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void deleteSwissTimingArchiveConfigurations(Collection<SwissTimingArchiveConfigurationWithSecurityDTO> dtos,
AsyncCallback<Void> asyncCallback);
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, Iterable<UUID> courseAreaUuids,
void updateRegatta(RegattaIdentifier regattaIdentifier, Date startDate, Date endDate, List<UUID> courseAreaUuids,
RegattaConfigurationDTO regattaConfiguration, Double buoyZoneRadiusInHullLengths,
boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes,
boolean autoRestartTrackingUponCompetitorSetChange, String registrationLinkSecret,
@@ -506,11 +478,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void getImportOperationProgress(UUID id, AsyncCallback<DataImportProgress> asyncCallback);
void allowCompetitorResetToDefaults(Iterable<CompetitorDTO> competitors, AsyncCallback<Void> asyncCallback);
void linkBoatToCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName, String competitorIdAsString, String boatIdAsString, AsyncCallback<Boolean> asyncCallback);
void unlinkBoatFromCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName, String competitorIdAsString, AsyncCallback<Boolean> asyncCallback);
void allowCompetitorResetToDefaults(List<CompetitorDTO> competitors, AsyncCallback<Void> asyncCallback);
void removeDeviceConfiguration(UUID deviceConfigurationId, AsyncCallback<Boolean> asyncCallback);
@@ -528,13 +496,8 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void denoteForRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName,
AsyncCallback<Boolean> callback);
void denoteForRaceLogTracking(String leaderboardName, AsyncCallback<Void> callback);
void denoteForRaceLogTracking(String leaderboardName,String prefix, AsyncCallback<Void> callback);
void startRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, boolean trackWind,
boolean correctWindByDeclination, AsyncCallback<Void> callback);
void startRaceLogTracking(List<Triple<String, String, String>> leaderboardRaceColumnFleetNames,
final boolean trackWind, final boolean correctWindByDeclination, AsyncCallback<Void> callback);
@@ -568,9 +531,6 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void pingMark(String leaderboardName, MarkDTO mark,
TimePoint timePoint, Position position, AsyncCallback<Void> callback);
void revokeRaceAndRegattaLogEvents(String leaderboardName, String raceColumnName, String fleetName,
List<UUID> eventIds, AsyncCallback<Void> callback);
void removeSeries(RegattaIdentifier regattaIdentifier, String seriesName, AsyncCallback<Void> callback);
void removeDenotationForRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName,
@@ -582,7 +542,7 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void updateSuppressedMarkPassings(String leaderboardName, String raceColumnName, String fleetName,
Integer newZeroBasedIndexOfSuppressedMarkPassing, CompetitorDTO competitorDTO, AsyncCallback<Void> callback);
void createRegattaStructure(Iterable<RegattaDTO> regattaNames, EventDTO newEvent,
void createRegattaStructure(List<RegattaDTO> regattaNames, EventDTO newEvent,
AsyncCallback<Void> asyncCallback);
void updateFixedMarkPassing(String leaderboardName, String raceColumnName, String fleetName,
@@ -595,7 +555,8 @@ public interface SailingServiceWriteAsync extends FileStorageManagementGwtServic
void inviteBuoyTenderViaEmail(String serverUrlWithoutTrailingSlash, EventDTO eventDto, String leaderboardName,
String emails, String iOSAppUrl, String androidAppUrl, String localeInfoName, AsyncCallback<Void> callback);
void revokeRaceAndRegattaLogEvents(String leaderboardName, List<UUID> eventIds, AsyncCallback<Void> callback);
void revokeRaceAndRegattaLogEvents(String leaderboardName, List<UUID> eventIds, AsyncCallback<Void> callback);
void closeOpenEndedDeviceMapping(String leaderboardName, DeviceMappingDTO mappingDto, Date closingTimePoint,
AsyncCallback<Void> asyncCallback);
@@ -132,7 +132,6 @@ import com.sap.sailing.domain.base.RemoteSailingServerReference;
import com.sap.sailing.domain.base.SailingServerConfiguration;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.base.Sideline;
import com.sap.sailing.domain.base.SpeedWithBearingWithConfidence;
import com.sap.sailing.domain.base.Waypoint;
import com.sap.sailing.domain.base.configuration.DeviceConfiguration;
import com.sap.sailing.domain.base.configuration.RacingProcedureConfiguration;
@@ -153,7 +152,6 @@ import com.sap.sailing.domain.common.CompetitorDescriptor;
import com.sap.sailing.domain.common.DetailType;
import com.sap.sailing.domain.common.DeviceIdentifier;
import com.sap.sailing.domain.common.LeaderboardNameConstants;
import com.sap.sailing.domain.common.LeaderboardType;
import com.sap.sailing.domain.common.LegIdentifier;
import com.sap.sailing.domain.common.LegType;
import com.sap.sailing.domain.common.MailInvitationType;
@@ -162,7 +160,6 @@ import com.sap.sailing.domain.common.NauticalSide;
import com.sap.sailing.domain.common.NoWindException;
import com.sap.sailing.domain.common.NotFoundException;
import com.sap.sailing.domain.common.PathType;
import com.sap.sailing.domain.common.PolarSheetsXYDiagramData;
import com.sap.sailing.domain.common.Position;
import com.sap.sailing.domain.common.RaceFetcher;
import com.sap.sailing.domain.common.RankingMetrics;
@@ -203,12 +200,10 @@ import com.sap.sailing.domain.common.dto.RaceLogTrackingInfoDTO;
import com.sap.sailing.domain.common.dto.SeriesCreationParametersDTO;
import com.sap.sailing.domain.common.dto.TagDTO;
import com.sap.sailing.domain.common.dto.TrackedRaceDTO;
import com.sap.sailing.domain.common.impl.DegreePosition;
import com.sap.sailing.domain.common.impl.KilometersPerHourSpeedImpl;
import com.sap.sailing.domain.common.impl.KnotSpeedImpl;
import com.sap.sailing.domain.common.impl.KnotSpeedWithBearingImpl;
import com.sap.sailing.domain.common.impl.MeterDistance;
import com.sap.sailing.domain.common.impl.PolarSheetsXYDiagramDataImpl;
import com.sap.sailing.domain.common.impl.WindSourceImpl;
import com.sap.sailing.domain.common.media.MediaTrack;
import com.sap.sailing.domain.common.orc.ImpliedWindSource;
@@ -329,7 +324,6 @@ import com.sap.sailing.gwt.common.client.EventWindFinderUtil;
import com.sap.sailing.gwt.server.HomeServiceUtil;
import com.sap.sailing.gwt.ui.client.SailingService;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTrackDTO;
import com.sap.sailing.gwt.ui.client.shared.charts.MarkPositionService.MarkTracksDTO;
import com.sap.sailing.gwt.ui.shared.AccountWithSecurityDTO;
import com.sap.sailing.gwt.ui.shared.CompactBoatPositionsDTO;
import com.sap.sailing.gwt.ui.shared.CompactRaceMapDataDTO;
@@ -560,8 +554,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
private final com.sap.sailing.domain.tractracadapter.persistence.DomainObjectFactory tractracDomainObjectFactory;
private final com.sap.sse.common.CountryCodeFactory countryCodeFactory;
protected final Executor executor;
protected final com.sap.sailing.domain.base.DomainFactory baseDomainFactory;
@@ -623,7 +615,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
.getTracTracDomainFactory());
tractracMongoObjectFactory = com.sap.sailing.domain.tractracadapter.persistence.MongoObjectFactory.INSTANCE;
swissTimingFactory = SwissTimingFactory.INSTANCE;
countryCodeFactory = com.sap.sse.common.CountryCodeFactory.INSTANCE;
leaderboardDifferenceCacheByIdPair = new LinkedHashMap<com.sap.sse.common.Util.Pair<String, String>, IncrementalLeaderboardDTO>(LEADERBOARD_DIFFERENCE_CACHE_SIZE, 0.75f, /* accessOrder */ true) {
private static final long serialVersionUID = 3775119859130148488L;
@Override
@@ -938,14 +929,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
getService().getAllRegattas(), this::convertToRegattaDTO);
}
//READ
@Override
public List<RegattaDTO> getRegattasWithUpdatePermission() {
return getSecurityService().mapAndFilterByExplicitPermissionForCurrentUser(
new HasPermissions.Action[] { DefaultActions.READ, DefaultActions.UPDATE },
getService().getAllRegattas(), this::convertToRegattaDTO);
}
//READ
@Override
public RegattaDTO getRegattaByName(String regattaName) {
@@ -1428,70 +1411,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return windDTO;
}
/**
* Fetches the {@link WindTrack#getAveragedWind(Position, TimePoint) average wind} from all wind tracks or those identified
* by <code>windSourceTypeNames</code>
*/
@Override
//READ
public WindInfoForRaceDTO getAveragedWindInfo(RegattaAndRaceIdentifier raceIdentifier, Date from, long millisecondsStepWidth,
int numberOfFixes, double latDeg, double lngDeg, Collection<String> windSourceTypeNames)
throws NoWindException {
Position position = new DegreePosition(latDeg, lngDeg);
WindInfoForRaceDTO result = null;
TrackedRace trackedRace = getExistingTrackedRace(raceIdentifier);
getSecurityService().checkCurrentUserReadPermission(trackedRace);
if (trackedRace != null) {
result = new WindInfoForRaceDTO();
result.raceIsKnownToStartUpwind = trackedRace.raceIsKnownToStartUpwind();
List<WindSource> windSourcesToExclude = new ArrayList<WindSource>();
for (WindSource windSourceToExclude : trackedRace.getWindSourcesToExclude()) {
windSourcesToExclude.add(windSourceToExclude);
}
result.windSourcesToExclude = windSourcesToExclude;
Map<WindSource, WindTrackInfoDTO> windTrackInfoDTOs = new HashMap<WindSource, WindTrackInfoDTO>();
result.windTrackInfoByWindSource = windTrackInfoDTOs;
List<WindSource> windSourcesToDeliver = new ArrayList<WindSource>();
Util.addAll(trackedRace.getWindSources(), windSourcesToDeliver);
windSourcesToDeliver.add(new WindSourceImpl(WindSourceType.COMBINED));
for (WindSource windSource : windSourcesToDeliver) {
if (windSourceTypeNames == null || windSourceTypeNames.contains(windSource.getType().name())) {
TimePoint fromTimePoint = new MillisecondsTimePoint(from);
WindTrackInfoDTO windTrackInfoDTO = new WindTrackInfoDTO();
windTrackInfoDTO.windFixes = new ArrayList<WindDTO>();
WindTrack windTrack = trackedRace.getOrCreateWindTrack(windSource);
windTrackInfoDTOs.put(windSource, windTrackInfoDTO);
windTrackInfoDTO.resolutionOutsideOfWhichNoFixWillBeReturned = windTrack
.getResolutionOutsideOfWhichNoFixWillBeReturned();
windTrackInfoDTO.dampeningIntervalInMilliseconds = windTrack
.getMillisecondsOverWhichToAverageWind();
TimePoint timePoint = fromTimePoint;
Double minWindConfidence = 2.0;
Double maxWindConfidence = -1.0;
for (int i = 0; i < numberOfFixes; i++) {
WindWithConfidence<com.sap.sse.common.Util.Pair<Position, TimePoint>> averagedWindWithConfidence = windTrack.getAveragedWindWithConfidence(position, timePoint);
if (averagedWindWithConfidence != null) {
WindDTO windDTO = createWindDTOFromAlreadyAveraged(averagedWindWithConfidence.getObject(), timePoint);
double confidence = averagedWindWithConfidence.getConfidence();
windDTO.confidence = confidence;
windTrackInfoDTO.windFixes.add(windDTO);
if (confidence < minWindConfidence) {
minWindConfidence = confidence;
}
if (confidence > maxWindConfidence) {
maxWindConfidence = confidence;
}
}
timePoint = new MillisecondsTimePoint(timePoint.asMillis() + millisecondsStepWidth);
}
windTrackInfoDTO.minWindConfidence = minWindConfidence;
windTrackInfoDTO.maxWindConfidence = maxWindConfidence;
}
}
}
return result;
}
/**
* @param onlyUpToNewestEvent
* if <code>true</code>, no wind data will be returned for time points later than
@@ -2491,20 +2410,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
@Override
//READ
public LeaderboardType getLeaderboardType(String leaderboardName) {
final LeaderboardType result;
final Leaderboard leaderboard = getService().getLeaderboards().get(leaderboardName);
if (leaderboard != null) {
getSecurityService().checkCurrentUserReadPermission(leaderboard);
result = leaderboard.getLeaderboardType();
} else {
result = null;
}
return result;
}
@Override
//READ
public List<StrippedLeaderboardDTOWithSecurity> getLeaderboardsWithSecurity() {
@@ -2546,36 +2451,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
@Override
//READ
public List<StrippedLeaderboardDTO> getLeaderboardsByRaceAndRegatta(String raceName, RegattaIdentifier regattaIdentifier) {
List<StrippedLeaderboardDTO> results = new ArrayList<StrippedLeaderboardDTO>();
Map<String, Leaderboard> leaderboards = getService().getLeaderboards();
for (Leaderboard leaderboard : leaderboards.values()) {
if (getSecurityService().hasCurrentUserReadPermission(leaderboard)) {
if (leaderboard instanceof RegattaLeaderboard && ((RegattaLeaderboard) leaderboard).getRegatta()
.getRegattaIdentifier().equals(regattaIdentifier)) {
Iterable<RaceColumn> races = leaderboard.getRaceColumns();
for (RaceColumn raceInLeaderboard : races) {
for (Fleet fleet : raceInLeaderboard.getFleets()) {
TrackedRace trackedRace = raceInLeaderboard.getTrackedRace(fleet);
if (getSecurityService().hasCurrentUserReadPermission(trackedRace)) {
if (trackedRace != null) {
RaceDefinition trackedRaceDef = trackedRace.getRace();
if (trackedRaceDef.getName().equals(raceName)) {
results.add(createStrippedLeaderboardDTO(leaderboard, false, false));
break;
}
}
}
}
}
}
}
}
return results;
}
/**
* Creates a {@link LeaderboardDTO} for <code>leaderboard</code> and fills in the name, race master data
* in the form of {@link RaceColumnDTO}s, whether or not there are {@link LeaderboardDTO#hasCarriedPoints carried points}
@@ -2699,50 +2574,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
@Override
//READ
public boolean existsSwissTimingConfigurationForCurrentUser(String jsonUrl)
throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final SwissTimingConfigurationWithSecurityDTO dto : getPreviousSwissTimingConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
@Override
//READ
public boolean existsSwissTimingArchiveConfigurationForCurrentUser(String jsonUrl)
throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final SwissTimingArchiveConfigurationWithSecurityDTO dto : getPreviousSwissTimingArchiveConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
@Override
//READ
public boolean existsTracTracConfigurationForCurrentUser(String jsonUrl) throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final TracTracConfigurationWithSecurityDTO dto : getPreviousTracTracConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
@Override
//READ
public List<SwissTimingConfigurationWithSecurityDTO> getPreviousSwissTimingConfigurations() {
@@ -2851,19 +2682,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
}
}
@Override
//READ
public String[] getCountryCodes() {
List<String> countryCodes = new ArrayList<String>();
for (CountryCode cc : countryCodeFactory.getAll()) {
if (cc.getThreeLetterIOCCode() != null && !cc.getThreeLetterIOCCode().equals("")) {
countryCodes.add(cc.getThreeLetterIOCCode());
}
}
Collections.sort(countryCodes);
return countryCodes.toArray(new String[0]);
}
/**
* Finds a competitor in a sequence of competitors that has an {@link Competitor#getId()} equal to <code>id</code>.
*/
@@ -4394,14 +4212,13 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return baseDomainFactory;
}
@Override
//READ
public List<RegattaOverviewEntryDTO> getRaceStateEntriesForLeaderboard(String leaderboardName,
boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay, Duration clientTimeZoneOffset, final List<String> visibleRegattas)
throws NoWindException, InterruptedException, ExecutionException {
private List<RegattaOverviewEntryDTO> getRaceStateEntriesForLeaderboard(String leaderboardName,
boolean showOnlyCurrentlyRunningRaces, boolean showOnlyRacesOfSameDay, Duration clientTimeZoneOffset,
final List<String> visibleRegattas) throws NoWindException, InterruptedException, ExecutionException {
Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName);
getSecurityService().checkCurrentUserReadPermission(leaderboard);
return getRaceStateEntriesForLeaderboard(leaderboard, showOnlyCurrentlyRunningRaces, showOnlyRacesOfSameDay, clientTimeZoneOffset, visibleRegattas);
return getRaceStateEntriesForLeaderboard(leaderboard, showOnlyCurrentlyRunningRaces, showOnlyRacesOfSameDay,
clientTimeZoneOffset, visibleRegattas);
}
/**
@@ -4782,12 +4599,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
}
}
//??
@Override
public Integer getStructureImportOperationProgress() {
return 0;
}
@Override
//READ
public Iterable<CompetitorDTO> getCompetitors(boolean filterCompetitorsWithBoat,
@@ -4879,14 +4690,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return configs;
}
@Override
//READ
public DeviceConfigurationDTO getDeviceConfiguration(UUID id) {
DeviceConfiguration configuration = getService().getDeviceConfigurationById(id);
getSecurityService().checkCurrentUserReadPermission(configuration);
return configuration == null ? null : convertToDeviceConfigurationDTO(configuration);
}
@Override
//READ
public void createOrUpdateDeviceConfiguration(DeviceConfigurationDTO configurationDTO) {
@@ -4907,20 +4710,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
}
}
//READ
private DeviceConfigurationDTO convertToDeviceConfigurationDTO(DeviceConfiguration configuration) {
DeviceConfigurationDTO dto = new DeviceConfigurationDTO();
dto.id = configuration.getId();
dto.name = configuration.getName();
dto.allowedCourseAreaNames = configuration.getAllowedCourseAreaNames();
dto.resultsMailRecipient = configuration.getResultsMailRecipient();
dto.byNameDesignerCourseNames = configuration.getByNameCourseDesignerCourseNames();
if (configuration.getRegattaConfiguration() != null) {
dto.regattaConfiguration = convertToRegattaConfigurationDTO(configuration.getRegattaConfiguration());
}
return dto;
}
//READ
private DeviceConfigurationWithSecurityDTO convertToDeviceConfigurationWithSecurityDTO(
DeviceConfiguration configuration) {
@@ -5132,13 +4921,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
result.getB() == null ? null : result.getB().asDate(), result.getC());
}
@Override
//READ
public Iterable<String> getAllIgtimiAccountEmailAddresses() {
return getSecurityService().mapAndFilterByReadPermissionForCurrentUser(
getIgtimiConnectionFactory().getAllAccounts(), acc -> acc.getUser().getEmail());
}
@Override
//READ
public Iterable<AccountWithSecurityDTO> getAllIgtimiAccountsWithSecurity() {
@@ -5589,61 +5371,10 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
@Override
//READ
public PolarSheetsXYDiagramData createXYDiagramForBoatClass(String boatClassName) {
BoatClass boatClass = getService().getBaseDomainFactory().getOrCreateBoatClass(boatClassName);
Map<Pair<LegType, Tack>, List<Pair<Double, Double>>> regressionSpeedDataLists = new HashMap<>();
for (LegType legType : new LegType[] { LegType.UPWIND, LegType.DOWNWIND }) {
for (Tack tack : new Tack[] { Tack.PORT, Tack.STARBOARD }) {
regressionSpeedDataLists.put(new Pair<LegType, Tack>(legType, tack),
new ArrayList<Pair<Double, Double>>());
}
}
for (double windInKnots = 0.1; windInKnots < 30; windInKnots = windInKnots + 0.1) {
for (LegType legType : new LegType[] { LegType.UPWIND, LegType.DOWNWIND }) {
for (Tack tack : new Tack[] { Tack.PORT, Tack.STARBOARD }) {
try {
SpeedWithBearingWithConfidence<Void> averageUpwindStarboardRegression = getService()
.getPolarDataService().getAverageSpeedWithBearing(boatClass,
new KnotSpeedImpl(windInKnots), legType, tack);
regressionSpeedDataLists.get(new Pair<LegType, Tack>(legType, tack)).add(
new Pair<Double, Double>(windInKnots, averageUpwindStarboardRegression.getObject()
.getKnots()));
} catch (NotEnoughDataHasBeenAddedException e) {
// Do not add a point to the result
}
}
}
}
PolarSheetsXYDiagramData data = new PolarSheetsXYDiagramDataImpl(regressionSpeedDataLists);
return data;
}
protected Locale getLocale(String localeInfoName) {
return ResourceBundleStringMessages.Util.getLocaleFor(localeInfoName);
}
@Override
//READ
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()) {
if (getSecurityService().hasCurrentUserReadPermission(lg)) {
result.add(convertToLeaderboardGroupDTO(lg, /* withGeoLocationData */false, true));
}
}
return result;
}
/**
* Gets all Marks defined in the RegattaLog and the trackedRace
* @throws DoesNotHaveRegattaLogException
@@ -5916,17 +5647,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return marks;
}
@Override
//READ
public MarkTracksDTO getMarkTracks(String leaderboardName, String raceColumnName, String fleetName) {
final List<MarkTrackDTO> markTracks = new ArrayList<>();
for (final MarkDTO mark : getMarksInTrackedRace(leaderboardName, raceColumnName, fleetName)) {
MarkTrackDTO markTrackDTO = getMarkTrack(leaderboardName, raceColumnName, fleetName, mark.getIdAsString());
markTracks.add(markTrackDTO);
}
return new MarkTracksDTO(markTracks);
}
//READ
private MarkTrackDTO getMarkTrack(Leaderboard leaderboard, RaceColumn raceColumn, Fleet fleet,
String markIdAsString) {
@@ -6475,29 +6195,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return imageDTOs;
}
@Override
//READ
public List<TagDTO> getAllTags(String leaderboardName, String raceColumnName, String fleetName) {
List<TagDTO> result = new ArrayList<TagDTO>();
result.addAll(getPublicTags(leaderboardName, raceColumnName, fleetName));
result.addAll(getPrivateTags(leaderboardName, raceColumnName, fleetName));
return result;
}
@Override
//READ
public List<TagDTO> getPublicTags(String leaderboardName, String raceColumnName, String fleetName) {
List<TagDTO> result = new ArrayList<TagDTO>();
try {
result.addAll(getService().getTaggingService().getPublicTags(leaderboardName, raceColumnName, fleetName, null, false));
} catch (Exception e) {
logger.log(Level.WARNING, "Problem obtaining public tags for leaderboard "+leaderboardName+", race column "+raceColumnName+
", fleet "+fleetName, e);
// do nothing as method will always return at least an empty list
}
return result;
}
@Override
//READ
public List<TagDTO> getPrivateTags(String leaderboardName, String raceColumnName, String fleetName) {
@@ -6557,17 +6254,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
//READ
@Override
public List<String> getPossibleTennants() {
// FIXME this is most likely greatly oversimplified and needs to be improved
ArrayList<String> tenants = new ArrayList<>();
for (UserGroup group : getSecurityService().getCurrentUser().getUserGroups()) {
tenants.add(group.getName());
}
return tenants;
}
//READ
private Boolean isSelfServiceServer() {
final AccessControlListAnnotation serverAclOrNull = getSecurityService().getAccessControlList(getServerInfo().getIdentifier());
@@ -6823,50 +6509,6 @@ public class SailingServiceImpl extends ResultCachingProxiedRemoteServiceServlet
return result;
}
@Override
//READ
public Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(
RegattaAndRaceIdentifier raceIdentifier) throws NotFoundException {
final TrackedRace trackedRace = getExistingTrackedRace(raceIdentifier);
if (trackedRace == null) {
throw new NotFoundException("Tracked race named "+raceIdentifier+" not found");
}
getService().getSecurityService().checkCurrentUserReadPermission(trackedRace);
final Map<String, ORCCertificate> result = new HashMap<>();
final Map<Serializable, Boat> boatsById = new HashMap<>();
for (final Boat boat : trackedRace.getRace().getBoats()) {
boatsById.put(boat.getId(), boat);
}
for (final RaceLog raceLog : trackedRace.getAttachedRaceLogs()) {
for (final Entry<Boat, ORCCertificate> e : new RaceLogORCCertificateAssignmentFinder(raceLog, boatsById).analyze().entrySet()) {
result.put(e.getKey().getId().toString(), e.getValue());
}
}
return result;
}
@Override
//READ
public Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName) throws NotFoundException {
final Leaderboard leaderboard = getLeaderboardByName(leaderboardName);
if (leaderboard instanceof LeaderboardThatHasRegattaLike) {
getService().getSecurityService().checkCurrentUserReadPermission(leaderboard);
final Map<String, ORCCertificate> result = new HashMap<>();
final Map<Serializable, Boat> boatsById = new HashMap<>();
for (final Boat boat : leaderboard.getAllBoats()) {
boatsById.put(boat.getId(), boat);
}
for (final Entry<Boat, ORCCertificate> e : new RegattaLogORCCertificateAssignmentFinder(
((LeaderboardThatHasRegattaLike) leaderboard).getRegattaLike().getRegattaLog(), boatsById).analyze().entrySet()) {
result.put(e.getKey().getId().toString(), e.getValue());
}
return result;
} else {
throw new IllegalArgumentException("Leaderboard must be of type "+LeaderboardThatHasRegattaLike.class.getSimpleName()+
", but leaderboard "+leaderboardName+" is of type "+leaderboard.getClass().getSimpleName());
}
}
@Override
//READ
public Map<String, ORCCertificate> getORCCertificateAssignmentsByBoatIdAsString(String leaderboardName,
@@ -286,8 +286,6 @@ import com.sap.sailing.server.operationaltransformation.CreateLeaderboardGroup;
import com.sap.sailing.server.operationaltransformation.CreateRegattaLeaderboard;
import com.sap.sailing.server.operationaltransformation.CreateRegattaLeaderboardWithEliminations;
import com.sap.sailing.server.operationaltransformation.DisconnectLeaderboardColumnFromTrackedRace;
import com.sap.sailing.server.operationaltransformation.MoveColumnInSeriesDown;
import com.sap.sailing.server.operationaltransformation.MoveColumnInSeriesUp;
import com.sap.sailing.server.operationaltransformation.MoveLeaderboardColumnDown;
import com.sap.sailing.server.operationaltransformation.MoveLeaderboardColumnUp;
import com.sap.sailing.server.operationaltransformation.RemoveAndUntrackRace;
@@ -300,9 +298,7 @@ import com.sap.sailing.server.operationaltransformation.RemoveLeaderboardGroup;
import com.sap.sailing.server.operationaltransformation.RemoveRegatta;
import com.sap.sailing.server.operationaltransformation.RemoveSeries;
import com.sap.sailing.server.operationaltransformation.RenameEvent;
import com.sap.sailing.server.operationaltransformation.RenameLeaderboard;
import com.sap.sailing.server.operationaltransformation.RenameLeaderboardColumn;
import com.sap.sailing.server.operationaltransformation.RenameLeaderboardGroup;
import com.sap.sailing.server.operationaltransformation.SetRaceIsKnownToStartUpwind;
import com.sap.sailing.server.operationaltransformation.SetSuppressedFlagForCompetitorInLeaderboard;
import com.sap.sailing.server.operationaltransformation.SetWindSourcesToExclude;
@@ -506,7 +502,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void trackWithTracTrac(RegattaIdentifier regattaToAddTo, Iterable<TracTracRaceRecordDTO> rrs, String liveURI, String storedURI,
public void trackWithTracTrac(RegattaIdentifier regattaToAddTo, List<TracTracRaceRecordDTO> rrs, String liveURI, String storedURI,
String courseDesignUpdateURI, boolean trackWind, final boolean correctWindByDeclination,
final Duration offsetToStartTimeOfSimulatedRace, final boolean useInternalMarkPassingAlgorithm,
boolean useOfficialEventsToUpdateRaceLog, String tracTracUsername, String tracTracPassword)
@@ -591,7 +587,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void stopTrackingRaces(Iterable<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) throws Exception {
public void stopTrackingRaces(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) throws Exception {
for (RegattaAndRaceIdentifier regattaAndRaceIdentifier : regattaAndRaceIdentifiers) {
getSecurityService().checkCurrentUserUpdatePermission(regattaAndRaceIdentifier);
getService().apply(new StopTrackingRace(regattaAndRaceIdentifier));
@@ -599,7 +595,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void removeAndUntrackRaces(Iterable<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) {
public void removeAndUntrackRaces(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers) {
for (RegattaAndRaceIdentifier regattaAndRaceIdentifier : regattaAndRaceIdentifiers) {
getSecurityService().checkPermissionAndDeleteOwnershipForObjectRemoval(regattaAndRaceIdentifier,
() -> getService().apply(new RemoveAndUntrackRace(regattaAndRaceIdentifier)));
@@ -683,7 +679,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public void setWindSourcesToExclude(RegattaAndRaceIdentifier raceIdentifier,
Iterable<WindSource> windSourcesToExclude) {
List<WindSource> windSourcesToExclude) {
getSecurityService().checkCurrentUserUpdatePermission(raceIdentifier);
getService().apply(new SetWindSourcesToExclude(raceIdentifier, windSourcesToExclude));
}
@@ -727,7 +723,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void createRegattaStructure(final Iterable<RegattaDTO> regattas, final EventDTO newEvent) throws MalformedURLException {
public void createRegattaStructure(final List<RegattaDTO> regattas, final EventDTO newEvent) throws MalformedURLException {
final List<String> leaderboardNames = new ArrayList<String>();
for (RegattaDTO regatta : regattas) {
createRegattaFromRegattaDTO(regatta);
@@ -803,7 +799,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public StrippedLeaderboardDTOWithSecurity createFlexibleLeaderboard(String leaderboardName,
String leaderboardDisplayName, int[] discardThresholds, ScoringSchemeType scoringSchemeType,
Iterable<UUID> courseAreaIds) {
List<UUID> courseAreaIds) {
return getSecurityService().setOwnershipCheckPermissionForObjectCreationAndRevertOnError(
SecuredDomainType.LEADERBOARD, Leaderboard.getTypeRelativeObjectIdentifier(leaderboardName),
leaderboardDisplayName, new Callable<StrippedLeaderboardDTOWithSecurity>() {
@@ -849,7 +845,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public StrippedLeaderboardDTOWithSecurity updateLeaderboard(String leaderboardName, String newLeaderboardName,
String newLeaderboardDisplayName, int[] newDiscardingThresholds, Iterable<UUID> newCourseAreaIds) {
String newLeaderboardDisplayName, int[] newDiscardingThresholds, List<UUID> newCourseAreaIds) {
SecurityUtils.getSubject().checkPermission(
SecuredDomainType.LEADERBOARD.getStringPermissionForTypeRelativeIdentifier(DefaultActions.UPDATE,
Leaderboard.getTypeRelativeObjectIdentifier(leaderboardName)));
@@ -878,14 +874,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
}
@Override
public void renameLeaderboard(String leaderboardName, String newLeaderboardName) {
SecurityUtils.getSubject().checkPermission(
SecuredDomainType.LEADERBOARD.getStringPermissionForTypeRelativeIdentifier(DefaultActions.UPDATE,
Leaderboard.getTypeRelativeObjectIdentifier(leaderboardName)));
getService().apply(new RenameLeaderboard(leaderboardName, newLeaderboardName));
}
@Override
public void addColumnToLeaderboard(String columnName, String leaderboardName, boolean medalRace) {
SecurityUtils.getSubject().checkPermission(
@@ -894,13 +882,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
getService().apply(new AddColumnToLeaderboard(columnName, leaderboardName, medalRace));
}
@Override
public void renameLeaderboardGroup(String oldName, String newName) {
final LeaderboardGroup leaderboardGroupByName = getService().getLeaderboardGroupByName(oldName);
getSecurityService().checkCurrentUserUpdatePermission(leaderboardGroupByName);
getService().apply(new RenameLeaderboardGroup(oldName, newName));
}
@Override
public void removeLeaderboardGroups(Set<String> groupNames) {
for (String groupName : groupNames) {
@@ -935,16 +916,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
}
@Override
public void removeLeaderboardColumns(String leaderboardName, List<String> columnsToRemove) {
SecurityUtils.getSubject().checkPermission(
SecuredDomainType.LEADERBOARD.getStringPermissionForTypeRelativeIdentifier(DefaultActions.UPDATE,
Leaderboard.getTypeRelativeObjectIdentifier(leaderboardName)));
for (String columnToRemove : columnsToRemove) {
getService().apply(new RemoveLeaderboardColumn(columnToRemove, leaderboardName));
}
}
@Override
public void removeLeaderboardColumn(String leaderboardName, String columnName) {
SecurityUtils.getSubject().checkPermission(
@@ -1108,16 +1079,11 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
getService().apply(new UpdateIsMedalRace(leaderboardName, columnName, isMedalRace));
}
@Override
public void updateRaceDelayToLive(RegattaAndRaceIdentifier regattaAndRaceIdentifier, long delayToLiveInMs) {
getSecurityService().checkCurrentUserUpdatePermission(regattaAndRaceIdentifier);
getService().apply(new UpdateRaceDelayToLive(regattaAndRaceIdentifier, delayToLiveInMs));
}
@Override
public void updateRacesDelayToLive(List<RegattaAndRaceIdentifier> regattaAndRaceIdentifiers, long delayToLiveInMs) {
for (RegattaAndRaceIdentifier regattaAndRaceIdentifier : regattaAndRaceIdentifiers) {
updateRaceDelayToLive(regattaAndRaceIdentifier, delayToLiveInMs);
getSecurityService().checkCurrentUserUpdatePermission(regattaAndRaceIdentifier);
getService().apply(new UpdateRaceDelayToLive(regattaAndRaceIdentifier, delayToLiveInMs));
}
}
@@ -1163,7 +1129,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, Iterable<SwissTimingRaceRecordDTO> rrs,
public void trackWithSwissTiming(RegattaIdentifier regattaToAddTo, List<SwissTimingRaceRecordDTO> rrs,
String hostname, int port, boolean trackWind, final boolean correctWindByDeclination,
boolean useInternalMarkPassingAlgorithm, String updateURL, String updateUsername, String updatePassword,
String eventName, String manage2SailEventUrl) throws InterruptedException, ParseException, Exception {
@@ -1268,9 +1234,9 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public EventDTO updateEvent(UUID eventId, String eventName, String eventDescription, Date startDate, Date endDate,
VenueDTO venue, boolean isPublic, Iterable<UUID> leaderboardGroupIds, String officialWebsiteURLString,
String baseURLAsString, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<String> windFinderReviewedSpotCollectionIds)
VenueDTO venue, boolean isPublic, List<UUID> leaderboardGroupIds, String officialWebsiteURLString,
String baseURLAsString, Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<String> windFinderReviewedSpotCollectionIds)
throws MalformedURLException, UnauthorizedException {
if (SecurityUtils.getSubject().isPermitted(SecuredDomainType.EVENT.getStringPermissionForTypeRelativeIdentifier(
DefaultActions.UPDATE, EventBaseImpl.getTypeRelativeObjectIdentifier(eventId)))) {
@@ -1292,8 +1258,8 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public EventDTO createEvent(String eventName, String eventDescription, Date startDate, Date endDate, String venue,
boolean isPublic, List<String> courseAreaNames, String officialWebsiteURLAsString, String baseURLAsString,
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, Iterable<ImageDTO> images,
Iterable<VideoDTO> videos, Iterable<UUID> leaderboardGroupIds)
Map<String, String> sailorsInfoWebsiteURLsByLocaleName, List<ImageDTO> images,
List<VideoDTO> videos, List<UUID> leaderboardGroupIds)
throws UnauthorizedException {
final UUID eventUuid = UUID.randomUUID();
@@ -1419,7 +1385,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void updateRegatta(RegattaIdentifier regattaName, Date startDate, Date endDate, Iterable<UUID> courseAreaUuids,
public void updateRegatta(RegattaIdentifier regattaName, Date startDate, Date endDate, List<UUID> courseAreaUuids,
RegattaConfigurationDTO configurationDTO, Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference, boolean controlTrackingFromStartAndFinishTimes,
boolean autoRestartTrackingUponCompetitorSetChange, String registrationLinkSecret, CompetitorRegistrationType registrationType) {
Regatta regatta = getService().getRegatta(regattaName);
@@ -1477,30 +1443,12 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
}
@Override
public void moveRaceColumnInSeriesUp(RegattaIdentifier regattaIdentifier, String seriesName, String columnName) {
Regatta regatta = getService().getRegatta(regattaIdentifier);
if (regatta != null) {
SecurityUtils.getSubject().checkPermission(SecuredDomainType.REGATTA.getStringPermissionForObject(DefaultActions.UPDATE, regatta));
}
getService().apply(new MoveColumnInSeriesUp(regattaIdentifier, seriesName, columnName));
}
@Override
public void moveRaceColumnInSeriesDown(RegattaIdentifier regattaIdentifier, String seriesName, String columnName) {
Regatta regatta = getService().getRegatta(regattaIdentifier);
if (regatta != null) {
SecurityUtils.getSubject().checkPermission(SecuredDomainType.REGATTA.getStringPermissionForObject(DefaultActions.UPDATE, regatta));
}
getService().apply(new MoveColumnInSeriesDown(regattaIdentifier, seriesName, columnName));
}
@Override
public RegattaDTO createRegatta(String regattaName, String boatClassName,
boolean canBoatsOfCompetitorsChangePerRace, CompetitorRegistrationType competitorRegistrationType, String registrationLinkSecret,
Date startDate, Date endDate,
RegattaCreationParametersDTO seriesNamesWithFleetNamesAndFleetOrderingAndMedal,
boolean persistent, ScoringSchemeType scoringSchemeType, Iterable<UUID> courseAreaIds, Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference,
boolean persistent, ScoringSchemeType scoringSchemeType, List<UUID> courseAreaIds, Double buoyZoneRadiusInHullLengths, boolean useStartTimeInference,
boolean controlTrackingFromStartAndFinishTimes, boolean autoRestartTrackingUponCompetitorSetChange, RankingMetrics rankingMetricType) {
return getSecurityService().setOwnershipCheckPermissionForObjectCreationAndRevertOnError(
SecuredDomainType.REGATTA, Regatta.getTypeRelativeObjectIdentifier(regattaName),
@@ -1525,7 +1473,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
this.createRegatta(regatta.getName(), regatta.boatClass.getName(), regatta.canBoatsOfCompetitorsChangePerRace,
regatta.competitorRegistrationType, regatta.registrationLinkSecret, regatta.startDate, regatta.endDate,
new RegattaCreationParametersDTO(getSeriesCreationParameters(regatta)), true, regatta.scoringScheme,
Util.map(regatta.courseAreas, CourseAreaDTO::getId), regatta.buoyZoneRadiusInHullLengths,
Util.mapToArrayList(regatta.courseAreas, CourseAreaDTO::getId), regatta.buoyZoneRadiusInHullLengths,
regatta.useStartTimeInference, regatta.controlTrackingFromStartAndFinishTimes,
regatta.autoRestartTrackingUponCompetitorSetChange, regatta.rankingMetricType);
}
@@ -1728,7 +1676,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void allowCompetitorResetToDefaults(Iterable<CompetitorDTO> competitors) {
public void allowCompetitorResetToDefaults(List<CompetitorDTO> competitors) {
List<String> competitorIdsAsStrings = new ArrayList<String>();
for (CompetitorDTO competitor : competitors) {
getSecurityService().checkCurrentUserUpdatePermission(competitor);
@@ -1763,7 +1711,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
@Override
public void allowBoatResetToDefaults(Iterable<BoatDTO> boats) {
public void allowBoatResetToDefaults(List<BoatDTO> boats) {
List<String> boatIdsAsStrings = new ArrayList<String>();
for (BoatDTO boat : boats) {
getSecurityService().checkCurrentUserUpdatePermission(boat);
@@ -1772,56 +1720,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
getService().apply(new AllowBoatResetToDefaults(boatIdsAsStrings));
}
@Override
public boolean linkBoatToCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName,
String competitorIdAsString, String boatIdAsString) throws NotFoundException {
final Leaderboard leaderboard = getLeaderboardByName(leaderboardName);
getSecurityService().checkCurrentUserUpdatePermission(leaderboard);
boolean result = false;
Boat existingBoat = getService().getCompetitorAndBoatStore().getExistingBoatByIdAsString(boatIdAsString);
Competitor existingCompetitor = getService().getCompetitorAndBoatStore().getExistingCompetitorByIdAsString(competitorIdAsString);
RaceLog raceLog = getService().getRaceLog(leaderboardName, raceColumnName, fleetName);
if (raceLog != null && existingCompetitor != null && existingBoat != null) {
raceLog.add(new RaceLogRegisterCompetitorEventImpl(MillisecondsTimePoint.now(),
getService().getServerAuthor(), raceLog.getCurrentPassId(), existingCompetitor, existingBoat));
result = true;
}
return result;
}
@Override
public boolean unlinkBoatFromCompetitorForRace(String leaderboardName, String raceColumnName, String fleetName,
String competitorIdAsString) throws NotFoundException {
getSecurityService().checkCurrentUserUpdatePermission(getLeaderboardByName(leaderboardName));
final boolean result;
final Competitor existingCompetitor = getService().getCompetitorAndBoatStore().getExistingCompetitorByIdAsString(competitorIdAsString);
final RaceLog raceLog = getService().getRaceLog(leaderboardName, raceColumnName, fleetName);
if (raceLog != null && existingCompetitor != null) {
final List<RaceLogRegisterCompetitorEvent> linkEventsToRevoke = new ArrayList<>();
raceLog.lockForRead();
try {
for (RaceLogEvent event : raceLog.getUnrevokedEventsDescending()) {
if (event instanceof RaceLogRegisterCompetitorEvent) {
linkEventsToRevoke.add((RaceLogRegisterCompetitorEvent) event);
}
}
} finally {
raceLog.unlockAfterRead();
}
try {
for (RaceLogRegisterCompetitorEvent eventToRevoke : linkEventsToRevoke) {
raceLog.revokeEvent(getService().getServerAuthor(), eventToRevoke, "unlink competitor from boat");
}
} catch (NotRevokableException e) {
logger.log(Level.WARNING, "Could not unlink competitor from boat by adding RevokeEvent", e);
}
result = true;
} else {
result = false;
}
return result;
}
@Override
public DataImportProgress getImportOperationProgress(UUID id) {
return getService().getDataImportLock().getProgress(id);
@@ -2001,13 +1899,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
getRaceLogTrackingAdapter().removeDenotationForRaceLogTracking(getService(), raceLog);
}
@Override
public void denoteForRaceLogTracking(String leaderboardName) throws Exception {
Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName);
getSecurityService().checkCurrentUserUpdatePermission(leaderboard);
denoteForRaceLogTracking(leaderboardName, /* race name prefix */ null);
}
@Override
public void denoteForRaceLogTracking(String leaderboardName, String prefix) throws Exception {
Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName);
@@ -2169,7 +2060,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
@Override
public void fillRaceLogsFromPairingListTemplate(final String leaderboardName, final int flightMultiplier,
final Iterable<String> selectedFlightNames, final PairingListDTO pairingListDTO)
final List<String> selectedFlightNames, final PairingListDTO pairingListDTO)
throws NotFoundException, CompetitorRegistrationOnRaceLogDisabledException {
Leaderboard leaderboard = getLeaderboardByName(leaderboardName);
getSecurityService().checkCurrentUserUpdatePermission(leaderboard);
@@ -2402,14 +2293,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
}
}
@Override
public void revokeRaceAndRegattaLogEvents(String leaderboardName, String raceColumnName, String fleetName,
List<UUID> eventIds) throws NotRevokableException, NotFoundException {
getSecurityService().checkCurrentUserUpdatePermission(getLeaderboardByName(leaderboardName));
List<AbstractLog<?, ?>> logs = getLogHierarchy(leaderboardName, raceColumnName, fleetName);
revokeEventsFromLogs(logs, eventIds);
}
@Override
public void revokeRaceAndRegattaLogEvents(String leaderboardName,
List<UUID> eventIds) throws NotRevokableException, DoesNotHaveRegattaLogException, NotFoundException {
@@ -2447,8 +2330,7 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
return eventRevoked;
}
@Override
public void startRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, final boolean trackWind, final boolean correctWindByDeclination)
private void startRaceLogTracking(String leaderboardName, String raceColumnName, String fleetName, final boolean trackWind, final boolean correctWindByDeclination)
throws NotDenotedForRaceLogTrackingException, Exception {
// no permission checks needed here, since they already exist in PermissionAwareRaceTrackingHandler
Leaderboard leaderboard = getLeaderboardByName(leaderboardName);
@@ -3394,36 +3276,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
setORCPerformanceCurveInfo(getRaceLog(leaderboardName, raceColumnName, fleetName), legInfo);
}
private Triple<Integer, Integer, Integer> createCertificateAssignmentsForRace(String regattaName, String raceName,
Map<String, ORCCertificate> certificatesForBoatIdsAsString) throws IOException, NotFoundException {
final RegattaAndRaceIdentifier raceIdentifier = new RegattaNameAndRaceName(regattaName, raceName);
final TrackedRace trackedRace = getService().getTrackedRace(raceIdentifier);
if (trackedRace == null) {
throw new NotFoundException("Regatta named " + regattaName + " not found");
} else {
getService().getSecurityService().checkCurrentUserUpdatePermission(trackedRace);
final RaceLog raceLog = trackedRace.getAttachedRaceLogs().iterator().next();
final LogEventConstructor<RaceLogEvent, RaceLogEventVisitor> logEventConstructor = createRaceLogEventConstructor();
return createCertificateAssignments(raceLog, logEventConstructor, certificatesForBoatIdsAsString);
}
}
private Triple<Integer, Integer, Integer> createCertificateAssignmentsForLeaderboard(String leaderboardName,
Map<String, ORCCertificate> certificatesForBoatIdsAsString) throws IOException, NotFoundException {
final Leaderboard leaderboard = getService().getLeaderboardByName(leaderboardName);
if (leaderboard == null) {
throw new NotFoundException("Leaderboard named " + leaderboardName + " not found");
} else if (!(leaderboard instanceof LeaderboardThatHasRegattaLike)) {
throw new NotFoundException("Leaderboard named " + leaderboardName + " has no regatta log");
} else {
getService().getSecurityService().checkCurrentUserUpdatePermission(leaderboard);
final RegattaLog regattaLog = ((LeaderboardThatHasRegattaLike) leaderboard).getRegattaLike()
.getRegattaLog();
final LogEventConstructor<RegattaLogEvent, RegattaLogEventVisitor> logEventConstructor = createRegattaLogEventConstructor();
return createCertificateAssignments(regattaLog, logEventConstructor, certificatesForBoatIdsAsString);
}
}
private Triple<Integer, Integer, Integer> createCertificateAssignmentsForRaceLog(String leaderboardName,
String raceColumnName, String fleetName, Map<String, ORCCertificate> certificatesForBoatIdsAsString)
throws IOException, NotFoundException {
@@ -3462,20 +3314,6 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
return createCertificateAssignmentsForRegatta(regattaIdentifier, certificatesForBoatsWithIdAsString);
}
@Override
public Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(String leaderboardName,
Map<String, ORCCertificate> certificatesForBoatsWithIdAsString) throws IOException, NotFoundException {
return createCertificateAssignmentsForLeaderboard(leaderboardName, certificatesForBoatsWithIdAsString);
}
@Override
public Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(
RegattaAndRaceIdentifier raceIdentifier, Map<String, ORCCertificate> certificatesForBoatsWithIdAsString)
throws IOException, NotFoundException {
return createCertificateAssignmentsForRace(raceIdentifier.getRegattaName(), raceIdentifier.getRaceName(),
certificatesForBoatsWithIdAsString);
}
@Override
public Triple<Integer, Integer, Integer> assignORCPerformanceCurveCertificates(String leaderboardName,
String raceColumnName, String fleetName, Map<String, ORCCertificate> certificatesForBoatsWithIdAsString)
@@ -3617,5 +3455,43 @@ public class SailingServiceWriteImpl extends SailingServiceImpl implements Saili
convertDtoToCommonMarkProperties(markTemplate.getCommonMarkProperties())));
return convertToMarkTemplateDTO(mTemplate);
}
private boolean existsSwissTimingArchiveConfigurationForCurrentUser(String jsonUrl)
throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final SwissTimingArchiveConfigurationWithSecurityDTO dto : getPreviousSwissTimingArchiveConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
private boolean existsTracTracConfigurationForCurrentUser(String jsonUrl) throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final TracTracConfigurationWithSecurityDTO dto : getPreviousTracTracConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
public boolean existsSwissTimingConfigurationForCurrentUser(String jsonUrl)
throws Exception, UnauthorizedException {
boolean found = false;
final String currentUserName = getSecurityService().getCurrentUser().getName();
for (final SwissTimingConfigurationWithSecurityDTO dto : getPreviousSwissTimingConfigurations()) {
if (dto.getJsonUrl().equals(jsonUrl) && currentUserName.equals(dto.getCreatorName())) {
found = true;
break;
}
}
return found;
}
}
@@ -80,7 +80,7 @@ public class EventDTO extends EventBaseDTO implements SecuredDTO {
return leaderboardGroups;
}
public Iterable<UUID> getLeaderboardGroupIds() {
public List<UUID> getLeaderboardGroupIds() {
final List<UUID> updatedEventLeaderboardGroupIds = new ArrayList<>();
for (LeaderboardGroupDTO leaderboardGroup : this.getLeaderboardGroups()) {
updatedEventLeaderboardGroupIds.add(leaderboardGroup.getId());
@@ -106,10 +106,10 @@ public class EventDTO extends EventBaseDTO implements SecuredDTO {
*
* @return always a valid {@link Iterable} which may, though, be empty
*/
public Iterable<String> getWindFinderReviewedSpotsCollectionIds() {
final Iterable<String> result;
public List<String> getWindFinderReviewedSpotsCollectionIds() {
final List<String> result;
if (windFinderReviewedSpotsCollectionIds == null) {
result = Collections.emptySet();
result = Collections.emptyList();
} else {
result = windFinderReviewedSpotsCollectionIds;
}
@@ -73,6 +73,7 @@ import com.sap.sailing.domain.leaderboard.LeaderboardRegistry;
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
import com.sap.sailing.domain.leaderboard.RegattaLeaderboardWithEliminations;
import com.sap.sailing.domain.leaderboard.ScoringScheme;
import com.sap.sailing.domain.leaderboard.impl.DelegatingRegattaLeaderboardWithCompetitorElimination;
import com.sap.sailing.domain.persistence.DomainObjectFactory;
import com.sap.sailing.domain.persistence.MongoObjectFactory;
import com.sap.sailing.domain.polars.PolarDataService;
@@ -234,6 +235,12 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
RegattaLeaderboardWithEliminations addRegattaLeaderboardWithEliminations(String leaderboardName, String leaderboardDisplayName, RegattaLeaderboard fullRegattaLeaderboard);
/**
* Removes the leaderboard specified by {@code leaderboardName} as well as all delegating leaderboards that reference it,
* in particular those {@link DelegatingRegattaLeaderboardWithCompetitorElimination} which which the leaderboard specified
* by {@code leaderboardName} was their underlying regatta leaderboard. If no leaderboard named as specified by the
* {@code leaderboardName} parameter exists, this method has no effect.
*/
void removeLeaderboard(String leaderboardName);
/**
@@ -314,16 +321,6 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
*/
void removeLeaderboardGroup(String groupName);
/**
* Renames the group with the name <code>oldName</code> to the <code>newName</code>.<br />
* If there's no group with the name <code>oldName</code> or there's already a group with the name
* <code>newName</code> a {@link IllegalArgumentException} is thrown.
*
* @param oldName The old name of the group
* @param newName The new name of the group
*/
void renameLeaderboardGroup(String oldName, String newName);
/**
* Updates the group data in the persistant store.
*/
@@ -736,8 +733,6 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
ClassLoader getCombinedMasterDataClassLoader();
Iterable<Competitor> getCompetitorInOrderOfWindwardDistanceTraveledFarthestFirst(TrackedRace trackedRace, TimePoint timePoint);
/**
* Gets the {@link RaceTracker} associated with a given {@link RegattaAndRaceIdentifier}. If the {@link RaceTracker}
* is already available, the {@code callback} is invoked immediately. If the {@link RaceTracker} isn't available
@@ -847,15 +842,6 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch
*/
Map<Integer, Pair<DetailedRaceInfo, AnniversaryType>> getKnownAnniversaries();
/**
* Provides the number, {@link DetailedRaceInfo race} and {@link AnniversaryType type} information for the latest
* anniversary race.
*
* @return {@link Triple} containing the last anniversary number, {@link DetailedRaceInfo race} and
* {@link AnniversaryType type}, or <code>null</code> if there's no anniversary so far
*/
Triple<Integer, DetailedRaceInfo, AnniversaryType> getLastAnniversary();
/**
* Returns the {@link AnniversaryRaceDeterminator} used by this service. This is needed for replication for
* anniversary races only.
@@ -1,39 +0,0 @@
package com.sap.sailing.server.operationaltransformation;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.common.RegattaIdentifier;
import com.sap.sailing.server.interfaces.RacingEventService;
import com.sap.sailing.server.interfaces.RacingEventServiceOperation;
public class MoveColumnInSeriesDown extends AbstractColumnInSeriesOperation<Void> {
private static final long serialVersionUID = 1055871052852494542L;
public MoveColumnInSeriesDown(RegattaIdentifier regattaIdentifier, String seriesName, String columnName) {
super(regattaIdentifier, seriesName, columnName);
}
@Override
public Void internalApplyTo(RacingEventService toState) throws Exception {
Series series = getSeries(toState);
if (series != null) {
series.moveRaceColumnDown(getColumnName());
if (series.getRegatta().isPersistent()) {
toState.updateStoredRegatta(series.getRegatta());
}
}
return null;
}
@Override
public RacingEventServiceOperation<?> transformClientOp(RacingEventServiceOperation<?> serverOp) {
// TODO Auto-generated method stub
return null;
}
@Override
public RacingEventServiceOperation<?> transformServerOp(RacingEventServiceOperation<?> clientOp) {
// TODO Auto-generated method stub
return null;
}
}
@@ -1,39 +0,0 @@
package com.sap.sailing.server.operationaltransformation;
import com.sap.sailing.domain.base.Series;
import com.sap.sailing.domain.common.RegattaIdentifier;
import com.sap.sailing.server.interfaces.RacingEventService;
import com.sap.sailing.server.interfaces.RacingEventServiceOperation;
public class MoveColumnInSeriesUp extends AbstractColumnInSeriesOperation<Void> {
private static final long serialVersionUID = -4111158026632514462L;
public MoveColumnInSeriesUp(RegattaIdentifier regattaIdentifier, String seriesName, String columnName) {
super(regattaIdentifier, seriesName, columnName);
}
@Override
public Void internalApplyTo(RacingEventService toState) throws Exception {
Series series = getSeries(toState);
if (series != null) {
series.moveRaceColumnUp(getColumnName());
if (series.getRegatta().isPersistent()) {
toState.updateStoredRegatta(series.getRegatta());
}
}
return null;
}
@Override
public RacingEventServiceOperation<?> transformClientOp(RacingEventServiceOperation<?> serverOp) {
// TODO Auto-generated method stub
return null;
}
@Override
public RacingEventServiceOperation<?> transformServerOp(RacingEventServiceOperation<?> clientOp) {
// TODO Auto-generated method stub
return null;
}
}
@@ -1,36 +0,0 @@
package com.sap.sailing.server.operationaltransformation;
import com.sap.sailing.server.interfaces.RacingEventService;
import com.sap.sailing.server.interfaces.RacingEventServiceOperation;
public class RenameLeaderboard extends AbstractLeaderboardOperation<Void> {
private static final long serialVersionUID = 8874599127010526971L;
private final String newLeaderboardName;
public RenameLeaderboard(String leaderboardName, String newLeaderboardName) {
super(leaderboardName);
this.newLeaderboardName = newLeaderboardName;
}
@Override
public Void internalApplyTo(RacingEventService toState) {
if (!getLeaderboardName().equals(newLeaderboardName)) {
toState.renameLeaderboard(getLeaderboardName(), newLeaderboardName);
}
return null;
}
@Override
public RacingEventServiceOperation<?> transformClientOp(RacingEventServiceOperation<?> serverOp) {
// TODO Auto-generated method stub
return null;
}
@Override
public RacingEventServiceOperation<?> transformServerOp(RacingEventServiceOperation<?> clientOp) {
// TODO Auto-generated method stub
return null;
}
}
@@ -1,36 +0,0 @@
package com.sap.sailing.server.operationaltransformation;
import com.sap.sailing.server.interfaces.RacingEventService;
import com.sap.sailing.server.interfaces.RacingEventServiceOperation;
public class RenameLeaderboardGroup extends AbstractLeaderboardGroupOperation<Void> {
private static final long serialVersionUID = -5007784579411727148L;
private final String newLeaderboardGroupName;
public RenameLeaderboardGroup(String leaderboardGroupName, String newLeaderboardGroupName) {
super(leaderboardGroupName);
this.newLeaderboardGroupName = newLeaderboardGroupName;
}
@Override
public Void internalApplyTo(RacingEventService toState) {
// TODO see bug 729: try to move addLeaderboardGroup implementation here and synthesize and apply this operation there
if (!getLeaderboardGroupName().equals(newLeaderboardGroupName)) {
toState.renameLeaderboardGroup(getLeaderboardGroupName(), newLeaderboardGroupName);
}
return null;
}
@Override
public RacingEventServiceOperation<?> transformClientOp(RacingEventServiceOperation<?> serverOp) {
// TODO Auto-generated method stub
return null;
}
@Override
public RacingEventServiceOperation<?> transformServerOp(RacingEventServiceOperation<?> clientOp) {
// TODO Auto-generated method stub
return null;
}
}
@@ -1,7 +1,9 @@
package com.sap.sailing.server.operationaltransformation;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard;
import com.sap.sailing.domain.leaderboard.Leaderboard;
@@ -16,7 +18,7 @@ public class UpdateLeaderboard extends AbstractLeaderboardOperation<Leaderboard>
private final String newLeaderboardName;
private final String newLeaderboardDisplayName;
private final int[] newDiscardingThresholds;
private final Iterable<? extends Serializable> newCourseAreaIds;
private final Collection<Serializable> newCourseAreaIds;
public UpdateLeaderboard(String leaderboardName, String newLeaderboardName, String newLeaderboardDisplayName,
int[] newDiscardingThresholds, Iterable<? extends Serializable> newCourseAreaIds) {
@@ -24,7 +26,8 @@ public class UpdateLeaderboard extends AbstractLeaderboardOperation<Leaderboard>
this.newLeaderboardName = newLeaderboardName;
this.newLeaderboardDisplayName = newLeaderboardDisplayName;
this.newDiscardingThresholds = newDiscardingThresholds;
this.newCourseAreaIds = newCourseAreaIds;
this.newCourseAreaIds = new ArrayList<>();
Util.addAll(newCourseAreaIds, this.newCourseAreaIds);
}
@Override
@@ -21,6 +21,7 @@ import com.sap.sailing.domain.abstractlog.race.RaceLogRaceStatusEvent;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogCourseDesignChangedEventImpl;
import com.sap.sailing.domain.abstractlog.race.impl.RaceLogRaceStatusEventImpl;
import com.sap.sailing.domain.base.ControlPointWithTwoMarks;
import com.sap.sailing.domain.base.CourseArea;
import com.sap.sailing.domain.base.CourseBase;
import com.sap.sailing.domain.base.Fleet;
import com.sap.sailing.domain.base.Mark;
@@ -39,10 +40,11 @@ import com.sap.sailing.domain.common.racelog.RaceLogRaceStatus;
import com.sap.sailing.domain.leaderboard.FlexibleLeaderboard;
import com.sap.sailing.domain.leaderboard.Leaderboard;
import com.sap.sailing.domain.leaderboard.RegattaLeaderboard;
import com.sap.sailing.domain.leaderboard.ThresholdBasedResultDiscardingRule;
import com.sap.sailing.server.operationaltransformation.AddColumnToLeaderboard;
import com.sap.sailing.server.operationaltransformation.AddColumnToSeries;
import com.sap.sailing.server.operationaltransformation.CreateRegattaLeaderboard;
import com.sap.sailing.server.operationaltransformation.RenameLeaderboard;
import com.sap.sailing.server.operationaltransformation.UpdateLeaderboard;
import com.sap.sse.common.TimePoint;
import com.sap.sse.common.Util;
import com.sap.sse.common.impl.AbstractColor;
@@ -186,8 +188,9 @@ public class RaceLogReplicationTest extends AbstractLogReplicationTest<RaceLog,
replicaLog.unlockAfterRead();
}
}
@Ignore
@Ignore("The test shows an unsolved issue tracked as bug 5282")
@Test
public void testRaceEventReplicationOnRenamingFlexibleLeaderboard() throws ClassNotFoundException, IOException, InterruptedException {
final String leaderboardName = "Test";
final String fleetName = "Default";
@@ -196,7 +199,10 @@ public class RaceLogReplicationTest extends AbstractLogReplicationTest<RaceLog,
RaceLog masterLog = setupRaceColumn(leaderboardName, fleetName, raceColumnName);
replicaReplicator.startToReplicateFrom(masterDescriptor);
masterLog.add(raceLogEvent);
RenameLeaderboard renameOperation = new RenameLeaderboard(leaderboardName, leaderboardName + "new");
final UpdateLeaderboard renameOperation = new UpdateLeaderboard(
leaderboardName, leaderboardName + "new", masterLeaderboard.getDisplayName(),
((ThresholdBasedResultDiscardingRule) masterLeaderboard.getResultDiscardingRule()).getDiscardIndexResultsStartingWithHowManyRaces(),
Util.map(masterLeaderboard.getCourseAreas(), CourseArea::getId));
master.apply(renameOperation);
Thread.sleep(3000);
RaceLog replicaLog = getReplicaLog(fleetName, raceColumnName, masterLeaderboard);
@@ -47,7 +47,6 @@ public class RemoveLeaderboardGroupTest {
@Before
public void setUp() {
final SecurityService securityService = SecurityServiceMockFactory.mockSecurityService();
server = new RacingEventServiceImpl() {
@Override
@@ -87,7 +87,6 @@ public class RemoveLeaderboardTest {
leaderboard = server.apply(
new CreateFlexibleLeaderboard(LEADERBOARD_NAME, /* display name */ null, new int[0], new LowPoint(), /* default course area ID */ null));
leaderboard.addRaceColumn(R1, /* medalRace */ false);
boatClass = new BoatClassImpl(BOATCLASSNAME, /* typicallyStartsUpwind */ true);
regatta = new RegattaImpl(EmptyRaceLogStore.INSTANCE, EmptyRegattaLogStore.INSTANCE,
RegattaImpl.getDefaultName(EVENTNAME, boatClass.getName()), boatClass, /* canBoatsOfCompetitorsChangePerRace*/ true, CompetitorRegistrationType.CLOSED,
@@ -128,6 +128,7 @@ import com.sap.sailing.domain.common.CompetitorRegistrationType;
import com.sap.sailing.domain.common.DataImportProgress;
import com.sap.sailing.domain.common.DataImportSubProgress;
import com.sap.sailing.domain.common.DeviceIdentifier;
import com.sap.sailing.domain.common.LeaderboardType;
import com.sap.sailing.domain.common.MasterDataImportObjectCreationCount;
import com.sap.sailing.domain.common.MaxPointsReason;
import com.sap.sailing.domain.common.Position;
@@ -185,8 +186,6 @@ import com.sap.sailing.domain.racelog.RaceLogAndTrackedRaceResolver;
import com.sap.sailing.domain.racelog.RaceLogIdentifier;
import com.sap.sailing.domain.racelog.RaceLogStore;
import com.sap.sailing.domain.racelog.tracking.SensorFixStore;
import com.sap.sailing.domain.ranking.RankingMetric.CompetitorRankingInfo;
import com.sap.sailing.domain.ranking.RankingMetric.RankingInfo;
import com.sap.sailing.domain.ranking.RankingMetricConstructor;
import com.sap.sailing.domain.regattalike.HasRegattaLike;
import com.sap.sailing.domain.regattalike.IsRegattaLike;
@@ -295,7 +294,6 @@ import com.sap.sailing.server.util.EventUtil;
import com.sap.sailing.shared.server.SharedSailingData;
import com.sap.sse.MasterDataImportClassLoaderService;
import com.sap.sse.ServerInfo;
import com.sap.sse.common.Distance;
import com.sap.sse.common.Duration;
import com.sap.sse.common.PairingListCreationException;
import com.sap.sse.common.Renamable;
@@ -1462,23 +1460,46 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public void removeLeaderboard(String leaderboardName) {
Leaderboard leaderboard = removeLeaderboardFromLeaderboardsByName(leaderboardName);
final Leaderboard leaderboard = getLeaderboardByName(leaderboardName);
if (leaderboard != null) {
leaderboard.removeRaceColumnListener(raceLogReplicator);
leaderboard.removeRaceColumnListener(raceLogScoringReplicator);
final ScoreCorrectionListener scoreCorrectionListener = scoreCorrectionListenersByLeaderboard.remove(leaderboard);
if (scoreCorrectionListener != null) {
leaderboard.getScoreCorrection().removeScoreCorrectionListener(scoreCorrectionListener);
final Set<Leaderboard> leaderboardsToRemove = new HashSet<>();
leaderboardsToRemove.add(leaderboard);
if (leaderboard.getLeaderboardType() == LeaderboardType.RegattaLeaderboard) {
final Regatta regatta = ((RegattaLeaderboard) leaderboard).getRegatta();
for (final Leaderboard candidateForRemoval : getLeaderboards().values()) {
if (candidateForRemoval != leaderboard && candidateForRemoval instanceof RegattaLeaderboard) {
final Regatta candidatesRegatta = ((RegattaLeaderboard) candidateForRemoval).getRegatta();
if (candidatesRegatta == regatta) {
leaderboardsToRemove.add(candidateForRemoval);
}
}
}
}
mongoObjectFactory.removeLeaderboard(leaderboardName);
syncGroupsAfterLeaderboardRemove(leaderboardName, true);
if (leaderboard instanceof FlexibleLeaderboard) {
onRegattaLikeRemoved(((FlexibleLeaderboard) leaderboard).getRegattaLike());
for (final Leaderboard toRemove : leaderboardsToRemove) {
removeSingleLeaderboardInternal(toRemove);
}
leaderboard.destroy();
}
}
/**
* Removes only {@code leaderboard} and not implicitly all other leaderboards delegating to it
*/
private void removeSingleLeaderboardInternal(final Leaderboard leaderboard) {
removeLeaderboardFromLeaderboardsByName(leaderboard.getName());
leaderboard.removeRaceColumnListener(raceLogReplicator);
leaderboard.removeRaceColumnListener(raceLogScoringReplicator);
final ScoreCorrectionListener scoreCorrectionListener = scoreCorrectionListenersByLeaderboard.remove(leaderboard);
if (scoreCorrectionListener != null) {
leaderboard.getScoreCorrection().removeScoreCorrectionListener(scoreCorrectionListener);
}
mongoObjectFactory.removeLeaderboard(leaderboard.getName());
syncGroupsAfterLeaderboardRemove(leaderboard.getName(), true);
if (leaderboard instanceof FlexibleLeaderboard) {
onRegattaLikeRemoved(((FlexibleLeaderboard) leaderboard).getRegattaLike());
}
leaderboard.destroy();
}
private Leaderboard removeLeaderboardFromLeaderboardsByName(String leaderboardName) {
LockUtil.lockForWrite(leaderboardsByNameLock);
try {
@@ -2641,17 +2662,9 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public void removeRegatta(Regatta regatta) throws MalformedURLException, IOException, InterruptedException {
Set<RegattaLeaderboard> leaderboardsToRemove = new HashSet<>();
for (Leaderboard leaderboard : getLeaderboards().values()) {
if (leaderboard instanceof RegattaLeaderboard) {
RegattaLeaderboard regattaLeaderboard = (RegattaLeaderboard) leaderboard;
if (regattaLeaderboard.getRegatta() == regatta) {
leaderboardsToRemove.add(regattaLeaderboard);
}
}
}
for (RegattaLeaderboard regattaLeaderboardToRemove : leaderboardsToRemove) {
removeLeaderboard(regattaLeaderboardToRemove.getName());
final String regattaLeaderboardName = RegattaLeaderboardImpl.getLeaderboardNameForRegatta(regatta);
if (getLeaderboardByName(regattaLeaderboardName) != null) {
removeLeaderboard(regattaLeaderboardName); // removes regatta leaderboard and all that delegate to it
}
// avoid ConcurrentModificationException by copying the races to remove:
Set<RaceDefinition> racesToRemove = new HashSet<>();
@@ -3108,8 +3121,15 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
mongoObjectFactory.removeLeaderboardGroup(groupName);
}
@Override
public void renameLeaderboardGroup(String oldName, String newName) {
/**
* Renames the group with the name <code>oldName</code> to the <code>newName</code>.<br />
* If there's no group with the name <code>oldName</code> or there's already a group with the name
* <code>newName</code> a {@link IllegalArgumentException} is thrown.
*
* @param oldName The old name of the group
* @param newName The new name of the group
*/
private void renameLeaderboardGroup(String oldName, String newName) {
LockUtil.lockForWrite(leaderboardGroupsByNameLock);
try {
final LeaderboardGroup toRename = leaderboardGroupsByName.get(oldName);
@@ -4379,22 +4399,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
}
}
@Override
public Iterable<Competitor> getCompetitorInOrderOfWindwardDistanceTraveledFarthestFirst(TrackedRace trackedRace, TimePoint timePoint) {
final RankingInfo rankingInfo = trackedRace.getRankingMetric().getRankingInfo(timePoint);
final List<Competitor> result = new ArrayList<>();
final Map<Competitor, Distance> windwardDistanceSailedPerCompetitor = new HashMap<>();
for (final Competitor competitor : trackedRace.getRace().getCompetitors()) {
result.add(competitor);
final CompetitorRankingInfo competitorRankingInfo = rankingInfo.getCompetitorRankingInfo().apply(competitor);
windwardDistanceSailedPerCompetitor.put(competitor, competitorRankingInfo == null ? null : competitorRankingInfo.getWindwardDistanceSailed());
}
final Comparator<Distance> durationComparatorNullsLast = Comparator.nullsLast(Comparator.naturalOrder());
result.sort((c1, c2) -> durationComparatorNullsLast.compare(windwardDistanceSailedPerCompetitor.get(c2),
windwardDistanceSailedPerCompetitor.get(c1)));
return result;
}
/**
* A {@link SimpleRaceLogIdentifier} in particular has a {@link SimpleRaceLogIdentifier#getRegattaLikeParentName()}
* which identifies either a regatta by name or a flexible leaderboard by name. Here is why this can luckily be
@@ -4740,21 +4744,6 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
return anniversaryRaceDeterminator.getNextAnniversary();
}
@Override
public Triple<Integer, DetailedRaceInfo, AnniversaryType> getLastAnniversary() {
Map<Integer, Pair<DetailedRaceInfo, AnniversaryType>> allAnniversaries = anniversaryRaceDeterminator
.getKnownAnniversaries();
Triple<Integer, DetailedRaceInfo, AnniversaryType> lastAnniversary = null;
if (!allAnniversaries.isEmpty()) {
ArrayList<Integer> list = new ArrayList<>(allAnniversaries.keySet());
list.sort(Integer::compare);
Integer anniversary = list.get(list.size() - 1);
Pair<DetailedRaceInfo, AnniversaryType> info = allAnniversaries.get(anniversary);
lastAnniversary = new Triple<>(anniversary, info.getA(), info.getB());
}
return lastAnniversary;
}
@Override
public int getCurrentRaceCount() {
return anniversaryRaceDeterminator.getCurrentRaceCount();
@@ -65,8 +65,6 @@ public interface BasicUserStore extends UserGroupProvider, Named {
void removeRoleFromUser(String username, Role role) throws UserManagementException;
Iterable<WildcardPermission> getPermissionsFromUser(String username) throws UserManagementException;
void removePermissionFromUser(String username, WildcardPermission permission) throws UserManagementException;
void addPermissionForUser(String username, WildcardPermission permission) throws UserManagementException;
@@ -1,18 +0,0 @@
package com.sap.sse.security.shared.dto;
import com.sap.sse.security.shared.QualifiedObjectIdentifier;
import com.sap.sse.security.shared.impl.ObjectAnnotationImpl;
public class OwnershipAnnotationDTO extends ObjectAnnotationImpl<OwnershipDTO> {
private static final long serialVersionUID = 7242600656125139931L;
@Deprecated // gwt only
OwnershipAnnotationDTO() {
super(null, null, null);
}
public OwnershipAnnotationDTO(OwnershipDTO annotation, QualifiedObjectIdentifier idOfAnnotatedObject,
String displayNameOfAnnotatedObject) {
super(annotation, idOfAnnotatedObject, displayNameOfAnnotatedObject);
}
}
@@ -19,7 +19,6 @@ import com.sap.sse.security.shared.UserManagementException;
import com.sap.sse.security.shared.WildcardPermission;
import com.sap.sse.security.shared.dto.AccessControlListAnnotationDTO;
import com.sap.sse.security.shared.dto.AccessControlListDTO;
import com.sap.sse.security.shared.dto.OwnershipAnnotationDTO;
import com.sap.sse.security.shared.dto.OwnershipDTO;
import com.sap.sse.security.shared.dto.RoleDefinitionDTO;
import com.sap.sse.security.shared.dto.RolesAndPermissionsForUserDTO;
@@ -39,17 +38,6 @@ public interface UserManagementService extends RemoteService {
Collection<AccessControlListAnnotationDTO> getAccessControlLists()
throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
AccessControlListAnnotationDTO getAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject)
throws org.apache.shiro.authz.UnauthorizedException;
AccessControlListDTO addToAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject,
String groupOrTenantIdAsString, String action)
throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
AccessControlListDTO removeFromAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject,
String groupOrTenantIdAsString, String action)
throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
Collection<UserGroupDTO> getUserGroups() throws org.apache.shiro.authz.UnauthorizedException;
UserGroupDTO getUserGroupByName(String userGroupName)
@@ -78,8 +66,6 @@ public interface UserManagementService extends RemoteService {
Collection<UserDTO> getUserList() throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
UserDTO getUserByName(String username) throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
RoleDefinitionDTO createRoleDefinition(String roleDefinitionIdAsString, String name)
throws org.apache.shiro.authz.UnauthorizedException;
@@ -171,8 +157,6 @@ public interface UserManagementService extends RemoteService {
Map<String, String> getAllPreferences(String username)
throws UserManagementException, UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
String getAccessToken(String username) throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
String getOrCreateAccessToken(String username)
throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
@@ -185,9 +169,6 @@ public interface UserManagementService extends RemoteService {
public Triple<UserDTO, UserDTO, ServerInfoDTO> verifySocialUser(CredentialDTO credential)
throws OAuthException, org.apache.shiro.authz.UnauthorizedException;
OwnershipAnnotationDTO getOwnership(QualifiedObjectIdentifier idOfOwnedObject)
throws org.apache.shiro.authz.UnauthorizedException;
AccessControlListDTO overrideAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject,
AccessControlListDTO acl) throws UnauthorizedException, org.apache.shiro.authz.UnauthorizedException;
@@ -15,7 +15,6 @@ import com.sap.sse.security.shared.TypeRelativeObjectIdentifier;
import com.sap.sse.security.shared.WildcardPermission;
import com.sap.sse.security.shared.dto.AccessControlListAnnotationDTO;
import com.sap.sse.security.shared.dto.AccessControlListDTO;
import com.sap.sse.security.shared.dto.OwnershipAnnotationDTO;
import com.sap.sse.security.shared.dto.OwnershipDTO;
import com.sap.sse.security.shared.dto.RoleDefinitionDTO;
import com.sap.sse.security.shared.dto.RolesAndPermissionsForUserDTO;
@@ -32,24 +31,14 @@ public interface UserManagementServiceAsync {
QualifiedObjectIdentifier idOfOwnedObject, String displayNameOfOwnedObject,
AsyncCallback<OwnershipDTO> callback);
void getOwnership(QualifiedObjectIdentifier idOfOwnedObject, AsyncCallback<OwnershipAnnotationDTO> callback);
void getAccessControlLists(AsyncCallback<Collection<AccessControlListAnnotationDTO>> callback);
void getAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject, AsyncCallback<AccessControlListAnnotationDTO> callback);
void getAccessControlListWithoutPruning(QualifiedObjectIdentifier idOfAccessControlledObject,
AsyncCallback<AccessControlListDTO> updateAclAsyncCallback);
void overrideAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject, AccessControlListDTO acl,
AsyncCallback<AccessControlListDTO> updateAclAsyncCallback);
void addToAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject, String permission, String name,
AsyncCallback<AccessControlListDTO> callback);
void removeFromAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject, String permission,
String name, AsyncCallback<AccessControlListDTO> callback);
/**
* Returns those user groups the requesting user can read
*/
@@ -78,8 +67,6 @@ public interface UserManagementServiceAsync {
*/
void getUserList(AsyncCallback<Collection<UserDTO>> callback);
void getUserByName(String username, AsyncCallback<UserDTO> callback);
/**
* Returns true if a user associated to the given username even if the current user cannot see the existing user.
*/
@@ -139,15 +126,9 @@ public interface UserManagementServiceAsync {
void getAllPreferences(String username, final AsyncCallback<Map<String, String>> callback);
/**
* Obtains an access token for the user specified by {@code username}. The caller needs to
* have role {@link DefaultRoles#ADMIN} or be authorized as the user identified by {@code username}
* in order to be permitted to retrieve the access token.
*/
void getAccessToken(String username, AsyncCallback<String> markedAsyncCallback);
/**
* Like {@link #getAccessToken(String, AsyncCallback)}, only that instead of returning {@code null} a
* new access token will be created and returned.
* * Obtains an access token for the user specified by {@code username}. The caller needs to have role
* {@link DefaultRoles#ADMIN} or be authorized as the user identified by {@code username} in order to be permitted
* to retrieve the access token, a new access token will be created and returned.
*/
void getOrCreateAccessToken(String username, AsyncCallback<String> callback);
@@ -18,7 +18,6 @@ import com.sap.sse.security.interfaces.Social;
import com.sap.sse.security.shared.AccessControlListAnnotation;
import com.sap.sse.security.shared.Account;
import com.sap.sse.security.shared.Account.AccountType;
import com.sap.sse.security.shared.OwnershipAnnotation;
import com.sap.sse.security.shared.QualifiedObjectIdentifier;
import com.sap.sse.security.shared.RoleDefinition;
import com.sap.sse.security.shared.SecurityUser;
@@ -28,7 +27,6 @@ import com.sap.sse.security.shared.WildcardPermission;
import com.sap.sse.security.shared.dto.AccessControlListAnnotationDTO;
import com.sap.sse.security.shared.dto.AccessControlListDTO;
import com.sap.sse.security.shared.dto.AccountDTO;
import com.sap.sse.security.shared.dto.OwnershipAnnotationDTO;
import com.sap.sse.security.shared.dto.OwnershipDTO;
import com.sap.sse.security.shared.dto.RoleDefinitionDTO;
import com.sap.sse.security.shared.dto.RoleWithSecurityDTO;
@@ -375,12 +373,6 @@ public class SecurityDTOFactory {
return new Ownership(ownerUser, ownerGroup);
}
public OwnershipAnnotationDTO createOwnerShipAnnotationDTO(OwnershipAnnotation annotation) {
OwnershipDTO ownerShipDTO = createOwnershipDTO(annotation.getAnnotation(), new HashMap<>(), new HashMap<>());
return new OwnershipAnnotationDTO(ownerShipDTO, annotation.getIdOfAnnotatedObject(),
annotation.getDisplayNameOfAnnotatedObject());
}
public Set<StrippedUserDTO> createStrippedUsersFromUsers(Iterable<User> users, SecurityService securityService,
Map<User, StrippedUserDTO> fromOriginalToStrippedDownUser,
Map<UserGroup, StrippedUserGroupDTO> fromOriginalToStrippedDownUserGroup) {
@@ -38,7 +38,6 @@ import com.sap.sse.security.interfaces.Credential;
import com.sap.sse.security.shared.AccessControlListAnnotation;
import com.sap.sse.security.shared.HasPermissions;
import com.sap.sse.security.shared.HasPermissions.DefaultActions;
import com.sap.sse.security.shared.OwnershipAnnotation;
import com.sap.sse.security.shared.QualifiedObjectIdentifier;
import com.sap.sse.security.shared.RoleDefinition;
import com.sap.sse.security.shared.TypeRelativeObjectIdentifier;
@@ -48,7 +47,6 @@ import com.sap.sse.security.shared.UserManagementException;
import com.sap.sse.security.shared.WildcardPermission;
import com.sap.sse.security.shared.dto.AccessControlListAnnotationDTO;
import com.sap.sse.security.shared.dto.AccessControlListDTO;
import com.sap.sse.security.shared.dto.OwnershipAnnotationDTO;
import com.sap.sse.security.shared.dto.OwnershipDTO;
import com.sap.sse.security.shared.dto.RoleDefinitionDTO;
import com.sap.sse.security.shared.dto.RolesAndPermissionsForUserDTO;
@@ -214,12 +212,6 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
return securityDTOFactory.createOwnershipDTO(result, new HashMap<>(), new HashMap<>());
}
@Override
public OwnershipAnnotationDTO getOwnership(QualifiedObjectIdentifier idOfOwnedObject) {
OwnershipAnnotation annotation = getSecurityService().getOwnership(idOfOwnedObject);
return securityDTOFactory.createOwnerShipAnnotationDTO(annotation);
}
@Override
public Collection<AccessControlListAnnotationDTO> getAccessControlLists() throws UnauthorizedException {
// TODO decide whether a global getAccessControlList functionality is needed
@@ -233,45 +225,6 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
return acls;
}
@Override
public AccessControlListAnnotationDTO getAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject) {
// skip permission check for ACL linked to null object since it is public anyway
if (idOfAccessControlledObject != null) {
SecurityUtils.getSubject()
.checkPermission(idOfAccessControlledObject.getStringPermission(DefaultActions.CHANGE_ACL));
}
return securityDTOFactory.createAccessControlListAnnotationDTO(getSecurityService().getAccessControlList(idOfAccessControlledObject));
}
@Override
public AccessControlListDTO addToAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject,
String groupIdAsString, String action) throws UnauthorizedException {
if (SecurityUtils.getSubject()
.isPermitted(idOfAccessControlledObject.getStringPermission(DefaultActions.CHANGE_ACL))) {
UserGroup userGroup = getUserGroup(groupIdAsString);
return securityDTOFactory.createAccessControlListDTO(getSecurityService().addToAccessControlList(idOfAccessControlledObject, userGroup, action));
} else {
throw new UnauthorizedException("Not permitted to grant permission for user");
}
}
private UserGroup getUserGroup(String groupIdAsString) {
UUID groupId = UUID.fromString(groupIdAsString);
return getSecurityService().getUserGroup(groupId);
}
@Override
public AccessControlListDTO removeFromAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject,
String groupOrTenantIdAsString, String permission) throws UnauthorizedException {
// FIXME replace permission check with a valid one
if (SecurityUtils.getSubject().isPermitted("tenant:revoke_permission:" + groupOrTenantIdAsString)) {
UserGroup userGroup = getUserGroup(groupOrTenantIdAsString);
return securityDTOFactory.createAccessControlListDTO(getSecurityService().removeFromAccessControlList(idOfAccessControlledObject, userGroup, permission));
} else {
throw new UnauthorizedException("Not permitted to revoke permission for user");
}
}
@Override
public Collection<UserGroupDTO> getUserGroups() {
Map<User, StrippedUserDTO> fromOriginalToStrippedDownUser = new HashMap<>();
@@ -308,8 +261,7 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
}
}
@Override
public UserDTO getUserByName(String username) throws UnauthorizedException {
private UserDTO getUserByName(String username) throws UnauthorizedException {
final User user = getSecurityService().getUserByName(username);
if (user == null
|| SecurityUtils.getSubject()
@@ -782,12 +734,6 @@ public class UserManagementServiceImpl extends RemoteServiceServlet implements U
return result;
}
@Override
public String getAccessToken(String username) throws UnauthorizedException {
getSecurityService().checkCurrentUserReadPermission(getUserByName(username));
return getSecurityService().getAccessToken(username);
}
@Override
public String getOrCreateAccessToken(String username) throws UnauthorizedException {
getSecurityService().checkCurrentUserUpdatePermission(getUserByName(username));
@@ -859,14 +859,6 @@ public class UserStoreImpl implements UserStore {
}
}
@Override
public Iterable<WildcardPermission> getPermissionsFromUser(String username) throws UserManagementException {
if (users.get(username) == null) {
throw new UserManagementException(UserManagementException.USER_DOES_NOT_EXIST);
}
return users.get(username).getPermissions();
}
@Override
public void addPermissionForUser(String username, WildcardPermission permission) throws UserManagementException {
final User user = users.get(username);
@@ -33,7 +33,6 @@ import com.sap.sse.security.shared.PermissionChecker;
import com.sap.sse.security.shared.QualifiedObjectIdentifier;
import com.sap.sse.security.shared.RoleDefinition;
import com.sap.sse.security.shared.RolePrototype;
import com.sap.sse.security.shared.SocialUserAccount;
import com.sap.sse.security.shared.TypeRelativeObjectIdentifier;
import com.sap.sse.security.shared.UserGroupManagementException;
import com.sap.sse.security.shared.UserManagementException;
@@ -73,8 +72,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
*/
OwnershipAnnotation getOwnership(QualifiedObjectIdentifier idOfOwnedObject);
OwnershipAnnotation createDefaultOwnershipForNewObject(QualifiedObjectIdentifier idOfNewObject);
Iterable<AccessControlListAnnotation> getAccessControlLists();
AccessControlListAnnotation getAccessControlList(QualifiedObjectIdentifier idOfAccessControlledObject);
@@ -179,9 +176,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
void updateUserProperties(String username, String fullName, String company, Locale locale) throws UserManagementException;
User createSocialUser(String username, SocialUserAccount socialUserAccount)
throws UserManagementException, UserGroupManagementException;
void deleteUser(String username) throws UserManagementException;
/**
@@ -215,8 +209,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
void removeRoleFromUser(String username, Role role);
Iterable<WildcardPermission> getPermissionsFromUser(String username) throws UserManagementException;
void removePermissionFromUser(String username, WildcardPermission permissionToRemove);
void addPermissionForUser(String username, WildcardPermission permissionToAdd);
@@ -246,8 +238,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
*/
boolean setSetting(String key, Object setting);
<T> T getSetting(String key, Class<T> clazz);
Map<String, Object> getAllSettings();
Map<String, Class<?>> getAllSettingTypes();
@@ -340,8 +330,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
void removeAccessToken(String username);
User loginByAccessToken(String accessToken);
/**
* Returns the group owning this server/replicaset {@link UserStore#getServerGroup()}. This group is used as default
* owner if default objects such as role definitions or the admin user have to be created outside of any user
@@ -399,10 +387,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
com.sap.sse.security.shared.HasPermissions.Action action, Iterable<T> objectsToFilter,
Consumer<T> filteredObjectsConsumer);
<T extends WithQualifiedObjectIdentifier> void filterObjectsWithPermissionForCurrentUser(
com.sap.sse.security.shared.HasPermissions.Action[] actions, Iterable<T> objectsToFilter,
Consumer<T> filteredObjectsConsumer);
/**
* Filters objects with any of the given permissions for the current user.
*/
@@ -413,10 +397,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
<T extends WithQualifiedObjectIdentifier, R> List<R> mapAndFilterByReadPermissionForCurrentUser(
Iterable<T> objectsToFilter, Function<T, R> filteredObjectsMapper);
<T extends WithQualifiedObjectIdentifier, R> List<R> mapAndFilterByExplicitPermissionForCurrentUser(
HasPermissions.Action[] actions, Iterable<T> objectsToFilter,
Function<T, R> filteredObjectsMapper);
/**
* Maps and filters by any of the given permissions for the current user.
*/
@@ -542,9 +522,6 @@ public interface SecurityService extends ReplicableWithObjectInputStream<Replica
void checkMigration(Iterable<HasPermissions> allInstances);
<T extends WithQualifiedObjectIdentifier> boolean hasCurrentUserRoleForOwnedObject(HasPermissions type, T object,
RoleDefinition roleToCheck);
boolean hasCurrentUserMetaPermission(WildcardPermission permissionToCheck, Ownership ownership);
boolean hasCurrentUserMetaPermissionWithOwnershipLookup(WildcardPermission permissionToCheck);
@@ -91,7 +91,6 @@ import com.sap.sse.replication.OperationsToMasterSendingQueue;
import com.sap.sse.replication.ReplicationMasterDescriptor;
import com.sap.sse.replication.ReplicationService;
import com.sap.sse.security.Action;
import com.sap.sse.security.BearerAuthenticationToken;
import com.sap.sse.security.ClientUtils;
import com.sap.sse.security.GithubApi;
import com.sap.sse.security.InstagramApi;
@@ -103,7 +102,6 @@ import com.sap.sse.security.SessionUtils;
import com.sap.sse.security.interfaces.AccessControlStore;
import com.sap.sse.security.interfaces.Credential;
import com.sap.sse.security.interfaces.OAuthToken;
import com.sap.sse.security.interfaces.Social;
import com.sap.sse.security.interfaces.SocialSettingsKeys;
import com.sap.sse.security.interfaces.UserImpl;
import com.sap.sse.security.interfaces.UserStore;
@@ -156,7 +154,6 @@ import com.sap.sse.security.shared.QualifiedObjectIdentifier;
import com.sap.sse.security.shared.RoleDefinition;
import com.sap.sse.security.shared.RolePrototype;
import com.sap.sse.security.shared.SecurityAccessControlList;
import com.sap.sse.security.shared.SocialUserAccount;
import com.sap.sse.security.shared.TypeRelativeObjectIdentifier;
import com.sap.sse.security.shared.UserGroupManagementException;
import com.sap.sse.security.shared.UserManagementException;
@@ -500,12 +497,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
public OwnershipAnnotation getOwnership(QualifiedObjectIdentifier idOfOwnedObjectAsString) {
return accessControlStore.getOwnership(idOfOwnedObjectAsString);
}
@Override
public OwnershipAnnotation createDefaultOwnershipForNewObject(QualifiedObjectIdentifier idOfNewObject) {
return new OwnershipAnnotation(new Ownership(getCurrentUser(), getDefaultTenantForCurrentUser()),
idOfNewObject, /* display name */ idOfNewObject.toString());
}
public UserGroup getDefaultTenantForUser(User user) {
UserGroup specificTenant = temporaryDefaultTenant.get();
@@ -860,21 +851,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return redirectUrl;
}
@Override
public User loginByAccessToken(String accessToken) {
BearerAuthenticationToken token = new BearerAuthenticationToken(accessToken);
logger.info("Trying to login with access token");
Subject subject = SecurityUtils.getSubject();
try {
subject.login(token);
final String username = (String) token.getPrincipal();
return store.getUserByName(username);
} catch (AuthenticationException e) {
logger.log(Level.INFO, "Authentication failed with access token "+accessToken);
throw e;
}
}
@Override
public void logout() {
Subject subject = SecurityUtils.getSubject();
@@ -1232,11 +1208,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return null;
}
@Override
public Iterable<WildcardPermission> getPermissionsFromUser(String username) throws UserManagementException {
return store.getPermissionsFromUser(username);
}
@Override
public void removePermissionFromUser(String username, WildcardPermission permissionToRemove) {
apply(new RemovePermissionForUserOperation(username, permissionToRemove));
@@ -1312,11 +1283,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return store.setSetting(key, setting);
}
@Override
public <T> T getSetting(String key, Class<T> clazz) {
return store.getSetting(key, clazz);
}
@Override
public Map<String, Object> getAllSettings() {
return store.getAllSettings();
@@ -1327,20 +1293,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return store.getAllSettingTypes();
}
@Override
public User createSocialUser(String name, SocialUserAccount socialUserAccount)
throws UserManagementException, UserGroupManagementException {
if (store.getUserByName(name) != null) {
throw new UserManagementException(UserManagementException.USER_ALREADY_EXISTS);
}
User result = store.createUser(name, socialUserAccount.getProperty(Social.EMAIL.name()),
socialUserAccount);
UserGroup tenant = getOrCreateTenantForUser(result);
accessControlStore.setOwnership(tenant.getIdentifier(), result, tenant, tenant.getName());
addUserToUserGroup(tenant, result);
return result;
}
@Override
public User verifySocialUser(Credential credential) throws UserManagementException {
OAuthToken otoken = new OAuthToken(credential, credential.getVerifier());
@@ -1945,22 +1897,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
});
}
@Override
public <T extends WithQualifiedObjectIdentifier> void filterObjectsWithPermissionForCurrentUser(
HasPermissions.Action[] actions, Iterable<T> objectsToFilter,
Consumer<T> filteredObjectsConsumer) {
objectsToFilter.forEach(objectToCheck -> {
boolean isPermitted = actions.length > 0;
for (int i = 0; i < actions.length; i++) {
isPermitted &= SecurityUtils.getSubject().isPermitted(
objectToCheck.getIdentifier().getStringPermission(actions[i]));
}
if (isPermitted) {
filteredObjectsConsumer.accept(objectToCheck);
}
});
}
/** Filters the objects with any of the given permissions for the current user */
@Override
public <T extends WithQualifiedObjectIdentifier> void filterObjectsWithAnyPermissionForCurrentUser(
@@ -1990,16 +1926,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return result;
}
@Override
public <T extends WithQualifiedObjectIdentifier, R> List<R> mapAndFilterByExplicitPermissionForCurrentUser(
HasPermissions.Action[] actions, Iterable<T> objectsToFilter,
Function<T, R> filteredObjectsMapper) {
final List<R> result = new ArrayList<>();
filterObjectsWithPermissionForCurrentUser(actions, objectsToFilter,
filteredObject -> result.add(filteredObjectsMapper.apply(filteredObject)));
return result;
}
@Override
public <T extends WithQualifiedObjectIdentifier, R> List<R> mapAndFilterByAnyExplicitPermissionForCurrentUser(
HasPermissions permittedObject, HasPermissions.Action[] actions, Iterable<T> objectsToFilter,
@@ -2015,17 +1941,6 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat
return store.getUserByName(SecurityService.ALL_USERNAME);
}
@Override
public <T extends WithQualifiedObjectIdentifier> boolean hasCurrentUserRoleForOwnedObject(HasPermissions type, T object,
RoleDefinition roleToCheck) {
assert type != null;
assert object != null;
assert roleToCheck != null;
OwnershipAnnotation ownershipToCheck = getOwnership(object.getIdentifier());
return PermissionChecker.ownsUserASpecificRole(getCurrentUser(), getAllUser(),
ownershipToCheck == null ? null : ownershipToCheck.getAnnotation(), roleToCheck.getName());
}
@Override
public boolean hasCurrentUserMetaPermission(WildcardPermission permissionToCheck, Ownership ownership) {
if (hasPermissionsProvider == null) {
@@ -80,7 +80,7 @@ public abstract class BaseRaceInfoRaceFragment<ProcedureType extends RacingProce
args.putAll(fragment.getArguments());
}
fragment.setArguments(args);
FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.replace(id, fragment);
transaction.commit();
}