Class UdpPlugin

java.lang.Object
org.eso.ias.plugin.network.UdpPlugin
All Implemented Interfaces:
Runnable

public class UdpPlugin extends Object implements 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 Details

    • udpPort

      public final int udpPort
      The UDP port to receive messages
    • receivedStringBufferSize

      public static final int receivedStringBufferSize
      The 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 plugin
      sender - the publisher of monitor points to the BSDB
      hbProducer - the sender of heartbeats
      udpPort - the UDP port
      Throws:
      SocketException - in case of error creating the UDP socket
    • UdpPlugin

      public UdpPlugin(PluginFileConfig config, int udpPort) throws SocketException
      Constructor
      Parameters:
      config - the configuration of the plugin
      udpPort - the UDP port
      Throws:
      SocketException - in case of error creating the UDP socket
  • Method Details

    • main

      public static void main(String[] args)
      The main to start the plugin
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • setUp

      public CountDownLatch setUp() throws PluginException
      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