Class RadiusOITransport

java.lang.Object
com.nt.udc.ndk.node.OITransport
com.nt.udc.oi.node.radius.RadiusOITransport
All Implemented Interfaces:
DataReceiverIfc, DCTransport, FileDataReceiverIfc, Runnable

public class RadiusOITransport extends OITransport
  • Constructor Details

    • RadiusOITransport

      public RadiusOITransport(OINode oinode, Factory factory, int port, int interval, int expire) throws NodeStartException
      Construct a RadiusOITransport to be used within the specified OINode. The transport will send the packets created by the Factory and listen for incoming packets on the given port.
      Parameters:
      oinode - Reference to the OINode containing the transport
      factory - The Factory object used to create DatagramPackets from the incoming OIRecords.
      port - The port number on which to create the socket
      interval - The number of seconds between transmit attempts
      expire - The number of seconds after which the request has expired and attempts to transmit should cease
      Throws:
      NodeStartException
  • Method Details

    • dataIsAvailable

      public void dataIsAvailable()
      This method allows the transport's DataProvider to tell the transport that data is waiting to be 'picked up'. It is then the responsibility of the transport to retrieve the data via the provider's getData() method and process it via the receiver's processData() method.
      Specified by:
      dataIsAvailable in interface DataReceiverIfc
      Specified by:
      dataIsAvailable in class OITransport
    • processData

      public void processData(DCFieldContainer record) throws NodeProcessingException
      Accept an OIRecord object to be transmitted via UDP.
      Specified by:
      processData in interface DataReceiverIfc
      Specified by:
      processData in class OITransport
      Parameters:
      record - DCFieldContainer object containing the data.
      records - An OIRecord object.
      Throws:
      NodeProcessingException
    • processData

      public void processData(DCFieldContainer[] records) throws NodeProcessingException
      Not used
      Throws:
      NodeProcessingException
    • run

      public void run()
      This method is used when the OITransport runs within its own thread. The method contains the logic to retrieve the data from the the transport's DataProvider and hand the OIRecord() objects to the processData() method.
      Specified by:
      run in interface Runnable
      Specified by:
      run in class OITransport
    • shutdown

      public void shutdown()
      Stop the transport. Do not shutdown until all queued data has been processed.
      Specified by:
      shutdown in interface DCTransport
      Specified by:
      shutdown in class OITransport
    • isHealthy

      public boolean isHealthy()
      This method is used to check if the transport is fully functional
      Specified by:
      isHealthy in interface DCTransport
      Overrides:
      isHealthy in class OITransport
      Returns:
      true if the transport is healthy, false otherwise
    • setFactory

      public void setFactory(Factory factory)
      Set the Factory object used to create the DatagramPackets
      Parameters:
      factory - The Factory used to create the DatagramPackets
    • getFactory

      public Factory getFactory()
      Retrieve the Factory object used to create the DatagramPackets
      Returns:
      The Factory used to create the DatagramPackets
    • getSocket

      public DatagramSocket getSocket()
      Retrieve the DatagramSocket object used to send/receive DatagramPackets
      Returns:
      The DatagramSocket used to send/receive DatagramPackets
    • setRunning

      protected void setRunning(boolean run)
      Sets the boolean which indicates whether the transport is running
    • isRunning

      public boolean isRunning()
      Indicates whether this RadiusOITransport is running
    • isDataAvailable

      public boolean isDataAvailable()
      Indicates whether data is available from the transport's DataProvider
    • isProcessingData

      public boolean isProcessingData()
      Indicates whether this RadiusOITransport is currently processing data
    • setProcessingData

      protected void setProcessingData(boolean value)
      Sets the boolean indicating whether the transport is currently processing data.
    • isConnected

      public boolean isConnected()
      Indicates whether this RadiusOITransport is connected to the socket
    • connect

      protected void connect() throws IOException
      Create the socket and attempt to establish a connection.
      Throws:
      IOException
    • close

      protected void close()
      Disconnect and close the socket.
    • reconnect

      protected void reconnect()
      Attempt to re-establish the connection.