From b3461bb3fbceb7a1ca65213ff66da55a8326773e Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 11:57:39 +0100 Subject: [PATCH 01/30] move event id up to simple race info bug5410 --- .../domain/anniversary/DetailedRaceInfo.java | 8 +------- .../domain/anniversary/SimpleRaceInfo.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/DetailedRaceInfo.java b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/DetailedRaceInfo.java index 0a9608804c5..07a1b803e7e 100644 --- a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/DetailedRaceInfo.java +++ b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/DetailedRaceInfo.java @@ -17,20 +17,18 @@ public class DetailedRaceInfo extends SimpleRaceInfo { private final String eventName; private final String leaderboardDisplayName; private final String leaderboardName; - private final UUID eventID; private EventType eventType; public DetailedRaceInfo(RegattaAndRaceIdentifier identifier, String leaderboardName, String leaderboardDisplayName, TimePoint timePoint, UUID eventId, String eventName, EventType eventType, URL remoteUrl) { - super(identifier, timePoint, remoteUrl); + super(identifier, timePoint, remoteUrl, eventId); if (leaderboardName == null || eventId == null) { throw new IllegalStateException("DetailedRaceInfo Data is not allowed to contain any null values!"); } this.leaderboardName = leaderboardName; this.leaderboardDisplayName = leaderboardDisplayName; this.eventName = eventName; - this.eventID = eventId; this.eventType = eventType; } @@ -54,10 +52,6 @@ public class DetailedRaceInfo extends SimpleRaceInfo { return leaderboardName; } - public UUID getEventID() { - return eventID; - } - @Override public String toString() { return "DetailedRaceInfo [identifier=" + getIdentifier() + ", leaderboardName=" + leaderboardName diff --git a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/SimpleRaceInfo.java b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/SimpleRaceInfo.java index 15cf9422074..607132bbcb2 100644 --- a/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/SimpleRaceInfo.java +++ b/java/com.sap.sailing.domain.shared.android/src/com/sap/sailing/domain/anniversary/SimpleRaceInfo.java @@ -2,6 +2,7 @@ package com.sap.sailing.domain.anniversary; import java.io.Serializable; import java.net.URL; +import java.util.UUID; import com.sap.sailing.domain.common.RegattaAndRaceIdentifier; import com.sap.sse.common.TimePoint; @@ -20,19 +21,21 @@ public class SimpleRaceInfo implements Serializable { private final RegattaAndRaceIdentifier identifier; private final TimePoint startOfRace; private final URL remoteUrl; + protected final UUID eventID; /** * @param remoteUrl * use {@code null} to mean "local"; a local server does not necessarily know under which URL it is being * reached and therefore cannot provide this */ - public SimpleRaceInfo(RegattaAndRaceIdentifier identifier, TimePoint startOfRace, URL remoteUrl) { + public SimpleRaceInfo(RegattaAndRaceIdentifier identifier, TimePoint startOfRace, URL remoteUrl, UUID eventId) { if (identifier == null || startOfRace == null) { throw new IllegalStateException("SimpleRaceInfo Data is not allowed to contain any null values!"); } this.identifier = identifier; this.startOfRace = startOfRace; this.remoteUrl = remoteUrl; + this.eventID = eventId; } public RegattaAndRaceIdentifier getIdentifier() { @@ -51,12 +54,17 @@ public class SimpleRaceInfo implements Serializable { return startOfRace; } + public UUID getEventID() { + return eventID; + } + @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((identifier == null) ? 0 : identifier.hashCode()); result = prime * result + ((startOfRace == null) ? 0 : startOfRace.hashCode()); + result = prime * result + ((eventID == null) ? 0 : eventID.hashCode()); return result; } @@ -79,6 +87,11 @@ public class SimpleRaceInfo implements Serializable { return false; } else if (!startOfRace.equals(other.startOfRace)) return false; + if (eventID == null) { + if (other.eventID != null) + return false; + } else if (!eventID.equals(other.eventID)) + return false; return true; } From 4fcd676288ac4a243dfd51a2d495a71e0ae107cb Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 11:59:50 +0100 Subject: [PATCH 02/30] issue request that shall return only races to selected incl/excl list bug5410 --- .../server/impl/RemoteSailingServerSet.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java index 414331de777..9d73ee72d1a 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java @@ -12,6 +12,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -187,7 +188,7 @@ public class RemoteSailingServerSet { private void updateRemoteServerTrackedRacesCacheSynchronously(RemoteSailingServerReference ref) { Util.Pair, Exception> result; try { - final URL raceListURL = getRaceListURL(ref.getURL()); + final URL raceListURL = getRaceListURL(ref); logger.fine("Updating racelist for remote server " + ref + " from URL " + raceListURL); final SimpleRaceInfoJsonSerializer deserializer = new SimpleRaceInfoJsonSerializer(); final Set races = new HashSet<>(); @@ -233,8 +234,22 @@ public class RemoteSailingServerSet { new HashSet<>(remoteRaceResultReceivedCallbacks).forEach(Runnable::run); } - private URL getRaceListURL(URL remoteServerBaseURL) throws MalformedURLException { - return getEndpointUrl(remoteServerBaseURL, "/trackedRaces/getRaces?transitive=true"); + private URL getRaceListURL(RemoteSailingServerReference ref) throws MalformedURLException { + URL remoteServerBaseURL = ref.getURL(); + String endpoint = "/trackedRaces/getRaces?transitive=true"; + if (!ref.getSelectedEventIds().isEmpty()) { + endpoint += "&events="; + + Iterator iter = ref.getSelectedEventIds().iterator(); + while (iter.hasNext()) { + endpoint += iter.next().toString(); + if (iter.hasNext()) { + endpoint += ","; + } + } + endpoint += "&pred=" + (ref.isInclude() ? "incl" : "excl"); + } + return getEndpointUrl(remoteServerBaseURL, endpoint); } private URL getEndpointUrl(URL remoteServerBaseURL, final String endpoint) throws MalformedURLException { From 1c836a034566f4371ebdfde8020fce10614e5611 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 12:00:42 +0100 Subject: [PATCH 03/30] extends SimpleRaceInfo JSON (de)serializer to include event id bug 5410 --- .../serialization/impl/SimpleRaceInfoJsonSerializer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/serialization/impl/SimpleRaceInfoJsonSerializer.java b/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/serialization/impl/SimpleRaceInfoJsonSerializer.java index 9cd97985d4d..18dba3b0626 100644 --- a/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/serialization/impl/SimpleRaceInfoJsonSerializer.java +++ b/java/com.sap.sailing.server.gateway.serialization.shared.android/src/com/sap/sailing/server/gateway/serialization/impl/SimpleRaceInfoJsonSerializer.java @@ -1,6 +1,7 @@ package com.sap.sailing.server.gateway.serialization.impl; import java.net.URL; +import java.util.UUID; import org.json.simple.JSONObject; @@ -16,6 +17,7 @@ public class SimpleRaceInfoJsonSerializer implements JsonSerializer Date: Mon, 9 Nov 2020 12:01:57 +0100 Subject: [PATCH 04/30] consider filter for event Ids on races, extend REST endpoint accordingly bug 5410 --- .../jaxrs/api/TrackedRaceListResource.java | 85 +++++++++++++------ .../server/interfaces/RacingEventService.java | 15 ++-- .../server/impl/RacingEventServiceImpl.java | 64 +++++++------- 3 files changed, 106 insertions(+), 58 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index 1cf6f72c816..4d541cf9d9c 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -2,13 +2,17 @@ package com.sap.sailing.server.gateway.jaxrs.api; import java.net.URL; import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; +import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; @@ -59,22 +63,46 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { * are grouped by the remote URL from where they originated. Local entries have a {@code null} value for the * {@link DetailedRaceInfoJsonSerializer# FIELD_REMOTEURL remote URL} field. The order of the list returned is * undefined.
+ * @param events string list of event UUIDs + * @param predicate depicts the semantic of the event UUIDs, when "incl" include only the depicted. When "excl" exclude the depicted events */ @GET @Produces(CONTENT_TYPE_JSON_UTF8) @Path("getRaces") - public Response raceList(@QueryParam("transitive") Boolean transitive) { + public Response raceList(@QueryParam("transitive") @DefaultValue("false") Boolean transitive, + @QueryParam("events") @DefaultValue("") String strEvents, + @QueryParam("pred") @DefaultValue("incl") String predicate) { final boolean includeRemotes = transitive != null && Boolean.TRUE.equals(transitive); - final Map distinctRaces = getDistinctRaces(includeRemotes); + + Set eventUUIDs = Arrays.asList(strEvents.split(",")) + .stream() + .map(UUID::fromString) + .collect(Collectors.toSet()); + + Function eventFilter; + if ("incl".equals(predicate)) { + eventFilter = (uuid)->eventUUIDs.contains(uuid); + } else if ("excl".equals(predicate)) { + eventFilter = (uuid)->!eventUUIDs.contains(uuid); + }else { + throw new IllegalArgumentException("unrecognized predicate " + predicate + " only \"excl\" and \"incl\" are possible"); + } + + final Map> distinctRaces = getDistinctRaces(includeRemotes, + eventFilter); final HashMap> raceData = new HashMap<>(); - distinctRaces.values().forEach(raceInfo -> { - final String remoteUrl = raceInfo.getRemoteUrl() == null ? null : raceInfo.getRemoteUrl().toExternalForm(); - List remoteList = raceData.get(remoteUrl); - if (remoteList == null) { - raceData.put(remoteUrl, remoteList = new ArrayList<>()); - } - remoteList.add(raceInfo); - }); + distinctRaces.values() + .stream() + .flatMap(Set::stream) + .forEach(raceInfo -> { + final String remoteUrl = raceInfo.getRemoteUrl() == null ? null + : raceInfo.getRemoteUrl().toExternalForm(); + List remoteList = raceData.get(remoteUrl); + if (remoteList == null) { + raceData.put(remoteUrl, remoteList = new ArrayList<>()); + } + remoteList.add(raceInfo); + }); final JSONArray json = new JSONArray(); for (Entry> raced : raceData.entrySet()) { JSONArray list = new JSONArray(); @@ -101,14 +129,12 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { @Path("allRaces") public Response fullRaceList() { JSONArray json = new JSONArray(); - Map store = getDistinctRaces(/* include remotes */ true); - ArrayList sorted = new ArrayList<>(store.values()); - Collections.sort(sorted, new Comparator() { - @Override - public int compare(SimpleRaceInfo o1, SimpleRaceInfo o2) { - return o1.getStartOfRace().compareTo(o2.getStartOfRace()); - } - }); + Map> store = getDistinctRaces(/* include remotes */ true, (uuid)->true); + List sorted = store.values().stream() + .flatMap(races->races.stream()) + .sorted((o1,o2)->o1.getStartOfRace().compareTo(o2.getStartOfRace())) + .collect(Collectors.toList()); + for (int i = 0; i < sorted.size(); i++) { SimpleRaceInfo current = sorted.get(i); JSONObject raceInfo = new JSONObject(); @@ -121,12 +147,23 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { return getJsonResponse(streamingOutput(json)); } - private Map getDistinctRaces(boolean includeRemotes) { - final Map distinctRaces = new HashMap<>(); + private Map> getDistinctRaces(boolean includeRemotes, Function eventListFilter) { + final Map> distinctRaces = new HashMap<>(); if (includeRemotes) { - distinctRaces.putAll(getService().getRemoteRaceList()); + distinctRaces.putAll(getService().getRemoteRaceList(eventListFilter)); } - distinctRaces.putAll(getService().getLocalRaceList()); + + Map> localRaces = getService().getLocalRaceList(eventListFilter); + localRaces.forEach((identifier, simpleRaceInfoSet) -> distinctRaces.compute(identifier, (key, valueSet) -> { + Set mergedSet; + if (valueSet != null) { + valueSet.addAll(simpleRaceInfoSet); + mergedSet = valueSet; + } else { + mergedSet = simpleRaceInfoSet; + } + return mergedSet; + })); return distinctRaces; } diff --git a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java index aef84bd63fd..ded26e31760 100644 --- a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java +++ b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java @@ -16,9 +16,9 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Consumer; +import java.util.function.Function; -import org.apache.shiro.authz.UnauthorizedException; -import org.apache.shiro.subject.Subject; +import javax.security.auth.Subject; import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor; import com.sap.sailing.domain.abstractlog.race.RaceLog; @@ -114,6 +114,7 @@ import com.sap.sse.pairinglist.PairingList; import com.sap.sse.pairinglist.PairingListTemplate; import com.sap.sse.replication.ReplicableWithObjectInputStream; import com.sap.sse.security.SecurityService; +import com.sap.sse.security.shared.UnauthorizedException; import com.sap.sse.shared.media.ImageDescriptor; import com.sap.sse.shared.media.VideoDescriptor; @@ -806,7 +807,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * for races obtained through remote server references, the remote URL will be that of the remote server * reference. Callers may modify the map as each call to this method will produce a new copy. */ - Map getRemoteRaceList(); + Map> getRemoteRaceList(Function eventListFilter); /** * Obtains information about all {@link TrackedRace}s connected to {@link Event}s managed locally on this server @@ -814,12 +815,16 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * that the race is linked to a {@link Leaderboard} that is part of a {@link LeaderboardGroup} which is in turn * {@link Event#getLeaderboardGroups() linked} to the {@link Event}. * + * @param eventListFilter + * lambda expression that filters by the events UUID. When true is returned the races of this event are + * considered for further processing. + * * @return a new map whose keys identify the race and whose values have a short info about the race that will allow, * e.g., to sort by start time and therefore identify "anniversary" races in a central instance. All * {@link SimpleRaceInfo#getRemoteUrl()} values will be {@code null}, meaning that the tracked races live * locally on this server. Callers may modify the map as each call to this method will produce a new copy. - */ - Map getLocalRaceList(); + *///FIXME update api doc here + Map> getLocalRaceList(Function eventListFilter); /** * Provides a {@link DetailedRaceInfo} for the given {@link RegattaAndRaceIdentifier}. The algorithm first tries to diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java index 5065c2fd0b8..355b731e333 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java @@ -46,6 +46,8 @@ import java.util.function.Predicate; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import java.util.zip.GZIPInputStream; import javax.management.InstanceAlreadyExistsException; @@ -57,7 +59,6 @@ import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; import org.apache.shiro.SecurityUtils; -import org.apache.shiro.authz.UnauthorizedException; import org.apache.shiro.subject.Subject; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -336,6 +337,7 @@ import com.sap.sse.replication.ReplicationService; import com.sap.sse.security.SecurityService; import com.sap.sse.security.shared.QualifiedObjectIdentifier; import com.sap.sse.security.shared.TypeRelativeObjectIdentifier; +import com.sap.sse.security.shared.UnauthorizedException; import com.sap.sse.security.shared.impl.User; import com.sap.sse.security.shared.impl.UserGroup; import com.sap.sse.security.util.RemoteServerUtil; @@ -4695,42 +4697,46 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes } @Override - public HashMap getRemoteRaceList() { - final HashMap store = new HashMap<>(); - for (Entry, Exception>> race : remoteSailingServerSet + public Map> getRemoteRaceList( + Function eventListFilter) { + Map> store = new HashMap<>(); + for (Entry, Exception>> remoteServerRaces : remoteSailingServerSet .getCachedRaceList().entrySet()) { - if (race.getValue().getB() != null) { - throw new RuntimeException("Some remoteserver did not respond " + race.getKey()); - } - for (SimpleRaceInfo raceinfo : race.getValue().getA()) { - store.put(raceinfo.getIdentifier(), raceinfo); + if (remoteServerRaces.getValue().getB() != null) { + throw new RuntimeException("Some remoteserver did not respond " + remoteServerRaces.getKey()); } + stream(remoteServerRaces.getValue().getA()) + .filter(race->eventListFilter.apply(race.getEventID())) + .forEach(race->{ + Util.addToValueSet(store, race.getIdentifier(), race); + }); } return store; } + private static Stream stream(Iterable iterable) { + return StreamSupport.stream(iterable.spliterator(), false); + } + @Override - public Map getLocalRaceList() { - final HashMap store = new HashMap<>(); - for (Event event : getAllEvents()) { - for (LeaderboardGroup group : event.getLeaderboardGroups()) { - for (Leaderboard leaderboard : group.getLeaderboards()) { - for (RaceColumn race : leaderboard.getRaceColumns()) { - for (Fleet fleet : race.getFleets()) { - TrackedRace trackedRace = race.getTrackedRace(fleet); - if (trackedRace != null && trackedRace.hasGPSData()) { - RegattaAndRaceIdentifier raceIdentifier = trackedRace.getRaceIdentifier(); - final TimePoint startOfRace = trackedRace.getStartOfRace(); - if (startOfRace != null) { - SimpleRaceInfo raceInfo = new SimpleRaceInfo(raceIdentifier, startOfRace, /* remoteURL */ null); - store.put(raceInfo.getIdentifier(), raceInfo); - } - } - } + public Map> getLocalRaceList(Function eventListFilter) { + Map> store = new HashMap<>(); + stream(getAllEvents()) + .filter(event->eventListFilter.apply(event.getId())) + .forEach(event -> stream(event.getLeaderboardGroups()) + .flatMap(group -> stream(group.getLeaderboards())) + .flatMap(leaderBoard -> stream(leaderBoard.getRaceColumns())) + .flatMap(race -> stream(race.getFleets()) + .flatMap(fleet -> Stream.of(race.getTrackedRace(fleet)))) + .filter(trackedRace -> trackedRace != null && trackedRace.hasGPSData()) + .forEach(trackedRace -> { + RegattaAndRaceIdentifier raceIdentifier = trackedRace.getRaceIdentifier(); + final TimePoint startOfRace = trackedRace.getStartOfRace(); + if (startOfRace != null) { + Util.addToValueSet(store, raceIdentifier, new SimpleRaceInfo(raceIdentifier, startOfRace, + /* remoteURL */ null, event.getId())); } - } - } - } + })); return store; } From 40e358c9fa570e21c5928d9196e666d8f0a9a43a Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 12:04:21 +0100 Subject: [PATCH 05/30] adopt according to changed data structures bug 5410 --- .../anniversary/AnniversaryRaceDeterminatorImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java index 7158ee674a2..7148a7d2c4a 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java @@ -6,6 +6,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; @@ -81,7 +82,12 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina result.getA().forEach(race -> allRaces.put(race.getIdentifier(), race)); } }); - allRaces.putAll(racingEventService.getLocalRaceList()); + racingEventService.getLocalRaceList((uuid)->true) + .values() + .stream() + .flatMap(Set::stream) + .forEach(race -> allRaces.put(race.getIdentifier(), race)); + //flatten here and count every race only once even if it is in multiple events (GH 9.11.2020) if (allRaces.size() != currentRaceCount) { checkForNewAnniversaries(allRaces); } From aaf837ac595085ea4a9965aba457770e61914e53 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 12:15:32 +0100 Subject: [PATCH 06/30] fix wrong imports bug5410 --- .../com/sap/sailing/server/interfaces/RacingEventService.java | 3 ++- .../com/sap/sailing/server/impl/RacingEventServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java index 1ee32caf563..9ce8b1be315 100644 --- a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java +++ b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java @@ -20,6 +20,8 @@ import java.util.function.Function; import javax.security.auth.Subject; +import org.apache.shiro.authz.UnauthorizedException; + import com.sap.sailing.domain.abstractlog.AbstractLogEventAuthor; import com.sap.sailing.domain.abstractlog.race.RaceLog; import com.sap.sailing.domain.abstractlog.race.RaceLogStartTimeEvent; @@ -114,7 +116,6 @@ import com.sap.sse.pairinglist.PairingList; import com.sap.sse.pairinglist.PairingListTemplate; import com.sap.sse.replication.ReplicableWithObjectInputStream; import com.sap.sse.security.SecurityService; -import com.sap.sse.security.shared.UnauthorizedException; import com.sap.sse.shared.media.ImageDescriptor; import com.sap.sse.shared.media.VideoDescriptor; diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java index 88a357d9596..d86c5ec9dfe 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java @@ -59,6 +59,7 @@ import javax.management.NotCompliantMBeanException; import javax.management.ObjectName; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authz.UnauthorizedException; import org.apache.shiro.subject.Subject; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -337,7 +338,6 @@ import com.sap.sse.replication.ReplicationService; import com.sap.sse.security.SecurityService; import com.sap.sse.security.shared.QualifiedObjectIdentifier; import com.sap.sse.security.shared.TypeRelativeObjectIdentifier; -import com.sap.sse.security.shared.UnauthorizedException; import com.sap.sse.security.shared.impl.User; import com.sap.sse.security.shared.impl.UserGroup; import com.sap.sse.security.util.RemoteServerUtil; From f8a637cd3652e9725d5fcda9a596c81c24f705fa Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 14:51:03 +0100 Subject: [PATCH 07/30] fix bug when processing UUIDs change to default behaviour exclude, this will return all races in case that no event id has been specified. bug 5410 --- .../server/gateway/jaxrs/api/TrackedRaceListResource.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index 4d541cf9d9c..b7fbfb4c6ef 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -22,6 +22,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.StreamingOutput; +import org.apache.commons.lang.StringUtils; import org.json.simple.JSONArray; import org.json.simple.JSONObject; @@ -71,11 +72,12 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { @Path("getRaces") public Response raceList(@QueryParam("transitive") @DefaultValue("false") Boolean transitive, @QueryParam("events") @DefaultValue("") String strEvents, - @QueryParam("pred") @DefaultValue("incl") String predicate) { + @QueryParam("pred") @DefaultValue("excl") String predicate) { final boolean includeRemotes = transitive != null && Boolean.TRUE.equals(transitive); Set eventUUIDs = Arrays.asList(strEvents.split(",")) .stream() + .filter(StringUtils::isNotBlank) .map(UUID::fromString) .collect(Collectors.toSet()); From 1669b2660056c693af048854e0360997ba17c84d Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 17:17:20 +0100 Subject: [PATCH 08/30] switch using a predicate bug 5410 --- .../gateway/jaxrs/api/TrackedRaceListResource.java | 4 ++-- .../sailing/server/interfaces/RacingEventService.java | 6 +++--- .../sap/sailing/server/impl/RacingEventServiceImpl.java | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index b7fbfb4c6ef..ff880a649b3 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -81,7 +81,7 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { .map(UUID::fromString) .collect(Collectors.toSet()); - Function eventFilter; + Predicate eventFilter; if ("incl".equals(predicate)) { eventFilter = (uuid)->eventUUIDs.contains(uuid); } else if ("excl".equals(predicate)) { @@ -149,7 +149,7 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { return getJsonResponse(streamingOutput(json)); } - private Map> getDistinctRaces(boolean includeRemotes, Function eventListFilter) { + private Map> getDistinctRaces(boolean includeRemotes, Predicate eventListFilter) { final Map> distinctRaces = new HashMap<>(); if (includeRemotes) { distinctRaces.putAll(getService().getRemoteRaceList(eventListFilter)); diff --git a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java index 9ce8b1be315..37f83555662 100644 --- a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java +++ b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java @@ -16,7 +16,7 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Consumer; -import java.util.function.Function; +import java.util.function.Predicate; import javax.security.auth.Subject; @@ -815,7 +815,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * for races obtained through remote server references, the remote URL will be that of the remote server * reference. Callers may modify the map as each call to this method will produce a new copy. */ - Map> getRemoteRaceList(Function eventListFilter); + Map> getRemoteRaceList(Predicate eventListFilter); /** * Obtains information about all {@link TrackedRace}s connected to {@link Event}s managed locally on this server @@ -832,7 +832,7 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * {@link SimpleRaceInfo#getRemoteUrl()} values will be {@code null}, meaning that the tracked races live * locally on this server. Callers may modify the map as each call to this method will produce a new copy. *///FIXME update api doc here - Map> getLocalRaceList(Function eventListFilter); + Map> getLocalRaceList(Predicate eventListFilter); /** * Provides a {@link DetailedRaceInfo} for the given {@link RegattaAndRaceIdentifier}. The algorithm first tries to diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java index d86c5ec9dfe..0ab2b13e6b3 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java @@ -4714,8 +4714,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes } @Override - public Map> getRemoteRaceList( - Function eventListFilter) { + public Map> getRemoteRaceList(Predicate eventListFilter) { Map> store = new HashMap<>(); for (Entry, Exception>> remoteServerRaces : remoteSailingServerSet .getCachedRaceList().entrySet()) { @@ -4723,7 +4722,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes throw new RuntimeException("Some remoteserver did not respond " + remoteServerRaces.getKey()); } stream(remoteServerRaces.getValue().getA()) - .filter(race->eventListFilter.apply(race.getEventID())) + .filter(race->eventListFilter.test(race.getEventID())) .forEach(race->{ Util.addToValueSet(store, race.getIdentifier(), race); }); @@ -4736,10 +4735,10 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes } @Override - public Map> getLocalRaceList(Function eventListFilter) { + public Map> getLocalRaceList(Predicate eventListFilter) { Map> store = new HashMap<>(); stream(getAllEvents()) - .filter(event->eventListFilter.apply(event.getId())) + .filter(event->eventListFilter.test(event.getId())) .forEach(event -> stream(event.getLeaderboardGroups()) .flatMap(group -> stream(group.getLeaderboards())) .flatMap(leaderBoard -> stream(leaderBoard.getRaceColumns())) From b0742667cdc420da65c22609578c674d4ce0348b Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 9 Nov 2020 17:18:19 +0100 Subject: [PATCH 09/30] add documentation and update release notes bug 5410 --- .../jaxrs/api/TrackedRaceListResource.java | 14 ++++++++--- .../webservices/api/v1/getRacesGetDoc.html | 21 +++++++++++++---- .../server/interfaces/RacingEventService.java | 23 ++++++++++++------- .../server/impl/RemoteSailingServerSet.java | 7 ++++++ .../release_notes_admin.html | 5 ++++ 5 files changed, 55 insertions(+), 15 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index ff880a649b3..67f3c9d0954 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -9,7 +9,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.UUID; -import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Collectors; import javax.ws.rs.DefaultValue; @@ -64,8 +64,16 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { * are grouped by the remote URL from where they originated. Local entries have a {@code null} value for the * {@link DetailedRaceInfoJsonSerializer# FIELD_REMOTEURL remote URL} field. The order of the list returned is * undefined.
- * @param events string list of event UUIDs - * @param predicate depicts the semantic of the event UUIDs, when "incl" include only the depicted. When "excl" exclude the depicted events + * Optionally a list of event UUIDs together with a predicate can be provided. The returned races list will be + * filtered by the given ids. The predicate specifies the behavior of the filter. + * + * @param transitive + * when true indicates that the cached list of remote references shall be considered + * @param events + * string list of event UUIDs + * @param predicate + * depicts the semantic of the filtering, when "incl" only races belonging to the depicted event UUIDs + * are returned. When "excl" is provided the filtering behaves vice versa. */ @GET @Produces(CONTENT_TYPE_JSON_UTF8) diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html index d0c005a7e3e..8875794c21b 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html @@ -14,6 +14,10 @@ Description:

Gets all TrackedRaces found on the local instance, and optionally (depending on the "transitive" parameter) its remote servers. Only those TrackedRaces are contained that are reachable by any Event and have GPS data and a valid startOfRace.

+

Optionally a list of event UUIDs together with a predicate can be provided. The returned races list will be filtered by the +given ids. The predicate specifies the behavior of the filter. +

+

Example: api/v1/trackedRaces/getRaces?transitive=true&events=b1e78f52-ce52-4b71-ac30-452599faf4a1,ee4f04d0-c02c-449c-91cb-606aa5b0480e&pred=incl


@@ -30,10 +34,19 @@ Only those TrackedRaces are contained that are reachable by any Event and have G - - + + diff --git a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java index 37f83555662..1f11cfc407b 100644 --- a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java +++ b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/RacingEventService.java @@ -807,13 +807,19 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * instance or reachable through a remote server reference, having a non-{@code null} * {@link TrackedRace#getStartOfRace() start time}. Being "connected" here means that the race is linked to a * {@link Leaderboard} that is part of a {@link LeaderboardGroup} which is in turn - * {@link Event#getLeaderboardGroups() linked} to the {@link Event}. + * {@link Event#getLeaderboardGroups() linked} to the {@link Event}. The list can be filtered by a predicate that is + * used to inspect the UUIDs of the associated events. + * + * @param eventListFilter + * a predicate that can be used to filter on the uuids of the events to which the races are assigned to. * * @return a new map whose keys identify the race and whose values have a short info about the race that will allow, * e.g., to sort by start time and therefore identify "anniversary" races in a central instance. All - * {@link SimpleRaceInfo#getRemoteUrl()} values will be {@code null} for races managed locally on this server; - * for races obtained through remote server references, the remote URL will be that of the remote server - * reference. Callers may modify the map as each call to this method will produce a new copy. + * {@link SimpleRaceInfo#getRemoteUrl()} values will be {@code null} for races managed locally on this + * server; for races obtained through remote server references, the remote URL will be that of the remote + * server reference. Callers may modify the map as each call to this method will produce a new copy. The + * value of the map consists out of a set to reflect the situation where races are assigned to multiple + * events. Therefore see also {@link SimpleRaceInfo#getEventID()}. */ Map> getRemoteRaceList(Predicate eventListFilter); @@ -824,14 +830,15 @@ public interface RacingEventService extends TrackedRegattaRegistry, RegattaFetch * {@link Event#getLeaderboardGroups() linked} to the {@link Event}. * * @param eventListFilter - * lambda expression that filters by the events UUID. When true is returned the races of this event are - * considered for further processing. + * a predicate that can be used to filter on the uuids of the events to which the races are assigned to. * * @return a new map whose keys identify the race and whose values have a short info about the race that will allow, * e.g., to sort by start time and therefore identify "anniversary" races in a central instance. All * {@link SimpleRaceInfo#getRemoteUrl()} values will be {@code null}, meaning that the tracked races live - * locally on this server. Callers may modify the map as each call to this method will produce a new copy. - *///FIXME update api doc here + * locally on this server. Callers may modify the map as each call to this method will produce a new copy. The + * value of the map consists out of a set to reflect the situation where races are assigned to multiple + * events. Therefore see also {@link SimpleRaceInfo#getEventID()}. + */ Map> getLocalRaceList(Predicate eventListFilter); /** diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java index 9d73ee72d1a..f4fbd4945b0 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java @@ -234,6 +234,13 @@ public class RemoteSailingServerSet { new HashSet<>(remoteRaceResultReceivedCallbacks).forEach(Runnable::run); } + /** + * Build the URL for retrieving the remote servers race list. This is complemented by the endpoint here: + * {@link com.sap.sailing.server.gateway.jaxrs.api.TrackedRaceListResource#raceList(Boolean, String, String)} + * @param ref the remote reference + * @return the URL for retrieving the remote races. + * @throws MalformedURLException + */ private URL getRaceListURL(RemoteSailingServerReference ref) throws MalformedURLException { URL remoteServerBaseURL = ref.getURL(); String endpoint = "/trackedRaces/getRaces?transitive=true"; diff --git a/java/com.sap.sailing.www/release_notes_admin.html b/java/com.sap.sailing.www/release_notes_admin.html index d72222a0759..72a07c5f46a 100755 --- a/java/com.sap.sailing.www/release_notes_admin.html +++ b/java/com.sap.sailing.www/release_notes_admin.html @@ -23,6 +23,11 @@

Release Notes - Administration Console

+

November 2020

+
    +
  • REST endpoint /api/v1/trackedRaces/getRaces to retrieve list of races that are available on the requested server + has been extended to filter returned list of races by given events. A inclusive/exclusive logic is available.
  • +

October 2020

  • Fixed a regression regarding the transmission of a time-on-time/time-on-distance ranking metric From 3c18d7b6992c0b46a72ff30c53b775c23a6b4b14 Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Fri, 13 Nov 2020 10:26:58 +0100 Subject: [PATCH 10/30] Code styling only --- .../server/gateway/jaxrs/api/TrackedRaceListResource.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index 67f3c9d0954..1d48907e765 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -82,14 +82,12 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { @QueryParam("events") @DefaultValue("") String strEvents, @QueryParam("pred") @DefaultValue("excl") String predicate) { final boolean includeRemotes = transitive != null && Boolean.TRUE.equals(transitive); - - Set eventUUIDs = Arrays.asList(strEvents.split(",")) + final Set eventUUIDs = Arrays.asList(strEvents.split(",")) .stream() .filter(StringUtils::isNotBlank) .map(UUID::fromString) .collect(Collectors.toSet()); - - Predicate eventFilter; + final Predicate eventFilter; if ("incl".equals(predicate)) { eventFilter = (uuid)->eventUUIDs.contains(uuid); } else if ("excl".equals(predicate)) { @@ -97,7 +95,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { }else { throw new IllegalArgumentException("unrecognized predicate " + predicate + " only \"excl\" and \"incl\" are possible"); } - final Map> distinctRaces = getDistinctRaces(includeRemotes, eventFilter); final HashMap> raceData = new HashMap<>(); From 72199e60482307f02810b36284b20f30b91c6362 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Fri, 13 Nov 2020 15:00:54 +0100 Subject: [PATCH 11/30] start implementing test bug 5410 --- .../api/event/TrackedRacesListApi.java | 19 +++++++ .../api/test/TrackedRacesListApiTest.java | 52 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/event/TrackedRacesListApi.java create mode 100644 java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/event/TrackedRacesListApi.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/event/TrackedRacesListApi.java new file mode 100644 index 00000000000..879e219b88f --- /dev/null +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/event/TrackedRacesListApi.java @@ -0,0 +1,19 @@ +package com.sap.sailing.selenium.api.event; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.json.simple.JSONAware; + +import com.sap.sailing.selenium.api.core.ApiContext; + +public class TrackedRacesListApi { + + public JSONAware getRaces(ApiContext ctx, boolean transitive, List eventIds, String pred ) { + Map queryParams = new HashMap<>(); + JSONAware json = ctx.get("/api/v1/trackedRaces/getRaces", queryParams); + json.toJSONString(); + return json; + } +} diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java new file mode 100644 index 00000000000..46cfea3db11 --- /dev/null +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java @@ -0,0 +1,52 @@ +package com.sap.sailing.selenium.api.test; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + +import org.junit.Before; +import org.junit.Test; + +import com.sap.sailing.domain.common.CompetitorRegistrationType; +import com.sap.sailing.selenium.api.core.ApiContext; +import com.sap.sailing.selenium.api.event.EventApi; +import com.sap.sailing.selenium.api.event.EventApi.Event; +import com.sap.sailing.selenium.api.event.TrackedEventsApi; +import com.sap.sailing.selenium.api.event.TrackedRacesListApi; +import com.sap.sailing.selenium.api.regatta.RaceColumn; +import com.sap.sailing.selenium.api.regatta.RegattaApi; +import com.sap.sailing.selenium.test.AbstractSeleniumTest; +import com.sap.sse.common.Util.Triple; + +public class TrackedRacesListApiTest extends AbstractSeleniumTest { + private final EventApi eventApi = new EventApi(); + private final TrackedEventsApi trackedEventsApi = new TrackedEventsApi(); + private final TrackedRacesListApi trackedRacesListApi = new TrackedRacesListApi(); + private final RegattaApi regattaApi = new RegattaApi(); + + @Before + public void setUp() { + clearState(getContextRoot()); + } + + @Test + public void testGetRaces() { + final String deviceId = UUID.randomUUID().toString(); + final Set> trackedIds = new HashSet<>(); + final String competitorId = UUID.randomUUID().toString(); + final String boatId = UUID.randomUUID().toString(); + trackedIds.add(new Triple<>(competitorId, null, null)); + trackedIds.add(new Triple<>(null, boatId, null)); + + ApiContext ctx = ApiContext.createAdminApiContext(getContextRoot(), + ApiContext.SERVER_CONTEXT); + Event event = eventApi.createEvent(ctx, "Test Event GH", "75QMNATIONALEKREUZER", CompetitorRegistrationType.CLOSED, "Karlsruhe"); + + trackedEventsApi.updateOrCreateTrackedEvent(ctx, event.getId(), event.getName(), "/", deviceId, trackedIds, event.getSecret()); + RaceColumn[] result = regattaApi.addRaceColumn(ctx, event.getName(), "T", 5); + + trackedRacesListApi.getRaces(ctx, false, new ArrayList(), "excl"); + System.out.println("done"); + } +} From ce2ccbd6f7dc2a99011d75eb4ffb0974eae6955d Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 16 Nov 2020 19:50:18 +0100 Subject: [PATCH 12/30] reorder code to give local races precedence over remote references bug5410 --- .../jaxrs/api/TrackedRaceListResource.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index 1d48907e765..ef40af1f946 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -155,22 +155,22 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { } private Map> getDistinctRaces(boolean includeRemotes, Predicate eventListFilter) { - final Map> distinctRaces = new HashMap<>(); + final Map> distinctRaces = getService().getLocalRaceList(eventListFilter); + if (includeRemotes) { - distinctRaces.putAll(getService().getRemoteRaceList(eventListFilter)); + getService().getRemoteRaceList(eventListFilter).forEach((identifier, simpleRaceInfoSet) -> distinctRaces.compute(identifier, (key, valueSet) -> { + Set mergedSet; + if (valueSet != null) { + // will be only added when not already in the set, look at the equals method! + valueSet.addAll(simpleRaceInfoSet); + mergedSet = valueSet; + } else { + mergedSet = simpleRaceInfoSet; + } + return mergedSet; + })); } - Map> localRaces = getService().getLocalRaceList(eventListFilter); - localRaces.forEach((identifier, simpleRaceInfoSet) -> distinctRaces.compute(identifier, (key, valueSet) -> { - Set mergedSet; - if (valueSet != null) { - valueSet.addAll(simpleRaceInfoSet); - mergedSet = valueSet; - } else { - mergedSet = simpleRaceInfoSet; - } - return mergedSet; - })); return distinctRaces; } From cba58c4b01b6fcdaa06c5bdad895f756367fa68a Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Fri, 20 Nov 2020 09:57:16 +0100 Subject: [PATCH 13/30] remove --- .../api/test/TrackedRacesListApiTest.java | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java deleted file mode 100644 index 46cfea3db11..00000000000 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/api/test/TrackedRacesListApiTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.sap.sailing.selenium.api.test; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; - -import org.junit.Before; -import org.junit.Test; - -import com.sap.sailing.domain.common.CompetitorRegistrationType; -import com.sap.sailing.selenium.api.core.ApiContext; -import com.sap.sailing.selenium.api.event.EventApi; -import com.sap.sailing.selenium.api.event.EventApi.Event; -import com.sap.sailing.selenium.api.event.TrackedEventsApi; -import com.sap.sailing.selenium.api.event.TrackedRacesListApi; -import com.sap.sailing.selenium.api.regatta.RaceColumn; -import com.sap.sailing.selenium.api.regatta.RegattaApi; -import com.sap.sailing.selenium.test.AbstractSeleniumTest; -import com.sap.sse.common.Util.Triple; - -public class TrackedRacesListApiTest extends AbstractSeleniumTest { - private final EventApi eventApi = new EventApi(); - private final TrackedEventsApi trackedEventsApi = new TrackedEventsApi(); - private final TrackedRacesListApi trackedRacesListApi = new TrackedRacesListApi(); - private final RegattaApi regattaApi = new RegattaApi(); - - @Before - public void setUp() { - clearState(getContextRoot()); - } - - @Test - public void testGetRaces() { - final String deviceId = UUID.randomUUID().toString(); - final Set> trackedIds = new HashSet<>(); - final String competitorId = UUID.randomUUID().toString(); - final String boatId = UUID.randomUUID().toString(); - trackedIds.add(new Triple<>(competitorId, null, null)); - trackedIds.add(new Triple<>(null, boatId, null)); - - ApiContext ctx = ApiContext.createAdminApiContext(getContextRoot(), - ApiContext.SERVER_CONTEXT); - Event event = eventApi.createEvent(ctx, "Test Event GH", "75QMNATIONALEKREUZER", CompetitorRegistrationType.CLOSED, "Karlsruhe"); - - trackedEventsApi.updateOrCreateTrackedEvent(ctx, event.getId(), event.getName(), "/", deviceId, trackedIds, event.getSecret()); - RaceColumn[] result = regattaApi.addRaceColumn(ctx, event.getName(), "T", 5); - - trackedRacesListApi.getRaces(ctx, false, new ArrayList(), "excl"); - System.out.println("done"); - } -} From 70ff0f0bc80fa2984626512ad78c7a8679b2380d Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Fri, 20 Nov 2020 17:14:51 +0100 Subject: [PATCH 14/30] quick start launcher with less entrypoints --- ... Sailing SDM (Home+Admin+Raceboard).launch | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 java/com.sap.sailing.gwt.ui/GWT Sailing SDM (Home+Admin+Raceboard).launch diff --git a/java/com.sap.sailing.gwt.ui/GWT Sailing SDM (Home+Admin+Raceboard).launch b/java/com.sap.sailing.gwt.ui/GWT Sailing SDM (Home+Admin+Raceboard).launch new file mode 100644 index 00000000000..451b0abcafd --- /dev/null +++ b/java/com.sap.sailing.gwt.ui/GWT Sailing SDM (Home+Admin+Raceboard).launch @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8428ea160b39aff4ffb971728dc637c475a720c1 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Fri, 20 Nov 2020 17:17:19 +0100 Subject: [PATCH 15/30] switch to post bug 5410 --- .../jaxrs/api/TrackedRaceListResource.java | 17 +++++ .../server/impl/RemoteSailingServerSet.java | 65 ++++++++++++++----- 2 files changed, 66 insertions(+), 16 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index ef40af1f946..a23568bfd8f 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -13,7 +13,9 @@ import java.util.function.Predicate; import java.util.stream.Collectors; import javax.ws.rs.DefaultValue; +import javax.ws.rs.FormParam; import javax.ws.rs.GET; +import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; @@ -59,6 +61,21 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { return getJsonResponse(streamingOutput(detailedRaceListJsonSerializer.serialize(detailedRaceInfo))); } + /** + *

    POST variant of the {@link #raceList(Boolean, String, String)} interface. Just uses HTTP post to circumvent HTTP 418 + * issues with large number of events.

    + *

    Parameters must be provided within a form body.

    + * @see {@link #raceList(Boolean, String, String)} + */ + @POST + @Produces(CONTENT_TYPE_JSON_UTF8) + @Path("getRaces") + public Response raceListPost(@FormParam("transitive") @DefaultValue("false") Boolean transitive, + @FormParam("events") @DefaultValue("") String strEvents, + @FormParam("pred") @DefaultValue("excl") String predicate) { + return raceList(transitive, strEvents, predicate); + } + /** * Returns a list of tracked races. By default, only TrackedRaces from the local instance are returned. The entries * are grouped by the remote URL from where they originated. Local entries have a {@code null} value for the diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java index f4fbd4945b0..d490e23fa65 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java @@ -3,7 +3,9 @@ package com.sap.sailing.server.impl; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; @@ -15,6 +17,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; @@ -48,6 +51,7 @@ import com.sap.sailing.server.gateway.deserialization.impl.TrackingConnectorInfo import com.sap.sailing.server.gateway.deserialization.impl.VenueJsonDeserializer; import com.sap.sailing.server.gateway.serialization.impl.DetailedRaceInfoJsonSerializer; import com.sap.sailing.server.gateway.serialization.impl.SimpleRaceInfoJsonSerializer; +import com.sap.sse.common.Duration; import com.sap.sse.common.Util; import com.sap.sse.common.Util.Pair; import com.sap.sse.concurrent.LockUtil; @@ -188,11 +192,13 @@ public class RemoteSailingServerSet { private void updateRemoteServerTrackedRacesCacheSynchronously(RemoteSailingServerReference ref) { Util.Pair, Exception> result; try { - final URL raceListURL = getRaceListURL(ref); - logger.fine("Updating racelist for remote server " + ref + " from URL " + raceListURL); + + logger.fine("Updating racelist for remote server " + ref + " from URL " + ref.getURL()); + final SimpleRaceInfoJsonSerializer deserializer = new SimpleRaceInfoJsonSerializer(); final Set races = new HashSet<>(); - for (Object remoteWithRaces : getJsonFromRemoteServerSynchronously(ref, raceListURL)) { + + for (Object remoteWithRaces : getJSONFromRemoteRacesListSynchronously(ref)) { JSONObject remoteWithRacesAsJson = (JSONObject) remoteWithRaces; String remoteUrlAsString = (String) remoteWithRacesAsJson .get(DetailedRaceInfoJsonSerializer.FIELD_REMOTEURL); @@ -235,7 +241,7 @@ public class RemoteSailingServerSet { } /** - * Build the URL for retrieving the remote servers race list. This is complemented by the endpoint here: + * Build the URL for retrieving the remote servers race list. This is complemented by the end point here: * {@link com.sap.sailing.server.gateway.jaxrs.api.TrackedRaceListResource#raceList(Boolean, String, String)} * @param ref the remote reference * @return the URL for retrieving the remote races. @@ -244,18 +250,6 @@ public class RemoteSailingServerSet { private URL getRaceListURL(RemoteSailingServerReference ref) throws MalformedURLException { URL remoteServerBaseURL = ref.getURL(); String endpoint = "/trackedRaces/getRaces?transitive=true"; - if (!ref.getSelectedEventIds().isEmpty()) { - endpoint += "&events="; - - Iterator iter = ref.getSelectedEventIds().iterator(); - while (iter.hasNext()) { - endpoint += iter.next().toString(); - if (iter.hasNext()) { - endpoint += ","; - } - } - endpoint += "&pred=" + (ref.isInclude() ? "incl" : "excl"); - } return getEndpointUrl(remoteServerBaseURL, endpoint); } @@ -346,6 +340,45 @@ public class RemoteSailingServerSet { updateCache(ref, result, cachedStatisticsByYearForRemoteSailingServers::put); } + private JSONArray getJSONFromRemoteRacesListSynchronously(final RemoteSailingServerReference ref) + throws MalformedURLException, IOException, ParseException { + JSONArray data; + final URL url = getRaceListURL(ref); + final StringBuffer formParams = new StringBuffer("transitive=true"); + if (!ref.getSelectedEventIds().isEmpty()) { + formParams.append("&events="); + Iterator iter = ref.getSelectedEventIds().iterator(); + while (iter.hasNext()) { + formParams.append(URLEncoder.encode(iter.next().toString(), "utf-8")); + if (iter.hasNext()) { + formParams.append(URLEncoder.encode(",", "utf-8")); + } + } + formParams.append("&pred=" + (ref.isInclude() ? "incl" : "excl")); + } + HttpURLConnection urlConnection = (HttpURLConnection) HttpUrlConnectionHelper.redirectConnection(url, + Duration.ONE_SECOND.times(1000), "POST", (connection) -> connection + .setRequestProperty("Content-Type", "application/x-www-form-urlencoded"), + Optional.of(outputStream -> { + try (OutputStreamWriter writer = new OutputStreamWriter(outputStream, "utf-8")) { + writer.write(formParams.toString()); + } + })); + final int responseCode = urlConnection.getResponseCode(); + if (responseCode == 200) { + try (BufferedReader bufferedReader = new BufferedReader( + new InputStreamReader(urlConnection.getInputStream(), "utf-8"))) { + JSONParser parser = new JSONParser(); + data = (JSONArray) parser.parse(bufferedReader); + } + } else { + // fallback to old interface when new interface was not found. + // can be removed when all servers are upgraded + data = getJsonFromRemoteServerSynchronously(ref, url); + } + return data; + } + private JSONArray getJsonFromRemoteServerSynchronously(RemoteSailingServerReference ref, final URL url) throws IOException, ParseException { logger.fine("Updating data for remote server " + ref + " from URL " + url); From 5a648abd528df21cb87c40f2ea5bc682000f73e9 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 23 Nov 2020 09:56:10 +0100 Subject: [PATCH 16/30] added deprecation to old endpoint update docu and release notes Bug 5410 --- .../jaxrs/api/TrackedRaceListResource.java | 1 + .../webservices/api/v1/getRacesGetDoc.html | 46 ++++++++++++++++++- .../release_notes_admin.html | 3 +- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index a23568bfd8f..b48aa6af701 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -95,6 +95,7 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { @GET @Produces(CONTENT_TYPE_JSON_UTF8) @Path("getRaces") + @Deprecated public Response raceList(@QueryParam("transitive") @DefaultValue("false") Boolean transitive, @QueryParam("events") @DefaultValue("") String strEvents, @QueryParam("pred") @DefaultValue("excl") String predicate) { diff --git a/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html b/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html index 8875794c21b..2f6ccd1f692 100644 --- a/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html +++ b/java/com.sap.sailing.server.gateway/webservices/api/v1/getRacesGetDoc.html @@ -12,7 +12,8 @@

    URL: /api/v1/trackedRaces/getRaces

    Description: -

    Gets all TrackedRaces found on the local instance, and optionally (depending on the "transitive" parameter) its remote servers. +

    Please note: calling this interface using HTTP GET is deprecated. Use HTTP POST instead. +Gets all TrackedRaces found on the local instance, and optionally (depending on the "transitive" parameter) its remote servers. Only those TrackedRaces are contained that are reachable by any Event and have GPS data and a valid startOfRace.

    Optionally a list of event UUIDs together with a predicate can be provided. The returned races list will be filtered by the given ids. The predicate specifies the behavior of the filter. @@ -56,6 +57,49 @@ given ids. The predicate specifies the behavior of the filter.

Optional parameters: -
transitive (true or false) - determines whether the races from other servers referenced remotely shall be collected in the response
-
+
+
    +
  • transitive (true or false) - determines whether the races + from other servers referenced remotely shall be collected in the + response
  • +
  • events: comma separated list of UUIDs depicting an event
  • +
  • pred: depicts the semantic of the filtering, when "incl" only races belonging to the depicted event UUIDs are + returned. When "excl" is provided the filtering behaves vice versa.
  • +
+
+
Request method: GEThttp://www.sapsailing.com/sailingserver/api/v1/trackedRaces/getRaces
+
+

Alternatively the interface can be called using http POST method. The parameters must be then provided within the request body as URL encoded form parameters (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST).

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Webservice Type:REST
Output format:Json
Mandatory parameters:None
Request Content-Type:application/x-www-form-urlencoded
Optional body parameters: +
+
    +
  • transitive (true or false) - determines whether the races + from other servers referenced remotely shall be collected in the + response
  • +
  • events: comma separated list of UUIDs depicting an event
  • +
  • pred: depicts the semantic of the filtering, when "incl" only races belonging to the depicted event UUIDs are + returned. When "excl" is provided the filtering behaves vice versa.
  • +
+
+
Request method:POST
Example:http://www.sapsailing.com/sailingserver/api/v1/trackedRaces/getRaces
Back to Web Service Overview diff --git a/java/com.sap.sailing.www/release_notes_admin.html b/java/com.sap.sailing.www/release_notes_admin.html index 72a07c5f46a..844b84b7631 100755 --- a/java/com.sap.sailing.www/release_notes_admin.html +++ b/java/com.sap.sailing.www/release_notes_admin.html @@ -26,7 +26,8 @@

November 2020

  • REST endpoint /api/v1/trackedRaces/getRaces to retrieve list of races that are available on the requested server - has been extended to filter returned list of races by given events. A inclusive/exclusive logic is available.
  • + has been extended to filter returned list of races by given events. A inclusive/exclusive logic is available. + Using HTTP is deprecated for this interface from now. Use HTTP POST instead.

October 2020

    From d259e0929ab06cc319f83407f9b1a1472b0820af Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 23 Nov 2020 21:21:24 +0100 Subject: [PATCH 17/30] read flag and disable calculation logic bug 5011 --- .../interfaces/AnniversaryRaceDeterminator.java | 9 +++++++++ .../AnniversaryRaceDeterminatorImpl.java | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/AnniversaryRaceDeterminator.java b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/AnniversaryRaceDeterminator.java index 31807a36f74..acf41815f54 100644 --- a/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/AnniversaryRaceDeterminator.java +++ b/java/com.sap.sailing.server.interface/src/com/sap/sailing/server/interfaces/AnniversaryRaceDeterminator.java @@ -19,6 +19,8 @@ import com.sap.sse.common.Util.Pair; * nth race will stay the same. */ public interface AnniversaryRaceDeterminator { + /** value of the system property for enabling anniversary calculation */ + public static final String ANNIVERSARY_FLAG = "AnniversaryRaceDeterminator.enabled"; /** * Interface for checker classes which are passed to the {@link AnniversaryRaceDeterminatorImpl}'s constructor in order to * determine anniversary numbers based on the {@link AnniversaryChecker#update(int) provided race count}. @@ -77,4 +79,11 @@ public interface AnniversaryRaceDeterminator { void clear(); void addAnniversary(int anniversaryToCheck, Pair anniversaryData); + + /** + * Indicates if anniversary calculation is enabled for this instance. + * @return gives back true when system property for anniversary calculation is set to true + * @see AnniversaryRaceDeterminator#ANNIVERSARY_FLAG + */ + boolean isEnabled(); } diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java index 7158ee674a2..222426a607a 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java @@ -34,7 +34,6 @@ import com.sap.sse.common.impl.MillisecondsTimePoint; */ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDeterminator { private static final Logger logger = Logger.getLogger(AnniversaryRaceDeterminatorImpl.class.getName()); - private final ConcurrentHashMap> knownAnniversaries; private final CopyOnWriteArrayList checkers; private final RacingEventService racingEventService; @@ -44,6 +43,7 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina private volatile Pair nextAnniversary; private volatile int currentRaceCount; + private final boolean enabled; /** * Interface for checker classes which are passed to the {@link AnniversaryRaceDeterminatorImpl}'s constructor in order to @@ -67,6 +67,7 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina } raceChangedListener = this::update; start(); + enabled = Boolean.parseBoolean(System.getProperty(ANNIVERSARY_FLAG, "false")); } void update() { @@ -203,8 +204,11 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina @Override public void start() { - isStarted.set(true); - remoteSailingServerSet.addRemoteRaceResultReceivedCallback(raceChangedListener); + logger.config("system property " + ANNIVERSARY_FLAG + " is " + enabled); + isStarted.set(enabled); + if (enabled) { + remoteSailingServerSet.addRemoteRaceResultReceivedCallback(raceChangedListener); + } } @Override @@ -220,4 +224,9 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina nextAnniversary = null; currentRaceCount = 0; } + + @Override + public boolean isEnabled() { + return this.enabled; + } } From e7f219eaeb2b92198233aad23b3296fc263983b8 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 23 Nov 2020 21:22:11 +0100 Subject: [PATCH 18/30] turn off event registration when anniversary calculation is not active bug 5011 --- .../server/anniversary/AnniversaryRaceDeterminatorImpl.java | 2 +- .../RaceChangeObserverForAnniversaryDetection.java | 2 +- .../com/sap/sailing/server/impl/RacingEventServiceImpl.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java index 222426a607a..a9d6763fa88 100755 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/AnniversaryRaceDeterminatorImpl.java @@ -66,8 +66,8 @@ public class AnniversaryRaceDeterminatorImpl implements AnniversaryRaceDetermina checkers.add(toAdd); } raceChangedListener = this::update; - start(); enabled = Boolean.parseBoolean(System.getProperty(ANNIVERSARY_FLAG, "false")); + start(); } void update() { diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/RaceChangeObserverForAnniversaryDetection.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/RaceChangeObserverForAnniversaryDetection.java index c814361958e..ad2da69b7c5 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/RaceChangeObserverForAnniversaryDetection.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/anniversary/RaceChangeObserverForAnniversaryDetection.java @@ -38,7 +38,7 @@ public class RaceChangeObserverForAnniversaryDetection extends AbstractTrackedRe public RaceChangeObserverForAnniversaryDetection(AnniversaryRaceDeterminatorImpl anniversaryRaceDeterminator) { this.anniversaryRaceDeterminator = anniversaryRaceDeterminator; this.listeners = new ConcurrentHashMap<>(); - this.stopped = new AtomicBoolean(false); + this.stopped = new AtomicBoolean(!anniversaryRaceDeterminator.isEnabled()); } @Override diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java index 32d2505fcf7..6afbc2abfbd 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RacingEventServiceImpl.java @@ -933,7 +933,9 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes anniversaryRaceDeterminator = new AnniversaryRaceDeterminatorImpl(this, remoteSailingServerSet, new QuarterChecker(), new SameDigitChecker()); raceChangeObserverForAnniversaryDetection = new RaceChangeObserverForAnniversaryDetection(anniversaryRaceDeterminator); - this.trackedRegattaListener.addListener(raceChangeObserverForAnniversaryDetection); + if (anniversaryRaceDeterminator.isEnabled()) { + this.trackedRegattaListener.addListener(raceChangeObserverForAnniversaryDetection); + } } private void populateBoatClasses(DomainFactory baseDomainFactory) { From c77577b031cca84ca2eae6d7074ee436d358c369 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 23 Nov 2020 22:19:35 +0100 Subject: [PATCH 19/30] update documentation bug 5011 --- .../release_notes_admin.html | 4 ++++ java/target/env.sh | 2 ++ wiki/info/landscape/amazon-ec2.md | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/java/com.sap.sailing.www/release_notes_admin.html b/java/com.sap.sailing.www/release_notes_admin.html index d72222a0759..3dd4012d70f 100755 --- a/java/com.sap.sailing.www/release_notes_admin.html +++ b/java/com.sap.sailing.www/release_notes_admin.html @@ -23,6 +23,10 @@

    Release Notes - Administration Console

    +

    November 2020

    +
      +
    • Anniversary calculation must now be turned on explicitly. Set system property
      -DAnniversaryRaceDeterminator.enabled=true
      at startup. Otherwise no anniversary is calculated.
    • +

    October 2020

    • Fixed a regression regarding the transmission of a time-on-time/time-on-distance ranking metric diff --git a/java/target/env.sh b/java/target/env.sh index d7b0de5bde1..34b998fcae2 100755 --- a/java/target/env.sh +++ b/java/target/env.sh @@ -164,6 +164,8 @@ fi # White labeling: use -Dcom.sap.sse.debranding=true to remove branding images and text #ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -Dcom.sap.sse.debranding=true" +# Anniversary calculation: +#ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -DAnniversaryRaceDeterminator.enabled=true" ADDITIONAL_JAVA_ARGS="$JAVA_VERSION_SPECIFIC_ARGS $ADDITIONAL_JAVA_ARGS -Dpersistentcompetitors.clear=false -Drestore.tracked.races=true -Dpolardata.source.url=https://www.sapsailing.com -Dwindestimation.source.url=https://www.sapsailing.com -XX:MaxGCPauseMillis=500" diff --git a/wiki/info/landscape/amazon-ec2.md b/wiki/info/landscape/amazon-ec2.md index cc82ac9dc25..dcc69cfbb91 100644 --- a/wiki/info/landscape/amazon-ec2.md +++ b/wiki/info/landscape/amazon-ec2.md @@ -140,7 +140,13 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili to enable white labeling. -9. Find the next unused ports for the variables SERVER_PORT, TELNET_PORT and EXPEDITION_PORT. You can do this by extracting all existing variable assignments from all env.sh files within the /home/sailing/servers directory. +9. Anniversary switch, uncomment this line in env.sh +
      +   #ADDITIONAL_JAVA_ARGS="$ADDITIONAL_JAVA_ARGS -DAnniversaryRaceDeterminator.enabled=true"
      +   
      + to enable anniversary calculation. + +10. Find the next unused ports for the variables SERVER_PORT, TELNET_PORT and EXPEDITION_PORT. You can do this by extracting all existing variable assignments from all env.sh files within the /home/sailing/servers directory.
          for i in /home/sailing/servers/*/env.sh; do cat $i | grep "^ *SERVER_PORT=" | tail -1 | tr -d "SERVER_PORT="; done | sort -n
      @@ -150,7 +156,7 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili
       
          If this is the first multi instance on the server, use the values SERVER_PORT=8888, TELNET_PORT=14888, EXPEDITION_PORT=2010.
       
      -10. Append the following variable assignments to your env.sh file.
      +11. Append the following variable assignments to your env.sh file.
          
          SERVER_NAME=SSV
          TELNET_PORT=14888
      @@ -162,7 +168,7 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili
          DEPLOY_TO=ssv
          
      -11. Append the following description to the /home/sailing/servers/README file. +12. Append the following description to the /home/sailing/servers/README file.
         # ssv (Schwartauer Segler-Verein, www.ssv-net.de, Alexander Probst, webmaster@alexprobst.de)
      @@ -173,15 +179,15 @@ To set up a multi instance for a server with name "SSV", subdomain "ssv.sapsaili
         EXPEDITION_PORT=2000
         
      -12. Start the multi instance. +13. Start the multi instance.
           cd /home/sailing/servers/ssv
           ./start
           
      -13. Change the admin password now and create a new user with admin role. +14. Change the admin password now and create a new user with admin role. -14. Your multi instance is now configured and started. It can be reached over ec2-34-250-136-229.eu-west-1.compute.amazonaws.com:8888. +15. Your multi instance is now configured and started. It can be reached over ec2-34-250-136-229.eu-west-1.compute.amazonaws.com:8888. ##### Reachability From e9c1efa0d4e801ab75e87e89d6908fcdf9f1ed15 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 23 Nov 2020 22:27:31 +0100 Subject: [PATCH 20/30] update launchers to have anniversary calculation active bug 5011 --- .../SailingServer (No Proxy OSX).launch | 440 +++++++++-------- .../SailingServer (No Proxy).launch | 444 +++++++++--------- ...ailingServer (No Proxy, Cached MTB).launch | 438 +++++++++-------- ...erver (No Proxy, Igtimi Local Test).launch | 444 +++++++++--------- .../SailingServer (No Proxy, Java11).launch | 444 +++++++++--------- ...r (No Proxy, Java11, JFR Recording).launch | 444 +++++++++--------- ...ingServer (No Proxy, Jetty on 8889).launch | 428 +++++++++-------- ...o Proxy, Jetty on 8889, Cached MTB).launch | 428 +++++++++-------- ...on 8889, auto-replicate SS and SSD).launch | 432 +++++++++-------- ... Jetty on 8889, auto-replicate dev).launch | 428 +++++++++-------- ...oxy, Jetty on 8889, auto-replicate).launch | 432 +++++++++-------- ...ingServer (No Proxy, Jetty on 8890).launch | 428 +++++++++-------- ...uto-replicate from replica at 8889).launch | 428 +++++++++-------- ...ver (No Proxy, Remote Debug SAP VM).launch | 426 +++++++++-------- ...ver (No Proxy, bundesliga2-2017 DB).launch | 444 +++++++++--------- ...erver (No Proxy, debranding active).launch | 444 +++++++++--------- ...ailingServer (No Proxy, winddbTest).launch | 373 ++++++++------- ...& Wind estimation Import from 8888).launch | 428 +++++++++-------- 18 files changed, 3832 insertions(+), 3941 deletions(-) diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch b/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch index af2d6a9a11e..e44c745ce1e 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch @@ -1,226 +1,220 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy).launch b/java/com.sap.sailing.server/SailingServer (No Proxy).launch index 7b902644ffb..926af363943 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch index 3eb5544aa9b..7b5849cd7e1 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch @@ -1,225 +1,219 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch index cfa7a21270f..2266f1746a9 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch index c23ac217388..ad70f7df9a3 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch index c86e5637d8c..3f0b7d5962c 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch index a78bcadb46d..67718b1de04 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch index 89005bcca32..6b5e18fba9b 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch index 90e735c10c4..b123bea578d 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch @@ -1,222 +1,216 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch index d864d1ff137..cf6f4b7bcd4 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch index fb31b587c71..6edc387b4e8 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch @@ -1,222 +1,216 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch index b92bd49b706..1a3546d9558 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch index a4a2bc0094c..fc9e895411e 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch index 9c09145e1e4..b4451bedad3 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch @@ -1,219 +1,213 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch index d807a3199f6..7a5e48105a9 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch index 81fab4b0115..f95531985a2 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch @@ -1,228 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch index ce2c42c65df..1e17c0fc805 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch @@ -21,7 +21,7 @@ - + @@ -31,196 +31,189 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch index b13678e2590..72448116b0c 100755 --- a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch +++ b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From cea2c98ad1d293806266a5b83f59a5967295dcd9 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Fri, 27 Nov 2020 09:08:49 +0100 Subject: [PATCH 21/30] pass replica header field into POST request bug 5410 --- .../sap/sailing/server/impl/RemoteSailingServerSet.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java index d490e23fa65..007310af377 100644 --- a/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java +++ b/java/com.sap.sailing.server/src/com/sap/sailing/server/impl/RemoteSailingServerSet.java @@ -1,5 +1,7 @@ package com.sap.sailing.server.impl; +import static com.sap.sse.common.HttpRequestHeaderConstants.HEADER_FORWARD_TO_REPLICA; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -357,9 +359,10 @@ public class RemoteSailingServerSet { formParams.append("&pred=" + (ref.isInclude() ? "incl" : "excl")); } HttpURLConnection urlConnection = (HttpURLConnection) HttpUrlConnectionHelper.redirectConnection(url, - Duration.ONE_SECOND.times(1000), "POST", (connection) -> connection - .setRequestProperty("Content-Type", "application/x-www-form-urlencoded"), - Optional.of(outputStream -> { + Duration.ONE_SECOND.times(1000), "POST", (connection) -> { + connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + connection.setRequestProperty(HEADER_FORWARD_TO_REPLICA.getA(), HEADER_FORWARD_TO_REPLICA.getB()); + }, Optional.of(outputStream -> { try (OutputStreamWriter writer = new OutputStreamWriter(outputStream, "utf-8")) { writer.write(formParams.toString()); } From fdb6f0fe3fd417e77c05ecb0421fb2e54b375f3d Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Fri, 4 Dec 2020 11:41:29 +0100 Subject: [PATCH 22/30] fixed capitalization and app name for Sail Insight powered by SAP --- .../com/sap/sailing/gwt/ui/client/StringMessages.properties | 4 ++-- .../sap/sailing/gwt/ui/client/StringMessages_de.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties index d3ffe110ab0..1dd1e9d95bf 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages.properties @@ -1766,7 +1766,7 @@ sapSailInSight=Sail Insight powered by SAP contentSapSailInSight=With the Sail Insight App powered by SAP, sailboat racers can join, set up and manage the GPS tracking for regattas of various formats easier than ever before. One design, as well as single number handicap regattas, are currently supported with ORC Performance Curve Scoring (PCS) coming soon. The mobile app connects to the SAP Sailing Analytics cloud solution that empowers sailors, coaches and fans to analyze their performance with a rich and unparalleled set of features. sapSailInSightReadMore=Learn More sapSailingBuoyPinger=SAP Sailing Buoy Pinger -contentSapSailingBuoyPinger=With the SAP Sailing Buoy Pinger mobile app for Android phones, sailboat race managers can simplify the positioning of race marks and communication with the mark layers anywhere and anytime. This app connects to the SAP Sailing Analytics solution and allows regatta managers to track the geographical position of their race marks, enabling the use of the SAP Sail InSight mobile app by sailors participating in the regatta. +contentSapSailingBuoyPinger=With the SAP Sailing Buoy Pinger mobile app for Android phones, sailboat race managers can simplify the positioning of race marks and communication with the mark layers anywhere and anytime. This app connects to the SAP Sailing Analytics solution and allows regatta managers to track the geographical position of their race marks, enabling the use of the SAP Sail Insight powered by SAP mobile app by sailors participating in the regatta. sapSailingBuoyPingerReadMore=Learn More strategySimulator=Strategy Simulator contentStrategySimulator=Choosing the right strategy can provide great competitive advantage during a race. The Strategy Simulator simplifies determining the best sailing strategy for various wind conditions and water currents. Since wind and current can be changed in the simulation right away, the robustness of a strategy can be easily evaluated even for uncertain weather conditions. @@ -2253,7 +2253,7 @@ serverIsPublicButTenantIsNot=This server is configured as public, your current t serverIsPublicButTenantIsNotAndCouldBeChanged=This server is configured as public, your current tenant is not the server ones. Objects created by you will not be public without further server configuration. Should we change the default tenant for you? copyMembersAndRoles=Copy members and roles invalidSecret=Invalid Secret -warningSailInsightVersion=The server is configured for use with SAP Sail Insight 1. Open regattas are only supported in SAP Sail Insight 2. This can cause problems in use +warningSailInsightVersion=The server is configured for use with SAP Sail InSight 1. Open regattas are only supported in the new app Sail Insight powered by SAP. This can cause problems in use invalidState=Invalid state doYouReallyWantToRemoveDeviceConfiguration=Do you really want to remove device configuration {0}? errorFetchingSimulationData=An Error occured while fetching simulation data: {0}. Please ensure you are signed in with your user account. diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties index ba5f10ad099..2ecccbe57c0 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/client/StringMessages_de.properties @@ -1750,7 +1750,7 @@ sapSailInSight=Sail Insight powered by SAP contentSapSailInSight=Mit der Sail Insight App powered by SAP können Regattasegler jetzt einfacher denn je am GPS-Tracking von Regatten verschiedener Formate teilnehmen sowie selbst Regatten zum Tracken anlegen und verwalten. Es werden Regatten in Einheitsklassen sowie verschiedenen Handicap-Varianten unterstützt, wobei ORC Performance Curve Scoring (PCS) bald angeboten werden wird. Die App nutzt die SAP Sailing Analytics Cloud-Lösung, die Segler, Trainer und Fans gleichermaßen in die Lage versetzt, informative und umfassende Performance-Analysen durchzuführen. sapSailInSightReadMore=Learn More sapSailingBuoyPinger=SAP Sailing Buoy Pinger -contentSapSailingBuoyPinger=Mit der SAP Sailing Buoy Pinger App für Android Telefone, können Wettfahrtleiter die Auslage der Kursmarken sowie die Kommunikation mit den Tonnenlegern vereinfachen – überall und jederzeit. Diese App verbindet sich mit der SAP Sailing Analytics Lösung und ermöglicht Wettfahrtleitern die geografische Position ihrer Kursmarken zu erfassen. Dies ermöglicht es teilnehmenden Seglern die SAP Sail InSight App bei einer Regatta zu verwenden. +contentSapSailingBuoyPinger=Mit der SAP Sailing Buoy Pinger App für Android Telefone, können Wettfahrtleiter die Auslage der Kursmarken sowie die Kommunikation mit den Tonnenlegern vereinfachen – überall und jederzeit. Diese App verbindet sich mit der SAP Sailing Analytics Lösung und ermöglicht Wettfahrtleitern die geografische Position ihrer Kursmarken zu erfassen. Dies ermöglicht es teilnehmenden Seglern die App Sail Insight powered by SAP bei einer Regatta zu verwenden. sapSailingBuoyPingerReadMore=Learn More strategySimulator=Strategie-Simulator contentStrategySimulator=Während eines Rennens hängt viel von der Wahl der richtigen Strategie ab. Der Strategie-Simulator vereinfacht die Ermittlung der besten Segelstrategie für diverse Wind- und Strömungsbedingungen. Da Wind und Strömung sofort in der Simulation geändert werden können, lässt sich die Robustheit einer Strategie selbst für unsichere Wetterbedingungen problemlos bewerten. @@ -2247,7 +2247,7 @@ serverIsPublicButTenantIsNot=Der Server ist als öffentlicher Server konfigurier serverIsPublicButTenantIsNotAndCouldBeChanged=Der Server ist als öffentlicher Server konfiguriert, aber der derzeit ausgewählte Tenant enspricht nicht dem Standard-Tenant des Servers. Erstellte Objekte sind somit nicht öffentlich sichtbar wenn keine weiteren Servereinstellungen vorgenommen wurden. Soll dieser Tenant jetzt automatisch gewechselt werden? copyMembersAndRoles=Mitglieder und Rollen kopieren invalidSecret=Ungültiges Secret -warningSailInsightVersion=Der Server ist nur für die Verwendung in Kombination mit SAP Sail Insight 1 konfiguriert. Offene Regatten werden erst ab SAP Sail Insight 2 unterstützt. Dadurch kann es bei der Verwendung zu Problemen kommen. +warningSailInsightVersion=Der Server ist nur für die Verwendung in Kombination mit SAP Sail InSight 1 konfiguriert. Offene Regatten werden erst ab der neuen App Sail Insight powered by SAP unterstützt. Dadurch kann es bei der Verwendung zu Problemen kommen. invalidState=Ungültiger Zustand doYouReallyWantToRemoveDeviceConfiguration=Möchten Sie die Gerätekonfiguration {0} wirklich entfernen? errorFetchingSimulationData=Ein Fehler ist beim Abrufen der Simulationsdaten aufgetreten: {0}. Bitte stelle sicher, dass Du an Deinem Benutzerkonto angemeldet bist. From 08517d4dffa46ad16a205de032726c13097379e2 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Fri, 4 Dec 2020 12:24:44 +0100 Subject: [PATCH 23/30] re-adjusted launch-mongodb-replica.sh script to eu-west-1 constants for AMI and security group ID --- configuration/aws-automation/launch-mongodb-replica.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configuration/aws-automation/launch-mongodb-replica.sh b/configuration/aws-automation/launch-mongodb-replica.sh index 4fef4109679..3107047e8d7 100755 --- a/configuration/aws-automation/launch-mongodb-replica.sh +++ b/configuration/aws-automation/launch-mongodb-replica.sh @@ -14,13 +14,13 @@ AVAILABILITY_ZONE=eu-west-1c INSTANCE_TYPE=i3.xlarge # eu-west-1: -#IMAGE_ID=ami-080cce167279f643c +IMAGE_ID=ami-080cce167279f643c # eu-west-2: -IMAGE_ID=ami-0c0907685eae2dbab +#IMAGE_ID=ami-0c0907685eae2dbab # eu-west-1: -#SECURITY_GROUP_ID=sg-0a9bc2fb61f10a342 +SECURITY_GROUP_ID=sg-0a9bc2fb61f10a342 # eu-west-2: -SECURITY_GROUP_ID=sg-02649c35a73ee0ae5 +#SECURITY_GROUP_ID=sg-02649c35a73ee0ae5 KEY_NAME=Axel REPLICA_SET_NAME= REPLICA_SET_PRIMARY= From b537ea97e43526e44673df1c24f9b6eb12290cc1 Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Mon, 7 Dec 2020 09:05:24 +0100 Subject: [PATCH 24/30] Removing empty lines --- .../server/gateway/jaxrs/api/TrackedRaceListResource.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java index b48aa6af701..346391ad6f2 100644 --- a/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java +++ b/java/com.sap.sailing.server.gateway/src/com/sap/sailing/server/gateway/jaxrs/api/TrackedRaceListResource.java @@ -159,7 +159,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { .flatMap(races->races.stream()) .sorted((o1,o2)->o1.getStartOfRace().compareTo(o2.getStartOfRace())) .collect(Collectors.toList()); - for (int i = 0; i < sorted.size(); i++) { SimpleRaceInfo current = sorted.get(i); JSONObject raceInfo = new JSONObject(); @@ -174,7 +173,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { private Map> getDistinctRaces(boolean includeRemotes, Predicate eventListFilter) { final Map> distinctRaces = getService().getLocalRaceList(eventListFilter); - if (includeRemotes) { getService().getRemoteRaceList(eventListFilter).forEach((identifier, simpleRaceInfoSet) -> distinctRaces.compute(identifier, (key, valueSet) -> { Set mergedSet; @@ -188,7 +186,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource { return mergedSet; })); } - return distinctRaces; } From e06009e91ad190c48c533b00ae215fe216bb2173 Mon Sep 17 00:00:00 2001 From: Georg Herdt Date: Mon, 7 Dec 2020 12:23:14 +0100 Subject: [PATCH 25/30] update launchers: add -DAnniversaryRaceDeterminator.enabled=true launchers are reformatted by eclipse 2020-09 bug 5011 --- .../GWT Dashboards DevMode.launch | 94 ++-- .../GWT Dashboards SDM.launch | 104 ++-- .../GWT Sailing DevMode.launch | 236 ++++----- .../GWT Sailing SDM.launch | 240 +++++----- .../SailingServer (No Proxy OSX).launch | 442 +++++++++-------- .../SailingServer (No Proxy).launch | 446 +++++++++--------- ...ailingServer (No Proxy, Cached MTB).launch | 440 +++++++++-------- ...erver (No Proxy, Igtimi Local Test).launch | 446 +++++++++--------- .../SailingServer (No Proxy, Java11).launch | 446 +++++++++--------- ...r (No Proxy, Java11, JFR Recording).launch | 446 +++++++++--------- ...ingServer (No Proxy, Jetty on 8889).launch | 430 +++++++++-------- ...o Proxy, Jetty on 8889, Cached MTB).launch | 430 +++++++++-------- ...on 8889, auto-replicate SS and SSD).launch | 434 +++++++++-------- ... Jetty on 8889, auto-replicate dev).launch | 430 +++++++++-------- ...oxy, Jetty on 8889, auto-replicate).launch | 434 +++++++++-------- ...ingServer (No Proxy, Jetty on 8890).launch | 430 +++++++++-------- ...uto-replicate from replica at 8889).launch | 430 +++++++++-------- ...ver (No Proxy, Remote Debug SAP VM).launch | 428 +++++++++-------- ...ver (No Proxy, bundesliga2-2017 DB).launch | 446 +++++++++--------- ...erver (No Proxy, debranding active).launch | 446 +++++++++--------- ...ailingServer (No Proxy, winddbTest).launch | 445 +++++++++-------- ...& Wind estimation Import from 8888).launch | 2 +- .../GWT xdStorage Sample SDM.launch | 110 ++--- .../GWT Security DevMode.launch | 214 ++++----- .../GWT Security SDM.launch | 214 ++++----- 25 files changed, 4280 insertions(+), 4383 deletions(-) diff --git a/java/com.sap.sailing.dashboards.gwt/GWT Dashboards DevMode.launch b/java/com.sap.sailing.dashboards.gwt/GWT Dashboards DevMode.launch index 82541c2b777..f930818bbb8 100644 --- a/java/com.sap.sailing.dashboards.gwt/GWT Dashboards DevMode.launch +++ b/java/com.sap.sailing.dashboards.gwt/GWT Dashboards DevMode.launch @@ -1,50 +1,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.dashboards.gwt/GWT Dashboards SDM.launch b/java/com.sap.sailing.dashboards.gwt/GWT Dashboards SDM.launch index 0e40747c87a..e33710bdb91 100644 --- a/java/com.sap.sailing.dashboards.gwt/GWT Dashboards SDM.launch +++ b/java/com.sap.sailing.dashboards.gwt/GWT Dashboards SDM.launch @@ -1,55 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.gwt.ui/GWT Sailing DevMode.launch b/java/com.sap.sailing.gwt.ui/GWT Sailing DevMode.launch index 574d3bbb77c..964428b8c6e 100644 --- a/java/com.sap.sailing.gwt.ui/GWT Sailing DevMode.launch +++ b/java/com.sap.sailing.gwt.ui/GWT Sailing DevMode.launch @@ -1,121 +1,121 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.gwt.ui/GWT Sailing SDM.launch b/java/com.sap.sailing.gwt.ui/GWT Sailing SDM.launch index 682a0020893..5b35cae4b7d 100755 --- a/java/com.sap.sailing.gwt.ui/GWT Sailing SDM.launch +++ b/java/com.sap.sailing.gwt.ui/GWT Sailing SDM.launch @@ -1,123 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch b/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch index 36896b1c955..e3aa7100cb5 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy OSX).launch @@ -1,227 +1,221 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy).launch b/java/com.sap.sailing.server/SailingServer (No Proxy).launch index eb700251fda..3fab63887c5 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch index d1d81891fbe..f5a9a3e7fc4 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Cached MTB).launch @@ -1,226 +1,220 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch index fd80d49fd39..f0d181d4f51 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Igtimi Local Test).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch index 8ba556e2ddd..c619332c7f9 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch index 56cf3b96c5b..0a7511da08e 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Java11, JFR Recording).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch index 399bab2ac27..8e0653b1d32 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889).launch @@ -1,221 +1,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch index d8b7d1cec7c..06564b33181 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, Cached MTB).launch @@ -1,221 +1,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch index b1e7523664f..75d374286f9 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate SS and SSD).launch @@ -1,223 +1,217 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch index c0c50e8c530..a3644830f04 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate dev).launch @@ -1,221 +1,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch index 09af1bb46de..44ce94ecc42 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8889, auto-replicate).launch @@ -1,223 +1,217 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch index 5fe6bade976..5765813fb8c 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890).launch @@ -1,221 +1,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch index ba1a644b22d..927fc76dea2 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Jetty on 8890, auto-replicate from replica at 8889).launch @@ -1,221 +1,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch index 1981652dc99..52c5dbb8dce 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, Remote Debug SAP VM).launch @@ -1,220 +1,214 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch index 7a48c529ec1..66115757074 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, bundesliga2-2017 DB).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch index 954fea74bb2..8158d02bc8b 100644 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, debranding active).launch @@ -1,229 +1,223 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch b/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch index b87ca72d32b..6a78977d23e 100755 --- a/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch +++ b/java/com.sap.sailing.server/SailingServer (No Proxy, winddbTest).launch @@ -1,229 +1,222 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch index e77cc21380f..5d16844626a 100755 --- a/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch +++ b/java/com.sap.sailing.server/SailingServer (Proxy, Jetty on 8889, Polar & Wind estimation Import from 8888).launch @@ -20,7 +20,7 @@ - + diff --git a/java/com.sap.sse.gwt/GWT xdStorage Sample SDM.launch b/java/com.sap.sse.gwt/GWT xdStorage Sample SDM.launch index bac183e2b41..7575c54ca54 100755 --- a/java/com.sap.sse.gwt/GWT xdStorage Sample SDM.launch +++ b/java/com.sap.sse.gwt/GWT xdStorage Sample SDM.launch @@ -1,58 +1,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sse.security.ui/GWT Security DevMode.launch b/java/com.sap.sse.security.ui/GWT Security DevMode.launch index 49029705c6b..26167ca2c75 100644 --- a/java/com.sap.sse.security.ui/GWT Security DevMode.launch +++ b/java/com.sap.sse.security.ui/GWT Security DevMode.launch @@ -1,110 +1,110 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sse.security.ui/GWT Security SDM.launch b/java/com.sap.sse.security.ui/GWT Security SDM.launch index 4f60c5aba90..2a6c03b2601 100755 --- a/java/com.sap.sse.security.ui/GWT Security SDM.launch +++ b/java/com.sap.sse.security.ui/GWT Security SDM.launch @@ -1,110 +1,110 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d1107c5c21db967a88eac8a5619435d67ebc3b80 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Mon, 7 Dec 2020 13:10:01 +0100 Subject: [PATCH 26/30] updated Javadoc in ORCPerformanceCurveImpl --- .../sap/sailing/domain/orc/impl/ORCPerformanceCurveImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPerformanceCurveImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPerformanceCurveImpl.java index 709b7fbae52..54456862a4a 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPerformanceCurveImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/orc/impl/ORCPerformanceCurveImpl.java @@ -70,8 +70,8 @@ public class ORCPerformanceCurveImpl implements Serializable, ORCPerformanceCurv /** * This PolynomialSplineFunction is created with the array of course specific allowances for the boat which this * ORCPerformanceCurve belongs to. This function contains subfunctions for each interval between two given - * calculated points. The input for the function is the value of the implied wind (speed in kts) and the output an - * allowance in sec/nm. + * calculated points. The input for the function is the implied wind speed in knots and the output the expected + * average speed over ground in knots. */ private final UnivariateDifferentiableFunction functionImpliedWindInKnotsToAverageSpeedInKnotsForCourse; From 00c9019239c758c80b8c0e44108fc7088840a855 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Tue, 8 Dec 2020 16:51:14 +0100 Subject: [PATCH 27/30] avoid NPEs when MarkProperties have null as their tags collection --- .../serialization/impl/CourseTemplateJsonSerializer.java | 4 +++- .../impl/FreestyleMarkPropertiesJsonSerializer.java | 6 ++++-- .../serialization/impl/MarkPropertiesJsonSerializer.java | 3 --- .../impl/CourseAndMarkConfigurationFactoryImpl.java | 2 +- .../shared/persistence/impl/MongoObjectFactoryImpl.java | 8 ++++++-- java/target/env.sh | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/CourseTemplateJsonSerializer.java b/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/CourseTemplateJsonSerializer.java index 2f9515af2ab..16a8155d6d6 100644 --- a/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/CourseTemplateJsonSerializer.java +++ b/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/CourseTemplateJsonSerializer.java @@ -48,7 +48,9 @@ public class CourseTemplateJsonSerializer implements JsonSerializer { diff --git a/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/FreestyleMarkPropertiesJsonSerializer.java b/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/FreestyleMarkPropertiesJsonSerializer.java index 205dd50b274..7a17aba3f99 100644 --- a/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/FreestyleMarkPropertiesJsonSerializer.java +++ b/java/com.sap.sailing.server.gateway.serialization/src/com/sap/sailing/server/gateway/serialization/impl/FreestyleMarkPropertiesJsonSerializer.java @@ -20,8 +20,10 @@ public class FreestyleMarkPropertiesJsonSerializer implements JsonSerializer tags = Collections.emptySet(); if (effectiveProperties instanceof FreestyleMarkProperties) { tags = ((FreestyleMarkProperties) effectiveProperties).getTags(); - }else { + } else { tags = Collections.emptySet(); } // If no mark properties exist yet, a new one is created diff --git a/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/MongoObjectFactoryImpl.java b/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/MongoObjectFactoryImpl.java index 4f90dfe4ff3..aa36c664ffc 100644 --- a/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/MongoObjectFactoryImpl.java +++ b/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/MongoObjectFactoryImpl.java @@ -101,7 +101,9 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory { }); } BasicDBList tags = new BasicDBList(); - markProperties.getTags().forEach(tags::add); + if (markProperties.getTags() != null) { + markProperties.getTags().forEach(tags::add); + } result.put(FieldNames.MARK_PROPERTIES_TAGS.name(), tags); Map lastUsedTemplateMap = markProperties.getLastUsedMarkTemplate().entrySet().stream() .collect(Collectors.toMap(k -> k.getKey().getId().toString(), v -> v.getValue().asMillis())); @@ -261,7 +263,9 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory { result.put(FieldNames.COURSE_TEMPLATE_WAYPOINTS.name(), waypointTemplates); // tags final BasicDBList tags = new BasicDBList(); - courseTemplate.getTags().forEach(tags::add); + if (courseTemplate.getTags() != null) { + courseTemplate.getTags().forEach(tags::add); + } result.put(FieldNames.COURSE_TEMPLATE_TAGS.name(), tags); // repeatable part if (courseTemplate.hasRepeatablePart()) { diff --git a/java/target/env.sh b/java/target/env.sh index 34b998fcae2..8843747aa62 100755 --- a/java/target/env.sh +++ b/java/target/env.sh @@ -62,7 +62,7 @@ fi # same channel the master is using in its REPLICATION_CHANNEL variable if [ -n "$AUTO_REPLICATE" ]; then - REPLICATE_ON_START=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl,com.sap.sailing.polars.impl.PolarDataServiceImpl,com.sap.sailing.domain.racelogtracking.impl.fixtracker.RegattaLogFixTrackerRegattaListener,com.sap.sailing.windestimation.integration.WindEstimationFactoryServiceImpl,com.sap.sailing.server.impl.com.sap.sailing.shared.server.impl.SharedSailingDataImpl + REPLICATE_ON_START=com.sap.sailing.server.impl.RacingEventServiceImpl,com.sap.sse.security.impl.SecurityServiceImpl,com.sap.sse.filestorage.impl.FileStorageManagementServiceImpl,com.sap.sse.mail.impl.MailServiceImpl,com.sap.sailing.polars.impl.PolarDataServiceImpl,com.sap.sailing.domain.racelogtracking.impl.fixtracker.RegattaLogFixTrackerRegattaListener,com.sap.sailing.windestimation.integration.WindEstimationFactoryServiceImpl,com.sap.sailing.shared.server.impl.SharedSailingDataImpl fi # Host where the master Java instance is running # Make sure firewall configurations allow access From 2ef2589e590628833610750e12e687ed46cfae03 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Tue, 8 Dec 2020 18:04:59 +0100 Subject: [PATCH 28/30] made loading of tags for MarkProperties safe against null values in DB --- .../shared/persistence/impl/DomainObjectFactoryImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/DomainObjectFactoryImpl.java b/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/DomainObjectFactoryImpl.java index bcef5a1e684..918d028ee35 100755 --- a/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/DomainObjectFactoryImpl.java +++ b/java/com.sap.sailing.shared.persistence/src/com/sap/sailing/shared/persistence/impl/DomainObjectFactoryImpl.java @@ -4,6 +4,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -113,7 +114,7 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory { final Document positionDocument = dbObject.get(FieldNames.MARK_PROPERTIES_FIXED_POSITION.name(), Document.class); final Position fixedPosition = positionDocument == null ? null : loadPosition(positionDocument); final ArrayList tagsList = dbObject.get(FieldNames.MARK_PROPERTIES_TAGS.name(), ArrayList.class); - final Collection tags = tagsList.stream().map(t -> t.toString()).collect(Collectors.toList()); + final Collection tags = tagsList == null ? Collections.emptyList() : tagsList.stream().map(t -> t.toString()).collect(Collectors.toList()); // all mandatory data are loaded -> create builder final MarkPropertiesBuilder builder = new MarkPropertiesBuilder(id, name, shortName, color, shape, pattern, markType).withTags(tags); if (fixedPosition != null) { From 080552372b3c2e84ed604a6d07418f3904e56c06 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Thu, 10 Dec 2020 00:29:56 +0100 Subject: [PATCH 29/30] bug5454: setting userGroupProvider on UserImpl to local UserStoreImpl when migrating from de-serialized UserStoreImpl to local store --- .../src/com/sap/sse/security/interfaces/UserStore.java | 4 +++- .../sap/sse/security/userstore/mongodb/UserStoreImpl.java | 3 ++- .../src/com/sap/sse/security/impl/SecurityServiceImpl.java | 4 ++-- .../com/sap/sse/security/jaxrs/api/UserGroupResource.java | 5 ----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/java/com.sap.sse.security.interface/src/com/sap/sse/security/interfaces/UserStore.java b/java/com.sap.sse.security.interface/src/com/sap/sse/security/interfaces/UserStore.java index 120dd46ba9b..9c45d8352c5 100644 --- a/java/com.sap.sse.security.interface/src/com/sap/sse/security/interfaces/UserStore.java +++ b/java/com.sap.sse.security.interface/src/com/sap/sse/security/interfaces/UserStore.java @@ -82,7 +82,9 @@ public interface UserStore extends BasicUserStore { /** * Replaces all existing contents by those provided by the newUserStore. This has no impact on the persistent - * representation of this store and is meant for use on a replica only; the replica's database state is undefined. + * representation of this store and is meant for use on a replica only; the replica's database state is undefined. For all + * {@link User} objects copied from {@code newUserStore} to this store, their {@link User#getUserGroupProvider()} field + * will be updated to point to this store. */ void replaceContentsFrom(UserStore newUserStore); diff --git a/java/com.sap.sse.security.userstore.mongodb/src/com/sap/sse/security/userstore/mongodb/UserStoreImpl.java b/java/com.sap.sse.security.userstore.mongodb/src/com/sap/sse/security/userstore/mongodb/UserStoreImpl.java index d49288ae5e9..4083ad367ed 100644 --- a/java/com.sap.sse.security.userstore.mongodb/src/com/sap/sse/security/userstore/mongodb/UserStoreImpl.java +++ b/java/com.sap.sse.security.userstore.mongodb/src/com/sap/sse/security/userstore/mongodb/UserStoreImpl.java @@ -490,7 +490,8 @@ public class UserStoreImpl implements UserStore { roleDefinitions.put(roleDefinition.getId(), roleDefinition); } LockUtil.executeWithWriteLock(preferenceLock, () -> { - for (User user : newUserStore.getUsers()) { + for (final User user : newUserStore.getUsers()) { + user.setUserGroupProvider(this); users.put(user.getName(), user); addToUsersByEmail(user); for (Entry userPref : newUserStore.getAllPreferences(user.getName()).entrySet()) { diff --git a/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java b/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java index 3b957681a53..8bcc255b854 100755 --- a/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java +++ b/java/com.sap.sse.security/src/com/sap/sse/security/impl/SecurityServiceImpl.java @@ -194,8 +194,8 @@ public class SecurityServiceImpl implements ReplicableSecurityService, ClearStat */ private final ReplicatingCacheManager cacheManager; - private UserStore store; - private AccessControlStore accessControlStore; + private final UserStore store; + private final AccessControlStore accessControlStore; private boolean isInitialOrMigration; private boolean isNewServer; diff --git a/java/com.sap.sse.security/src/com/sap/sse/security/jaxrs/api/UserGroupResource.java b/java/com.sap.sse.security/src/com/sap/sse/security/jaxrs/api/UserGroupResource.java index bfe35fc78bc..0ed5c359f78 100644 --- a/java/com.sap.sse.security/src/com/sap/sse/security/jaxrs/api/UserGroupResource.java +++ b/java/com.sap.sse.security/src/com/sap/sse/security/jaxrs/api/UserGroupResource.java @@ -146,7 +146,6 @@ public class UserGroupResource extends AbstractSecurityResource { final JSONObject jsonResult = new JSONObject(); jsonResult.put(KEY_GROUP_ID, usergroup.getId().toString()); jsonResult.put(KEY_GROUP_NAME, usergroup.getName()); - if (includingUsers) { final JSONArray jsonUsersInGroup = new JSONArray(); for (final User user : usergroup.getUsers()) { @@ -157,7 +156,6 @@ public class UserGroupResource extends AbstractSecurityResource { } jsonResult.put(KEY_USERS, jsonUsersInGroup); } - if (includingRoles) { final JSONArray jsonRolesOfGroup = new JSONArray(); for (final Map.Entry roleDefinition : usergroup.getRoleDefinitionMap() @@ -173,7 +171,6 @@ public class UserGroupResource extends AbstractSecurityResource { } jsonResult.put(KEY_ROLES, jsonRolesOfGroup); } - return jsonResult; } @@ -206,7 +203,6 @@ public class UserGroupResource extends AbstractSecurityResource { response = Response.status(Status.CREATED).entity(streamingOutput(convertUserGroupToJson(group, /* includingUsers */ true, /* includingRoles */ true))).build(); } } - return response; } @@ -270,7 +266,6 @@ public class UserGroupResource extends AbstractSecurityResource { } else { response = Response.status(Status.UNAUTHORIZED).build(); } - } } else { response = Response.status(Status.UNAUTHORIZED).build(); From 79324852ab69ae22a04649d225c44c6f07201245 Mon Sep 17 00:00:00 2001 From: Axel Uhl Date: Thu, 10 Dec 2020 00:34:25 +0100 Subject: [PATCH 30/30] bug5454: updated release notes --- java/com.sap.sailing.www/release_notes_admin.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/com.sap.sailing.www/release_notes_admin.html b/java/com.sap.sailing.www/release_notes_admin.html index f66ae0fd31b..d5ec585518f 100755 --- a/java/com.sap.sailing.www/release_notes_admin.html +++ b/java/com.sap.sailing.www/release_notes_admin.html @@ -23,6 +23,11 @@

      Release Notes - Administration Console

      +

      December 2020

      +
        +
      • On replicas, user group memberships did not always update correctly, due to a reference to a stale + user store received with the initial load when replication starts up. This problem has been fixed now.
      • +

      November 2020

      • Anniversary calculation must now be turned on explicitly. Set system property
        -DAnniversaryRaceDeterminator.enabled=true
        at startup. Otherwise no anniversary is calculated.