Class FileEnhancerNode

All Implemented Interfaces:
AdminIfc, ConfigIfc, LoggerIfc, NodeHealthIfc, NodeStateManagementIfc, PropertyIfc, StateManagementIfc
Direct Known Subclasses:
FtpFileEnhancerNode, LDAPEnhancerNode

public class FileEnhancerNode extends NPLProcessorNode
This Processor Node is the generic node for doing NPL based enhancements with data stored in an external file. The data in the file must comply to the UDC Look-up enhancer file format. The Look-up enhancer file format is defined as: key_value_separator = "=" pair_separator = "/n" = = ... = where the 1st and 2nd lines are optional. When either of the two lines are omitted, the following defaults will be used: key_value_separator = "=" pair_separator = "/n" The node may either be constructed with a parameter of the file (Actually it's not constructed with this, but gets it from the config) from which to draw the data, or with a parameter of a LoaderIfc which is responsible for providing the file the node will draw the data from. This node takes NARs as input, and writes NARs as output. It mantains it's own internal mechanism for loading a table with the look-up file data, and keeping it fresh. It then enhances the NARs based on the rules in an NPL file, and the contents of the look-up table.
  • Field Details

    • lookupFileName

      protected String lookupFileName
    • subValueSeparator

      protected String subValueSeparator
  • Constructor Details

    • FileEnhancerNode

      public FileEnhancerNode() throws NodeStartException
      Default Constructor.
      Throws:
      NodeStartException
    • FileEnhancerNode

      public FileEnhancerNode(String[] args) throws NodeStartException
      Constructor for the FileEnhancerNode. Sets up an NPLFieldProcessor and sets the DCFieldContainer to be a NAR. At the end of the constructor the node is started.
      Parameters:
      args - Passed to super class ProcessorNode
      Throws:
      NodeStartException
  • Method Details

    • shutdown

      public void shutdown()
      Performs the necessary tasks to properly shutdown the node.
      Specified by:
      shutdown in interface AdminIfc
      Overrides:
      shutdown in class NPLProcessorNode
    • getMinorType

      public String getMinorType()
      Returns the type name of the NPLProcessor node.
      Overrides:
      getMinorType in class NPLProcessorNode
      Returns:
      Returns the minor type identifier for this node.
    • getConfigDataGuiClass

      public String getConfigDataGuiClass()
      Returns the name of the NPLFieldProcessor Config Data GUI class.
      Overrides:
      getConfigDataGuiClass in class NPLProcessorNode
      Returns:
      Returns the class name of the DCNodeConfigGUI object used by the node.
    • getCfgData

      protected void getCfgData()
      Reads the applicable configuration data through the ConfigIfc interface
      Overrides:
      getCfgData in class NPLProcessorNode
    • configureFieldProcessor

      protected DCFieldProcessor configureFieldProcessor() throws NodeProcessingException
      Configures the FieldProcessor to be one with a IDCMethodHandler. Specifically one with lookup table functionality.
      Overrides:
      configureFieldProcessor in class NPLProcessorNode
      Returns:
      The DCFieldProcessor that has been configured.
      Throws:
      NodeProcessingException
    • setMethodHandler

      protected void setMethodHandler(IDCMethodHandler mh)
      Sets the IDCMethodHandler for this node.
      Parameters:
      mh - The IDCMethodHandler object to be used within this node.
    • getMethodHandler

      protected IDCMethodHandler getMethodHandler()
      Gets the object that is responsible for providing a "java hook" method handler interface between NPL and this node.
      Returns:
      Returns the IDCMethodHandler object for this node.
    • setLookupFile

      public void setLookupFile(String lFile)
    • getLookupFile

      public String getLookupFile()
    • setTableName

      public void setTableName(String name)
    • getTableName

      public String getTableName()
    • setContinueOnFileCorruption

      public void setContinueOnFileCorruption(boolean flag)
    • getContinueOnFileCorruption

      public boolean getContinueOnFileCorruption()
    • init

      protected void init()
      Void method that should be implemented by classes derived from NPLProcessorNode. The intent of this method is to give a place to implement construction steps that need to occur prior to the start of the FieldProcessorThread.
    • setLookupReader

      public void setLookupReader(LookupReaderThread lrt)
    • getLookupReader

      public LookupReaderThread getLookupReader()
    • setLookupReaderThread

      public void setLookupReaderThread(LookupReaderThread lrt)
      Sets the Lookup Table Reader to run within its own thread.
      Parameters:
      lrt - A runnable LookupReaderThread object.
    • getLookupReaderThread

      public Thread getLookupReaderThread()
      Returns:
      Returns the thread which is executing the LookupReader.
    • main

      public static void main(String[] args)
      The main method is useful for debugging and development purposes. However, this method will never actually be called when the node is run within the actual application. The node is a Thread in the application, rather than a process.
    • getLookupFrequency

      public static long getLookupFrequency()
    • setLookupFrequency

      protected static void setLookupFrequency(long lf)
    • isHealthy

      public boolean isHealthy()
      This method is used to check if the node is fully functional.
      Specified by:
      isHealthy in interface NodeHealthIfc
      Overrides:
      isHealthy in class DCNode
      Returns:
      true if the node is fully functional (healthy), false otherwise