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
Monitor for retrieving streamed data from one mount point.
- Since:
- 11.0
- Author:
- Luc Maisonobe
-
Constructor Summary
ConstructorsConstructorDescriptionStreamMonitor(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
Modifier and TypeMethodDescriptionvoidaddObserver(int typeCode, MessageObserver observer) Add an observer for encoded messages.protected intFetch the next byte from the message.Retrieve exception caught during monitoring.voidrun()voidStop monitoring.Methods inherited from class org.orekit.gnss.metric.parser.AbstractEncodedMessage
extractBits, start
-
Constructor Details
-
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 attempts without reading any data
-
-
Method Details
-
addObserver
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
Retrieve exception caught during monitoring.- Returns:
- exception caught
-
run
public void run() -
fetchByte
protected int fetchByte()Fetch the next byte from the message.- Specified by:
fetchBytein classAbstractEncodedMessage- Returns:
- next byte from the message, as a primitive integer, or -1 if end of data has been reached
-