Package org.eso.ias.plugin.network
Class UdpPlugin
java.lang.Object
org.eso.ias.plugin.network.UdpPlugin
- All Implemented Interfaces:
Runnable
A plugin that gets monitor points and alarms
from a UDP socket.
Strings received from the socket are pushed in the
receivedStringQueue
queue and processed by a dedicated thread to decouple reading
from processing and better cope with spikes.- Author:
- acaproni
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The max size of the bufferfinal int
The UDP port to receive messages -
Constructor Summary
ConstructorDescriptionUdpPlugin
(PluginFileConfig config, int udpPort) ConstructorUdpPlugin
(PluginFileConfig config, MonitorPointSender sender, org.eso.ias.heartbeat.HbProducer hbProducer, int udpPort) Constructor with customized monitor point sender and HbProducer mostly used for testing. -
Method Summary
-
Field Details
-
udpPort
public final int udpPortThe UDP port to receive messages -
receivedStringBufferSize
public static final int receivedStringBufferSizeThe max size of the buffer- See Also:
-
-
Constructor Details
-
UdpPlugin
public UdpPlugin(PluginFileConfig config, MonitorPointSender sender, org.eso.ias.heartbeat.HbProducer hbProducer, int udpPort) throws SocketException Constructor with customized monitor point sender and HbProducer mostly used for testing.- Parameters:
config
- the configuration of the pluginsender
- the publisher of monitor points to the BSDBhbProducer
- the sender of heartbeatsudpPort
- the UDP port- Throws:
SocketException
- in case of error creating the UDP socket
-
UdpPlugin
Constructor- Parameters:
config
- the configuration of the pluginudpPort
- the UDP port- Throws:
SocketException
- in case of error creating the UDP socket
-
-
Method Details
-
main
The main to start the plugin -
run
public void run() -
setUp
Starts the UdpPlugin- Returns:
- the latch signaling the termination of the thread
- Throws:
PluginException
- in case of error running the plugin
-
shutdown
public void shutdown()Shuts down the the thread and closes the plugin
-