Package org.orekit.gnss.metric.ntrip
Class StreamMonitor
- java.lang.Object
-
- org.orekit.gnss.metric.parser.AbstractEncodedMessage
-
- org.orekit.gnss.metric.ntrip.StreamMonitor
-
- All Implemented Interfaces:
Runnable
,EncodedMessage
public class StreamMonitor extends AbstractEncodedMessage implements Runnable
Monitor for retrieving streamed data from one mount point.- Since:
- 11.0
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Constructor Description StreamMonitor(NtripClient client, String mountPoint, Type type, boolean requiresNMEA, boolean ignoreUnknownMessageTypes, double reconnectDelay, double reconnectDelayFactor, int maxRetries)
Build a monitor for streaming data from a mount point.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObserver(int typeCode, MessageObserver observer)
Add an observer for encoded messages.protected int
fetchByte()
Fetch the next byte from the message.OrekitException
getException()
Retrieve exception caught during monitoring.void
run()
void
stopMonitoring()
Stop monitoring.-
Methods inherited from class org.orekit.gnss.metric.parser.AbstractEncodedMessage
extractBits, start
-
-
-
-
Constructor Detail
-
StreamMonitor
public StreamMonitor(NtripClient client, String mountPoint, Type type, boolean requiresNMEA, boolean ignoreUnknownMessageTypes, double reconnectDelay, double reconnectDelayFactor, int maxRetries)
Build a monitor for streaming data from a mount point.- Parameters:
client
- associated NTRIP clientmountPoint
- mount point providing the streamtype
- messages type of the mount pointrequiresNMEA
- if true, the mount point requires a NMEA GGA sentence in the requestignoreUnknownMessageTypes
- if true, unknown messages types are silently ignoredreconnectDelay
- delay before we reconnect after connection closereconnectDelayFactor
- factor by which reconnection delay is multiplied after each attemptmaxRetries
- max number of reconnect a attempts without reading any data
-
-
Method Detail
-
addObserver
public void addObserver(int typeCode, MessageObserver observer)
Add an observer for encoded messages.If messages of the specified type have already been retrieved from a stream, the observer will be immediately notified with the last message as a side effect of being added.
- Parameters:
typeCode
- code for the message type (if set to 0, notification will be triggered regardless of message type)observer
- observer for this message type
-
stopMonitoring
public void stopMonitoring()
Stop monitoring.
-
getException
public OrekitException getException()
Retrieve exception caught during monitoring.- Returns:
- exception caught
-
fetchByte
protected int fetchByte()
Fetch the next byte from the message.- Specified by:
fetchByte
in classAbstractEncodedMessage
- Returns:
- next byte from the message, as a primitive integer, or -1 if end of data has been reached
-
-