Merge branch 'master' of ssh://sapsailing.com/home/trac/git

This commit is contained in:
Generic Wiki User
2020-10-13 13:30:02 +00:00
4 changed files with 6 additions and 12 deletions
@@ -42,12 +42,10 @@ public class ExpeditionWindMeasureStatusGetServlet extends SailingServerHttpServ
@Override @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
if(!isExpeditionListenerRegistered) { if (!isExpeditionListenerRegistered) {
isExpeditionListenerRegistered = registerExpeditionListener(); isExpeditionListenerRegistered = registerExpeditionListener();
} }
resp.setContentType("text/html"); resp.setContentType("text/html");
PrintWriter out = resp.getWriter(); PrintWriter out = resp.getWriter();
out.println("<html>"); out.println("<html>");
out.println("<head>"); out.println("<head>");
@@ -56,17 +54,16 @@ public class ExpeditionWindMeasureStatusGetServlet extends SailingServerHttpServ
out.println("<body>"); out.println("<body>");
out.println("<h3>Expedition Wind Status</h3>"); out.println("<h3>Expedition Wind Status</h3>");
out.println("<input type='button' value='Refresh' onClick='window.location.reload()'><br/>"); out.println("<input type='button' value='Refresh' onClick='window.location.reload()'><br/>");
if (lastMessageInfosPerBoat.size() > 0) {
if(lastMessageInfosPerBoat.size() > 0) {
Date now = new Date(); Date now = new Date();
List<Integer> messagesToDrop = new ArrayList<Integer>(); List<Integer> messagesToDrop = new ArrayList<Integer>();
for(ExpeditionMessageInfo info: lastMessageInfosPerBoat.values()) { for (ExpeditionMessageInfo info: lastMessageInfosPerBoat.values()) {
out.println("Boat-No:" + "&nbsp;" + info.boatID); out.println("Boat-No:" + "&nbsp;" + info.boatID);
out.println("<br/>"); out.println("<br/>");
long timeSinceLastMessageInMs = now.getTime() - info.messageReceivedAt.getTime(); long timeSinceLastMessageInMs = now.getTime() - info.messageReceivedAt.getTime();
if(timeSinceLastMessageInMs > MAX_TIME_SINCE_LAST_MESSAGE) { if (timeSinceLastMessageInMs > MAX_TIME_SINCE_LAST_MESSAGE) {
messagesToDrop.add(info.boatID); messagesToDrop.add(info.boatID);
} else if(timeSinceLastMessageInMs > MIN_TIME_SINCE_LAST_MESSAGE) { } else if (timeSinceLastMessageInMs > MIN_TIME_SINCE_LAST_MESSAGE) {
long hours = TimeUnit.MILLISECONDS.toHours(timeSinceLastMessageInMs); long hours = TimeUnit.MILLISECONDS.toHours(timeSinceLastMessageInMs);
long minutes = TimeUnit.MILLISECONDS.toMinutes(timeSinceLastMessageInMs) - TimeUnit.HOURS.toMinutes(hours); long minutes = TimeUnit.MILLISECONDS.toMinutes(timeSinceLastMessageInMs) - TimeUnit.HOURS.toMinutes(hours);
long seconds = TimeUnit.MILLISECONDS.toSeconds(timeSinceLastMessageInMs) - (TimeUnit.MINUTES.toSeconds(minutes) + TimeUnit.HOURS.toSeconds(hours)); long seconds = TimeUnit.MILLISECONDS.toSeconds(timeSinceLastMessageInMs) - (TimeUnit.MINUTES.toSeconds(minutes) + TimeUnit.HOURS.toSeconds(hours));
@@ -90,7 +87,6 @@ public class ExpeditionWindMeasureStatusGetServlet extends SailingServerHttpServ
} else { } else {
out.println("No expedition wind sources available."); out.println("No expedition wind sources available.");
} }
out.println("</body>"); out.println("</body>");
out.println("</html>"); out.println("</html>");
out.close(); out.close();
@@ -66,7 +66,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource {
public Response raceList(@QueryParam("transitive") Boolean transitive) { public Response raceList(@QueryParam("transitive") Boolean transitive) {
final boolean includeRemotes = transitive != null && Boolean.TRUE.equals(transitive); final boolean includeRemotes = transitive != null && Boolean.TRUE.equals(transitive);
final Map<RegattaAndRaceIdentifier, SimpleRaceInfo> distinctRaces = getDistinctRaces(includeRemotes); final Map<RegattaAndRaceIdentifier, SimpleRaceInfo> distinctRaces = getDistinctRaces(includeRemotes);
final HashMap<String, List<SimpleRaceInfo>> raceData = new HashMap<>(); final HashMap<String, List<SimpleRaceInfo>> raceData = new HashMap<>();
distinctRaces.values().forEach(raceInfo -> { distinctRaces.values().forEach(raceInfo -> {
final String remoteUrl = raceInfo.getRemoteUrl() == null ? null : raceInfo.getRemoteUrl().toExternalForm(); final String remoteUrl = raceInfo.getRemoteUrl() == null ? null : raceInfo.getRemoteUrl().toExternalForm();
@@ -76,7 +75,6 @@ public class TrackedRaceListResource extends AbstractSailingServerResource {
} }
remoteList.add(raceInfo); remoteList.add(raceInfo);
}); });
final JSONArray json = new JSONArray(); final JSONArray json = new JSONArray();
for (Entry<String, List<SimpleRaceInfo>> raced : raceData.entrySet()) { for (Entry<String, List<SimpleRaceInfo>> raced : raceData.entrySet()) {
JSONArray list = new JSONArray(); JSONArray list = new JSONArray();
@@ -1 +1 @@
See http://wiki.sapsailing.com/wiki/info/landscape/typical-development-scenarios#typical-development-scenarios_adding-a-bundle-to-the-target-platform See https://wiki.sapsailing.com/wiki/info/landscape/typical-development-scenarios#typical-development-scenarios_adding-a-bundle-to-the-target-platform