diff --git a/home.md b/home.md index a0157e89af4..3c852e42595 100644 --- a/home.md +++ b/home.md @@ -19,6 +19,7 @@ Like businesses, sailors need the latest information to make strategic decisions * [[Cook Book|wiki/cook-book]] * [[Planning|wiki/planning]] * Event Specifica + * [[General Planning|wiki/general-event-planning]] * [[Extreme Sailing Series|wiki/extreme-sailing-series]] ### Internal services (not related to wiki but useful) diff --git a/java/com.sap.sailing.domain.swisstimingadapter.persistence/src/com/sap/sailing/domain/swisstimingadapter/persistence/StoreAndForward.java b/java/com.sap.sailing.domain.swisstimingadapter.persistence/src/com/sap/sailing/domain/swisstimingadapter/persistence/StoreAndForward.java index a9799c06fb6..1bd1d19b683 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter.persistence/src/com/sap/sailing/domain/swisstimingadapter/persistence/StoreAndForward.java +++ b/java/com.sap.sailing.domain.swisstimingadapter.persistence/src/com/sap/sailing/domain/swisstimingadapter/persistence/StoreAndForward.java @@ -7,7 +7,10 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.logging.Level; import java.util.logging.Logger; import com.mongodb.BasicDBObject; @@ -63,7 +66,7 @@ public class StoreAndForward implements Runnable { private final Thread storeAndForwardThread; - private Socket socket; + private final Set receivingThreads; /** * Use of this server socket is optional and happens if and only if this object is operated in @@ -85,6 +88,7 @@ public class StoreAndForward implements Runnable { */ public StoreAndForward(String sailMasterHostname, int sailMasterPort, int portForClients, SwissTimingFactory swissTimingFactory, SwissTimingAdapterPersistence swissTimingAdapterPersistence, MongoDBService mongoDBService) throws InterruptedException, IOException { + this.receivingThreads = new HashSet<>(); this.db = mongoDBService.getDB(); this.listenPort = -1; this.transceiver = swissTimingFactory.createSailMasterTransceiver(); @@ -125,6 +129,7 @@ public class StoreAndForward implements Runnable { */ public StoreAndForward(final int listenPort, final int portForClients, SwissTimingFactory swissTimingFactory, SwissTimingAdapterPersistence swissTimingAdapterPersistence, MongoDBService mongoDBService) throws InterruptedException, IOException { + this.receivingThreads = new HashSet<>(); this.db = mongoDBService.getDB(); this.listenPort = listenPort; this.transceiver = swissTimingFactory.createSailMasterTransceiver(); @@ -201,20 +206,29 @@ public class StoreAndForward implements Runnable { } /** - * Depending on the mode of operation, accepts an inbound connect from a SailMaster server / bridge or - * actively initiates a TCP connection to the SailMaster address/port configured. When this method - * returns, the {@link #socket} holds an open and connected socket. - * @throws IOException + * Depending on the mode of operation, accepts an inbound connect from a SailMaster server / bridge or actively + * initiates a TCP connection to the SailMaster address/port configured. When a connection has been established, a + * new {@link ReceivingThread} is spawned for the new socket. If in listening mode, the + * {@link ServerSocket#accept()} call is repeated until the instance is {@link #stop()}ed. + * + * @throws IOException */ - private void establishConnection() throws IOException { + private ReceivingThread establishConnection() throws IOException { + Socket socket; + ReceivingThread receivingThread = null; if (isInSailMasterListeningMode()) { - synchronized (this) { - receivingFromSailMaster = true; - logger.info("StoreAndForward waiting for inbound SailMaster connections on port "+listenPort); - notifyAll(); + while (!stopped) { + synchronized (this) { + receivingFromSailMaster = true; + logger.info("StoreAndForward waiting for inbound SailMaster connections on port " + listenPort); + notifyAll(); + } + socket = serverSocketListeningForSailMasterBridge.accept(); + logger.info("StoreAndForward received SailMaster connect on port " + listenPort); + receivingThread = new ReceivingThread("SwissTiming SailMaster ReceivingThread for "+socket, socket); + receivingThreads.add(receivingThread); + receivingThread.start(); } - socket = serverSocketListeningForSailMasterBridge.accept(); - logger.info("StoreAndForward received SailMaster connect on port "+listenPort); } else { synchronized (this) { receivingFromSailMaster = true; @@ -223,50 +237,33 @@ public class StoreAndForward implements Runnable { } socket = new Socket(sailMasterHostname, sailMasterPort); logger.info("StoreAndForward connections to SailMaster "+sailMasterHostname+":"+sailMasterPort+" established"); + receivingThread = new ReceivingThread("SwissTiming SailMaster ReceivingThread for "+socket, socket); + receivingThreads.add(receivingThread); + receivingThread.start(); } + return receivingThread; } - + /** - * Stops execution after having received the next message + * Does the actual receiving. Is initialized with the socket on which to receive. + * + * @author Axel Uhl (D043530) + * */ - public void stop() throws UnknownHostException, IOException, InterruptedException { - logger.entering(getClass().getName(), "stop"); - stopped = true; - Socket closer = new Socket("localhost", portForClients); // this is to stop the client listener thread - closer.close(); - logger.info("joining clientListener thread "+clientListener); - clientListener.join(); - socket.close(); // will let a read terminate abnormally - logger.info("joining storeAndForwardThread "+storeAndForwardThread); - storeAndForwardThread.join(); - } - - public static void main(String[] args) throws InterruptedException, IOException { - String hostname = null; - int i=0; - if (args[i].equals("-h")) { - hostname = args[++i]; - i++; - } - int sailMasterPort = Integer.valueOf(args[i++]); - int clientPort = Integer.valueOf(args[i++]); + private class ReceivingThread extends Thread { + private final Socket socket; + private boolean stopped; - MongoDBService mongoDBService = MongoDBService.INSTANCE; - mongoDBService.setConfiguration(MongoDBConfiguration.getDefaultConfiguration()); - SwissTimingAdapterPersistence swissTimingAdapterPersistence = SwissTimingAdapterPersistence.INSTANCE; - if (hostname == null) { - new StoreAndForward(sailMasterPort, clientPort, SwissTimingFactory.INSTANCE, swissTimingAdapterPersistence, mongoDBService); - } else { - new StoreAndForward(hostname, sailMasterPort, clientPort, SwissTimingFactory.INSTANCE, swissTimingAdapterPersistence, mongoDBService); + public ReceivingThread(String threadName, Socket socket) { + super(threadName); + this.socket = socket; } - } - public void run() { - logger.entering(getClass().getName(), "run"); - try { + @Override + public void run() { + logger.entering(getClass().getName(), "run"); while (!stopped) { try { - establishConnection(); InputStream is = socket.getInputStream(); Pair messageAndOptionalSequenceNumber = transceiver.receiveMessage(is); // ignore any sequence number contained in the message; we'll create our own @@ -274,7 +271,7 @@ public class StoreAndForward implements Runnable { DBObject incrementLastMessageCountQuery = new BasicDBObject(). append("$inc", new BasicDBObject().append(FieldNames.LAST_MESSAGE_COUNT.name(), 1)); while (!stopped && messageAndOptionalSequenceNumber != null) { - logger.fine("Received message: "+messageAndOptionalSequenceNumber.getA()); + logger.fine("Thread "+this+" received message: "+messageAndOptionalSequenceNumber.getA()); DBObject newCountRecord = lastMessageCountCollection.findAndModify(emptyQuery, incrementLastMessageCountQuery); lastMessageCount = ((newCountRecord == null) ? 0l : ((Number) newCountRecord.get(FieldNames.LAST_MESSAGE_COUNT.name())).longValue()); @@ -328,6 +325,76 @@ public class StoreAndForward implements Runnable { } } } + logger.exiting(getClass().getName(), "run"); + receivingThreads.remove(this); + } + + /** + * Stops execution after having received the next message + */ + public void stopReceiver() throws UnknownHostException, IOException, InterruptedException { + logger.entering(getClass().getName(), "stop"); + stopped = true; + logger.info("closing socket"); + socket.close(); // will let a read terminate abnormally + } + } + + /** + * Stops execution after having received the next message + */ + public void stop() throws UnknownHostException, IOException, InterruptedException { + logger.entering(getClass().getName(), "stop"); + stopped = true; + Socket closer = new Socket("localhost", portForClients); // this is to stop the client listener thread + closer.close(); + logger.info("joining clientListener thread "+clientListener); + clientListener.join(); + for (ReceivingThread receivingThread : receivingThreads) { + receivingThread.stopReceiver(); + logger.info("joining storeAndForwardThread "+storeAndForwardThread); + receivingThread.join(); + } + logger.info("StoreAndForward is closing receiving server socket"); + if (serverSocketListeningForSailMasterBridge != null && !serverSocketListeningForSailMasterBridge.isClosed()) { + serverSocketListeningForSailMasterBridge.close(); + } + logger.info("Stopping StoreAndForward server."); + } + + public static void main(String[] args) throws InterruptedException, IOException { + String hostname = null; + int i=0; + if (args[i].equals("-h")) { + hostname = args[++i]; + i++; + } + int sailMasterPort = Integer.valueOf(args[i++]); + int clientPort = Integer.valueOf(args[i++]); + + MongoDBService mongoDBService = MongoDBService.INSTANCE; + mongoDBService.setConfiguration(MongoDBConfiguration.getDefaultConfiguration()); + SwissTimingAdapterPersistence swissTimingAdapterPersistence = SwissTimingAdapterPersistence.INSTANCE; + if (hostname == null) { + new StoreAndForward(sailMasterPort, clientPort, SwissTimingFactory.INSTANCE, swissTimingAdapterPersistence, mongoDBService); + } else { + new StoreAndForward(hostname, sailMasterPort, clientPort, SwissTimingFactory.INSTANCE, swissTimingAdapterPersistence, mongoDBService); + } + } + + public void run() { + logger.entering(getClass().getName(), "run"); + try { + while (!stopped) { + try { + ReceivingThread receivingThread = establishConnection(); + if (!isInSailMasterListeningMode()) { + receivingThread.join(); // we're in active connecting mode; wait for thread to die, then trie again + } + } catch (Exception e) { + logger.log(Level.SEVERE, "Exception in StoreAndForward", e); + } + } logger.info("StoreAndForward is closing receiving server socket"); if (serverSocketListeningForSailMasterBridge != null && !serverSocketListeningForSailMasterBridge.isClosed()) { serverSocketListeningForSailMasterBridge.close(); diff --git a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterConnectorImpl.java b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterConnectorImpl.java index 6f8850a1e43..51654ffa27a 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterConnectorImpl.java +++ b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterConnectorImpl.java @@ -304,28 +304,33 @@ public class SailMasterConnectorImpl extends SailMasterTransceiverImpl implement blockingQueue.offer(message); } - protected void notifyListeners(SailMasterMessage message) throws ParseException { - switch (message.getType()) { - case RPD: - notifyListenersRPD(message); - break; - case RAC: - notifyListenersRAC(message); - break; - case CCG: - notifyListenersCCG(message); - break; - case STL: - notifyListenersSTL(message); - break; - case CAM: - notifyListenersCAM(message); - break; - case TMD: - notifyListenersTMD(message); - break; - default: - // ignore all other messages because there are no notification patterns for those + protected void notifyListeners(SailMasterMessage message) { + try { + switch (message.getType()) { + case RPD: + notifyListenersRPD(message); + break; + case RAC: + notifyListenersRAC(message); + break; + case CCG: + notifyListenersCCG(message); + break; + case STL: + notifyListenersSTL(message); + break; + case CAM: + notifyListenersCAM(message); + break; + case TMD: + notifyListenersTMD(message); + break; + default: + // ignore all other messages because there are no notification patterns for those + } + } catch (Exception e) { + // broken messages are ignored + logger.warning("Exception caught during parsing of message '" + message.getMessage() + "' : " + e.getMessage()); } } diff --git a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterLiveSimulatorConnectorImpl.java b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterLiveSimulatorConnectorImpl.java index bbfff8210f1..187fd08e464 100644 --- a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterLiveSimulatorConnectorImpl.java +++ b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterLiveSimulatorConnectorImpl.java @@ -42,7 +42,7 @@ public class SailMasterLiveSimulatorConnectorImpl extends SailMasterConnectorImp } @Override - protected void notifyListeners(SailMasterMessage message) throws ParseException { + protected void notifyListeners(SailMasterMessage message) { // we cache all messages here and deliver them with a different speed bufferedMessageList.add(message); } diff --git a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterTransceiverImpl.java b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterTransceiverImpl.java index 620f057e69e..a568fdf233c 100755 --- a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterTransceiverImpl.java +++ b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SailMasterTransceiverImpl.java @@ -35,6 +35,7 @@ public class SailMasterTransceiverImpl implements SailMasterTransceiver { public synchronized void sendMessage(SailMasterMessage message, OutputStream os) throws IOException { os.write(("" + message.getSequenceNumber()).getBytes()); sendMessage(message.getMessage(), os); + os.flush(); } /** diff --git a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SwissTimingRaceTrackerImpl.java b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SwissTimingRaceTrackerImpl.java index 3e9f14735c6..cedb529969a 100644 --- a/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SwissTimingRaceTrackerImpl.java +++ b/java/com.sap.sailing.domain.swisstimingadapter/src/com/sap/sailing/domain/swisstimingadapter/impl/SwissTimingRaceTrackerImpl.java @@ -13,7 +13,6 @@ import java.util.TreeMap; import java.util.logging.Level; import java.util.logging.Logger; - import com.sap.sailing.domain.base.BoatClass; import com.sap.sailing.domain.base.Competitor; import com.sap.sailing.domain.base.Mark; @@ -48,6 +47,7 @@ import com.sap.sailing.domain.tracking.MarkPassing; import com.sap.sailing.domain.tracking.RaceTracker; import com.sap.sailing.domain.tracking.RacesHandle; import com.sap.sailing.domain.tracking.TrackedRace; +import com.sap.sailing.domain.tracking.TrackedRaceStatus; import com.sap.sailing.domain.tracking.TrackedRegattaRegistry; import com.sap.sailing.domain.tracking.WindStore; import com.sap.sailing.domain.tracking.WindTrack; @@ -117,6 +117,10 @@ public class SwissTimingRaceTrackerImpl extends AbstractRaceTrackerImpl implemen @Override public void stop() throws MalformedURLException, IOException, InterruptedException { + if (isTrackedRaceStillReachable()) { + TrackedRaceStatus newStatus = new TrackedRaceStatusImpl(TrackedRaceStatusEnum.FINISHED, 1.0); + trackedRace.setStatus(newStatus); + } connector.removeSailMasterListener(raceID, this); } diff --git a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java index 8c99ac1bc6a..23058d83640 100755 --- a/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java +++ b/java/com.sap.sailing.domain/src/com/sap/sailing/domain/leaderboard/impl/AbstractSimpleLeaderboardImpl.java @@ -280,7 +280,7 @@ public abstract class AbstractSimpleLeaderboardImpl implements Leaderboard, Race /** * All competitors with non-null net points are added to the result which is then sorted by net points in ascending - * order. The fleet is the primary ordering criterion, followed by the net points. + * order. The fleet, if ordered, is the primary ordering criterion, followed by the net points. */ @Override public List getCompetitorsFromBestToWorst(final RaceColumn raceColumn, TimePoint timePoint) throws NoWindException { diff --git a/java/com.sap.sailing.expeditionconnector.test/src/com/sap/sailing/expeditionconnector/test/UDPExpeditionReceiverTest.java b/java/com.sap.sailing.expeditionconnector.test/src/com/sap/sailing/expeditionconnector/test/UDPExpeditionReceiverTest.java index 21d0dc2a942..c2d76a717a8 100755 --- a/java/com.sap.sailing.expeditionconnector.test/src/com/sap/sailing/expeditionconnector/test/UDPExpeditionReceiverTest.java +++ b/java/com.sap.sailing.expeditionconnector.test/src/com/sap/sailing/expeditionconnector/test/UDPExpeditionReceiverTest.java @@ -79,7 +79,8 @@ public class UDPExpeditionReceiverTest { "#0,9,320.0*05", "#0,9,320.0*05", "#0,1,7.700,2,-36.0,3,25.10,4,-49.5,5,19.41,6,271.5,9,321.0,12,1.07,50,327.3,146,40348.390058*10", - "#0,9,321.0*04" + "#0,9,321.0*04", + "#5,2,-163.2,3,0.00,13,305.8,39,2.0,48,39.500717,49,2.747750*X19" }; someValidWithFourInvalidLines = new String[] { diff --git a/java/com.sap.sailing.expeditionconnector/FromHttpToUdpMirror from test to 2010.launch b/java/com.sap.sailing.expeditionconnector/FromHttpToUdpMirror from test to 2010.launch new file mode 100755 index 00000000000..8d2b12d90a1 --- /dev/null +++ b/java/com.sap.sailing.expeditionconnector/FromHttpToUdpMirror from test to 2010.launch @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/UDPMirror.java b/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/UDPMirror.java index 5f36615cb71..b496ed626c8 100755 --- a/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/UDPMirror.java +++ b/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/UDPMirror.java @@ -13,7 +13,7 @@ import java.net.InetAddress; * @author Axel Uhl (d043530) * */ -public class UDPMirror implements Runnable { +public class UDPMirror { /** * @param args 0: the port to listen to; 2*i-1, 2*i for i>0: host/port to which to forward @@ -55,13 +55,6 @@ public class UDPMirror implements Runnable { } } - /** - * Listens for an inbound TCP connection - */ - public void run() { - - } - private static void usage() { System.out.println("Usage: java "+UDPMirror.class.getName()+" [-v] hostname1 port1 [hostname2 port2]*"); System.out.println(" -v\tPrint packets received to stdout"); diff --git a/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/impl/ExpeditionMessageParser.java b/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/impl/ExpeditionMessageParser.java index 4862696c8a4..2dc7a576d2d 100755 --- a/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/impl/ExpeditionMessageParser.java +++ b/java/com.sap.sailing.expeditionconnector/src/com/sap/sailing/expeditionconnector/impl/ExpeditionMessageParser.java @@ -3,6 +3,7 @@ package com.sap.sailing.expeditionconnector.impl; import java.net.DatagramPacket; import java.util.HashMap; import java.util.Map; +import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -13,6 +14,7 @@ import com.sap.sailing.expeditionconnector.UDPExpeditionReceiver; import com.sap.sailing.udpconnector.UDPMessageParser; public class ExpeditionMessageParser implements UDPMessageParser { + private static final Logger logger = Logger.getLogger(ExpeditionMessageParser.class.getName()); private UDPExpeditionReceiver receiver; @@ -25,7 +27,7 @@ public class ExpeditionMessageParser implements UDPMessageParser 0) { Pattern completeLinePattern = Pattern - .compile("#([0-9]*)(( *,([0-9][0-9]*) *, *(-?[0-9]*(\\.[0-9]*)?))*)\\*([0-9a-fA-F][0-9a-fA-F]*)"); + .compile("#([0-9]*)(( *,([0-9][0-9]*) *, *(-?[0-9]*(\\.[0-9]*)?))*)\\*X?([0-9a-fA-F][0-9a-fA-F]*)"); Matcher m = completeLinePattern.matcher(packetAsString); boolean valid = m.matches(); if (valid) { @@ -62,7 +64,7 @@ public class ExpeditionMessageParser implements UDPMessageParser posOfLastCharToAddToChecksum && packetAsString.charAt(posOfLastCharToAddToChecksum+1) == 'X') { + posOfLastCharToAddToChecksum++; + } + String checksumString = packetAsString.substring(0, posOfLastCharToAddToChecksum); + for (byte stringByte : checksumString.getBytes()) { b ^= stringByte; } return b == checksum; diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboardedit/MatchAndApplyScoreCorrectionsDialog.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboardedit/MatchAndApplyScoreCorrectionsDialog.java index 539e7b5c830..c5f8965eba2 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboardedit/MatchAndApplyScoreCorrectionsDialog.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/leaderboardedit/MatchAndApplyScoreCorrectionsDialog.java @@ -251,12 +251,16 @@ public class MatchAndApplyScoreCorrectionsDialog extends DataEntryDialog"); } if (officialNetPoints == null) { - sb.append(0); + sb.appendEscaped("null"); } else { sb.append(officialNetPoints); } sb.appendEscaped("/"); if (officialTotalPoints == null) { - sb.append(0); + sb.appendEscaped("null"); } else { sb.append(officialTotalPoints); } diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/shared/charts/WindChart.java b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/shared/charts/WindChart.java index b99e3153e8e..8153bc161e0 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/shared/charts/WindChart.java +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/shared/charts/WindChart.java @@ -527,7 +527,7 @@ public class WindChart extends RaceChart implements Component if (timeOfEarliestRequestInMillis == null || date.getTime() < timeOfEarliestRequestInMillis) { loadData(timeRangeWithZoomProvider.getFromTime(), date, /* append */ true); } else if (date.getTime() > timeOfLatestRequestInMillis) { - loadData(new Date(timeOfLatestRequestInMillis), timeRangeWithZoomProvider.getToTime(), /* append */true); + loadData(new Date(timeOfLatestRequestInMillis), date, /* append */true); } } break; diff --git a/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/AbstractPortMonitor.java b/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/AbstractPortMonitor.java index d43f91a814d..6c52a267a65 100644 --- a/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/AbstractPortMonitor.java +++ b/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/AbstractPortMonitor.java @@ -96,12 +96,23 @@ public abstract class AbstractPortMonitor extends Thread { sn.connect(currentendpoint.getAddress(), timeout); sn.close(); } else { + /* Avoid pooling http connections leading to TIME_WAIT */ + System.setProperty("http.keepAlive", "false"); + /* despite its name this does NOT open a real TCP connection */ HttpURLConnection conn = (HttpURLConnection)currentendpoint.getURL().openConnection(); conn.setConnectTimeout(timeout); conn.setRequestMethod("GET"); conn.connect(); int code = conn.getResponseCode(); + + /* Make sure to also close the stream */ + try { + conn.getInputStream().close(); + } catch (Exception ex) { + /* ignore if there is no input stream */ + } + conn.disconnect(); if (code != 200) { throw new ConnectException("Could not successfully connect to endpoint " + currentendpoint.toString()); diff --git a/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/OSGiRestartingPortMonitor.java b/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/OSGiRestartingPortMonitor.java index 6bb619306a9..c34bcdf4445 100644 --- a/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/OSGiRestartingPortMonitor.java +++ b/java/com.sap.sailing.monitoring/src/com/sap/sailing/monitoring/OSGiRestartingPortMonitor.java @@ -24,36 +24,35 @@ import com.sap.sailing.monitoring.sysinfo.SystemInformationImpl; /** * This monitor tries to restart registered services * on failure. It also sends out email to fixed recipients including system information. - * + * * @author Simon Pamies (info@pamies.de) * @since Nov 26, 2012 */ public class OSGiRestartingPortMonitor extends AbstractPortMonitor { Logger log = Logger.getLogger(OSGiRestartingPortMonitor.class.getName()); - + SystemInformation info = null; - + public OSGiRestartingPortMonitor(Properties properties) { super(properties); - + String[] props_bundles = properties.getProperty("monitor.bundles").split(","); - + for (int i=0; i 0) return Long.parseLong(val[0].split("\t| ")[0].trim()); return -1; @@ -159,7 +158,7 @@ public class SystemInformationImpl implements SystemInformation { @Override public long getMaxOpenFiles() throws Exception { String[] val = readProc("/proc/sys/fs/file-max"); - + if (val.length > 0) return Long.parseLong(val[0].trim()); return -1; @@ -168,7 +167,7 @@ public class SystemInformationImpl implements SystemInformation { @Override public long getMaxInMemoryINodes() throws Exception { String[] val = readProc("/proc/sys/fs/inode-max"); - + if (val.length > 0) return Long.parseLong(val[0].trim()); return -1; @@ -213,7 +212,7 @@ public class SystemInformationImpl implements SystemInformation { public long getFreeMemoryGlobal() throws Exception { return sigar_manager.getMem().getFree(); } - + @Override public long getFreeMemoryJVM() { return Runtime.getRuntime().freeMemory(); @@ -237,35 +236,35 @@ public class SystemInformationImpl implements SystemInformation { public String toString() { StringBuffer result = new StringBuffer(""); try { - + result.append("General:\n"); result.append(getLastLoadAverage()).append(" (load avg)").append("\n"); result.append(getTotalRunningProcesses()).append(" (total processes running)").append("\n"); result.append(getTotalStoppedProcesses()).append(" (total processes stopped)").append("\n"); result.append(getTotalZombieProcesses()).append(" (total processes zombie)").append("\n"); result.append(getTotalProcesses()).append(" (total)").append("\n"); - + result.append("\nMemory:\n"); result.append(getFreeMemoryGlobal()/1000 + "kb (free, not cached, not inactive)\n"); result.append(getFreeMemoryJVM()/1000 + "kb (free JVM)\n"); result.append((getTotalMemoryJVM()-getFreeMemoryJVM())/1000 + "kb (used JVM)\n"); result.append(getTotalMemoryJVM()/1000 + "kb (total JVM)\n"); - - result.append("\nOpen files:\n") + + result.append("\nOpen files:\n") .append(getOpenFiles()).append(" / ").append(getUsedSockets()).append(" (normal / sockets)").append("\n") .append(getMaxOpenFiles()).append(" (max, also socket max)").append("\n") .append(getMaxInMemoryINodes()).append(" (max in-memory inodes)").append("\n"); result.append("\nNet:\n" + getTCPConnectionsInUse() + " (tcp conn in use)\n" + getAllocatedTCPConnections() + " (alloc'd tcp conn)\n" + getUsedSockets() + " (used sockets)").append("\n"); - + result.append(getOutbundOpenConnectionCount()).append(" (outbound conn count)").append("\n") .append(getInboundOpenConnectionCount()).append(" (inbound conn count)").append("\n"); - + int flags = NetFlags.CONN_TCP | NetFlags.CONN_UDP | NetFlags.CONN_SERVER; NetConnection[] connections = getOpenNetworkConnections(flags); result.append("\nCalling Process Statistics:\n"); - result.append(getProcessInformation(getPid())); + result.append(getProcessInformation(getPid()) + "\n"); result.append("\nOpen Local Ports:\n"); for (NetConnection ns : connections) { @@ -295,14 +294,14 @@ public class SystemInformationImpl implements SystemInformation { result.append("\nContents of TMP directory (java.io.tmpdir)").append("\n"); result.append(Arrays.toString(new File(System.getProperty("java.io.tmpdir")).listFiles())); - + } catch (Exception ex) { ex.printStackTrace(); } return result.toString(); } - + public static void main(String[] args) { try { System.out.println(SystemInformationImpl.getInstance()); diff --git a/java/com.sap.sailing.server.gateway.test/META-INF/MANIFEST.MF b/java/com.sap.sailing.server.gateway.test/META-INF/MANIFEST.MF index cdabc148585..13c375c5662 100644 --- a/java/com.sap.sailing.server.gateway.test/META-INF/MANIFEST.MF +++ b/java/com.sap.sailing.server.gateway.test/META-INF/MANIFEST.MF @@ -7,7 +7,7 @@ Bundle-Vendor: SAP Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Fragment-Host: com.sap.sailing.server.gateway Require-Bundle: org.mockito.mockito-core;bundle-version="1.9.5", - org.objenesis;bundle-version="1.3.0", - com.sap.sailing.domain.test + com.sap.sailing.domain.test, + org.hamcrest;bundle-version="1.1.0" Import-Package: com.sap.sailing.server.impl, org.junit;version="4.8.2" diff --git a/java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTests.java b/java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTest.java similarity index 99% rename from java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTests.java rename to java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTest.java index a95d31ed77b..3c1e8cc648d 100644 --- a/java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTests.java +++ b/java/com.sap.sailing.server.gateway.test/src/com/sap/sailing/server/gateway/test/JsonExportTest.java @@ -58,7 +58,7 @@ import com.sap.sailing.server.gateway.impl.LeaderboardJsonGetServlet; import com.sap.sailing.server.gateway.impl.RegattasJsonGetServlet; import com.sap.sailing.server.impl.RacingEventServiceImpl; -public class JsonExportTests { +public class JsonExportTest { private RacingEventService racingEventService; private Regatta regatta; private RegattaLeaderboard regattaLeaderboard; diff --git a/java/com.sap.sailing.targetplatform.base/features/target-test/feature.xml b/java/com.sap.sailing.targetplatform.base/features/target-test/feature.xml index 23ddf0a75d1..5ab3cb5d86a 100644 --- a/java/com.sap.sailing.targetplatform.base/features/target-test/feature.xml +++ b/java/com.sap.sailing.targetplatform.base/features/target-test/feature.xml @@ -18,6 +18,34 @@ install-size="0" version="4.8.2" unpack="false"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample.xml b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample.xml index d7cbba71c27..5b19306e0dd 100755 --- a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample.xml +++ b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample.xml @@ -1,3020 +1,3019 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample_simple.xml b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample_simple.xml index d8b764bcee1..960b043d123 100755 --- a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample_simple.xml +++ b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRFleetRaceExample_simple.xml @@ -1,19 +1,17 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRTeamRaceExample.xml b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRTeamRaceExample.xml index f54082f95a7..e4b216e70af 100755 --- a/java/com.sap.sailing.xrr.resultimport.test/resources/XRRTeamRaceExample.xml +++ b/java/com.sap.sailing.xrr.resultimport.test/resources/XRRTeamRaceExample.xml @@ -1,164 +1,163 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/wiki/cook-book.md b/wiki/cook-book.md index e905e57df59..413de5f8051 100644 --- a/wiki/cook-book.md +++ b/wiki/cook-book.md @@ -1,7 +1,56 @@ # Cook Book with useful recipes +[[_TOC_]] + ### Export from MongoDB To export data from MongoDB you simply have to use the monogexport command. It will export data to human readable JSON format. Make absolutely sure to use fields backed by an index in your query otherwise it can put MongoDB under heavy load and take ages. -`/opt/mongodb/bin/mongoexport --port 10202 -d winddb -c WIND_TRACKS -q "{'REGATTA_NAME': 'ESS 2013 Muscat (Extreme40)'}" > tmp/ess2013-muscat-wind.json` \ No newline at end of file +`/opt/mongodb/bin/mongoexport --port 10202 -d winddb -c WIND_TRACKS -q "{'REGATTA_NAME': 'ESS 2013 Muscat (Extreme40)'}" > tmp/ess2013-muscat-wind.json` + +### Import to MongoDB + +Importing requires data to be in JSON format (as exported by mongoexport). To make sure that old entries just get updated and not overwritten you must use the --upsert parameter. + +`/opt/mongodb/bin/mongoimport --port 10202 -d winddb -c WIND_TRACKS --upsert tmp/ess2013-muscat-wind.json` + +### Hot Deploy Java Packages to a running Server + +Sometimes you need to deploy code to a running OSGi server without restarting the whole process. To ease this process the script buildAndUpdateProduct.sh provides an action called _hot-deploy_. To deploy a changed package you first need to know the fully qualified name. In most cases (for com.sap* packages) this corresponds to the package name (e.g. com.sap.sailing.gwt.ui). To hot-deploy the package _com.sap.sailing.server.gateway_ one can use the following call: + +`buildAndUpdateProduct.sh -n com.sap.sailing.server.gateway hot-deploy` + +This will first check if versions really differ and tell you the versions (installed, to-be-deployed). You can then decide to execute deployment. Deployment will not overwrite the old package but copy the new package to $SERVER_HOME/plugins/deploy. If the OSGi server is reachable on a telnet port (that you can specify with -p parameter) then you don't need to worry about the OSGi reload process it will be performed automagically. If no server can be reached then you'll get detailed instructions on how to install new package. It will then look like this: + +
+PROJECT_HOME is /Users/spamies/Projects/sailing/code
+SERVERS_HOME is /Users/spamies/Projects/sailing/servers
+OLD bundle is com.sap.sailing.monitoring with version 1.0.0.201303252301
+NEW bundle is com.sap.sailing.monitoring with version 1.0.0.201303252302
+
+Do you really want to hot-deploy bundle com.sap.sailing.monitoring to /Users/spamies/Projects/sailing/code/master? (y/N): Continuing
+Copied com.sap.sailing.monitoring_1.0.0.201303252302.jar to /Users/spamies/Projects/sailing/servers/master/plugins/deploy
+
+ERROR: Could not find any process running on port . Make sure your server has been started with -console 
+I've already deployed bundle to /Users/spamies/Projects/sailing/servers/master/plugins/deploy/com.sap.sailing.monitoring_1.0.0.201303252302.jar
+You can now install it yourself by issuing the following commands:
+
+osgi> ss com.sap.sailing.monitoring
+21   ACTIVE   com.sap.sailing.monitoring_1.0.0.201303252302
+osgi> stop 21
+osgi> uninstall 21
+osgi> install file:///Users/spamies/Projects/sailing/servers/master/plugins/deploy/com.sap.sailing.monitoring_1.0.0.201303252302.jar
+osgi> ss com.sap.sailing.monitoring
+71   INSTALLED   com.sap.sailing.monitoring_1.0.0.201303252302
+osgi> start 71
+
+ +### Display Line Endings for File + +Sometimes different line endings get mixed. To display all lin endings for each line of a given file use the following command: + +`perl -p -e 's[\r\n][WIN\n]; s[(?` + +### Finding Packages for Deployment in Target Platform + +Sometimes you want to add libraries to the target platform but you don't have correctly formatted JAR files. In this case you can find some files here: [Eclipse ORBIT](http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/) \ No newline at end of file diff --git a/wiki/general-event-planning.md b/wiki/general-event-planning.md new file mode 100644 index 00000000000..c61dabea4a0 --- /dev/null +++ b/wiki/general-event-planning.md @@ -0,0 +1,88 @@ +# General Plan for Events + +This document should depict the infrastructure used for upcoming events. The main goal is to make sure that parallel events do not interfere. Please make sure to fill every column. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDatePhysical ServerJava ServerJava Backup ServerTMUX SessionOfficial URLProviderMongoDB Port PortWind PortOfficer
ESS Muscat04.03.2013-09.03.2013http://sapcoe-app01.pironet-ndh.com/ (195.227.10.246)PROD1 (8889)TEST (8887)sailinghttp://ess40-2013.sapsailing.comTracTrac102022014Axel
ESS Singapore08.04.2013-14.04.2013http://sapcoe-app01.pironet-ndh.com/ (195.227.10.246)PROD1 (8889)TEST (8887)sailinghttp://ess40-2013.sapsailing.comTracTrac102022014Simon
ESS Qingdao29.04.2013-05.05.2013http://sapcoe-template01.pironet-ndh.com/ (195.227.44.85)PROD1 (8889)TEST (8887)sailinghttp://ess40-2013.sapsailing.comTracTrac102022014Simon
505 Barbados????)??????????????Axel
Star IDM??????????????????Frank
\ No newline at end of file