Class EINode

java.lang.Object
com.nt.udc.ndk.node.DCNode
com.nt.udc.ndk.node.EINode
All Implemented Interfaces:
AdminIfc, ConfigIfc, LoggerIfc, NodeHealthIfc, NodeStateManagementIfc, PropertyIfc, StateManagementIfc
Direct Known Subclasses:
FileEINode, FlatFileEINode, FtpFileEINode, GenericUdpEINode, IPDREINode, JDBCEINode, SoapXmlEINode, XMLEINode

public abstract class EINode extends DCNode
  • Field Details

    • eiTransport

      protected EITransport eiTransport
      The EITransport class manages all of the data that is collected by this Equipment Interface (EI). The transport must implement DataProviderIfc.
    • eiTransports

      protected EITransport[] eiTransports
    • fieldProcessor

      protected DCFieldProcessor fieldProcessor
      The DCFieldProcessor class in an EI is specifically used for the purpose of moving records from an object associated with the raw input form to NAR Records.
    • fp

      protected DCFieldProcessor[] fp
    • transThread

      protected Thread transThread
      If using a threaded transport, this is where it should run
    • transportThread

      protected Thread[] transportThread
    • fpThread

      protected Thread fpThread
      If using a thread field processor, this is where it should run.
  • Constructor Details

    • EINode

      public EINode()
      Default Constructor; instantiates objects necessary to define the DCNodeTypeIfc methods.
    • EINode

      public EINode(String[] args) throws NodeStartException
      Constructor for the class. Calls the super class DCNode then sets up directory space for output in:   invalid input: '&nbsp' /output
      Subclasses should then instantiate the eiTransport attribute, and the eiRecord attribute. The eiRecord should then be handed to the eiTransport. Subclasses should also create a DCFieldProcessor object as both a DataReceiverIfc and a DataProviderIfc. Then eiTransport, and the DCFieldProcessor should have their providers and receivers set as appropriate.
      Parameters:
      args - Passed to super class DCNode
      Throws:
      NodeStartException
    • EINode

      public EINode(String[] args, boolean multithread) throws NodeStartException
      Throws:
      NodeStartException
  • Method Details

    • getMajorType

      public final String getMajorType()
      Specified by:
      getMajorType in class DCNode
      Returns:
      Returns the 'Major Type' of this node.
    • setTransport

      protected void setTransport(EITransport eit)
      Sets the EITransport for this node.
      Parameters:
      eit - The EITransport object to be used within this node.
    • setTransport

      protected void setTransport(EITransport eit, int i)
    • getTransport

      protected EITransport getTransport()
      Gets the object responsible for transporting data from our source.
      Returns:
      Returns the EITransport object for this node.
    • getTransport

      protected EITransport getTransport(int i)
    • setFieldProcessor

      protected void setFieldProcessor(DCFieldProcessor fp)
      Sets the DCFieldProcessor for this node.
      Parameters:
      fp - The DCFieldProcessor object to be used within this node.
    • setFieldProcessor

      protected void setFieldProcessor(DCFieldProcessor fp, int i)
    • getFieldProcessor

      protected DCFieldProcessor getFieldProcessor()
      Gets the object that is responsible for processing the raw data into the format being passed out of the node (most likely NARs).
      Returns:
      Returns the DCFieldProcessor object for this node.
    • getFieldProcessor

      protected DCFieldProcessor getFieldProcessor(int i)
    • setFieldProcessorThread

      public void setFieldProcessorThread(DCFieldProcessor fp)
      Sets the DCFieldProcessor to run within its own thread.
      Parameters:
      fp - A runnable DCFieldProcessor object.
    • getFieldProcessorThread

      public Thread getFieldProcessorThread()
      Returns:
      Returns the thread which is executing the DCFieldProcessor.
    • shutdownFieldProcessor

      protected void shutdownFieldProcessor()
      Shutdown the FieldProcessor. The FieldProcessor should continue to run until all data has been pushed to the DCStreamHandler.
    • setTransportThread

      public void setTransportThread(EITransport eit)
      Sets the EITransport to run within its own thread.
      Parameters:
      oit - A runnable EITransport object.
    • setTransportThread

      public void setTransportThread(EITransport eit, int i)
    • setTransportThread

      public void setTransportThread(EITransport eit, int i, String name)
    • getTransportThread

      public Thread getTransportThread()
      Returns:
      Returns the thread which is executing the Transport.
    • getTransportThread

      public Thread getTransportThread(int i)
    • isNodeStateUsed

      public boolean isNodeStateUsed()
      Returns whether the node state is used (and whether the node can be recovered.) (Currently disabled for all EI nodes)
      Specified by:
      isNodeStateUsed in interface NodeStateManagementIfc
      Overrides:
      isNodeStateUsed in class DCNode
      Returns:
      true, if node state is being used
    • reconfigure

      public void reconfigure() throws NodeStartException
      Call that reconfigures an EINode object for warm restart. This method performs node reconfiguration processing specific to an EINode object. Derived classes that need to perform their own reconfiguration processing should override reconfigure() and then call this method from there. A flag is set in the DCNode base class indicating this node is in the reconfiguration state. The most derived class should use the setIsReconfiguringFlag method just before returning from its reconfigure() method to set the reconfiguration state to false.
      Specified by:
      reconfigure in interface AdminIfc
      Overrides:
      reconfigure in class DCNode
      Throws:
      NodeStartException
    • startup

      public void startup() throws NodeStartException
      Call that starts a node. This method performs startup processing specific to an EINode object. Derived classes that need to perform their own startup processing should override startup() and then call this method first from there.
      Specified by:
      startup in interface AdminIfc
      Overrides:
      startup in class DCNode
      Throws:
      NodeStartException
    • initDCStreamHandler

      protected void initDCStreamHandler(int numThreads, boolean isMultithreaded)
    • initDCStreamHandler

      protected void initDCStreamHandler(int numThreads, boolean isMultithreaded, boolean isOrdered)
    • isHealthy

      public boolean isHealthy()
      This method is used to check the transport's state of health. The criterion for determining the node's health is based on the transport's health and whether all registered threads are alive. It is to be overridden by subclasses.
      Specified by:
      isHealthy in interface NodeHealthIfc
      Overrides:
      isHealthy in class DCNode
      Returns:
      true if the transport is healthy, false otherwise