Class BaseNetChangeFixLenOutboundGenerator

java.lang.Object
com.onenetwork.platform.integ.fixlen.BaseFixLenOutboundGenerator
com.onenetwork.platform.integ.fixlen.BaseNetChangeFixLenOutboundGenerator
All Implemented Interfaces:
ModelOutboundGenerator, NetChangeOutboundGenerator

public abstract class BaseNetChangeFixLenOutboundGenerator
extends BaseFixLenOutboundGenerator
implements NetChangeOutboundGenerator
Base class for implementing an Outbound interface which generates fixed length format file using a "net-change" strategy.

The subclass needs to provide a no-args constructor which internally provides all params to this class' constructor, and implement the following methods:

getSqlDef(NetChangeOutboundProcessingContext) - retrieve the models for which the outbound fixed length file need to be generated

getModelTypeClass() - return class name of the model type being used to generate the outbound file

  • Field Details

  • Constructor Details

    • BaseNetChangeFixLenOutboundGenerator

      protected BaseNetChangeFixLenOutboundGenerator​(java.lang.String moduleOrEptPrefix, java.lang.String metadataFileName)
      Constructor is used to set moduleOrEptPrefix and metadataFileName fields which are used for loading the XML rule file.
      • When overriding from a module: If we need to use a metadata file called Order.xml within PlatformTestModule, place the file within the "com.onenetwork.platformtestmodule.integ.fixlen.rules" package and call this constructor from the implementing generator's constructor as super("PTA","Order.xml");
      • When overriding from an EPT: Pass the EPT name for moduleOrEptName. For example, if you have an ept named "MyEnt" then place the XML rule file in package "com.onenetwork.myent.integ.fixlen.rules" and call this constructor from the implementing generator's constructor as - super("EPT.MyEnt","Order.xml");
      • to get the FixLenDef object from the XML rule file within the ept "EPT.MyEnt"
      Parameters:
      moduleOrEptPrefix - module prefix (e.g. ZBKS or EPT.MyEnt)
      metadataFileName - XML file should be in the "integ.fixlen.rules" subpackage of your module or EPT's base java package
  • Method Details

    • generate

      public void generate​(NetChangeOutboundProcessingContext processingContext)
      Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseFixLenOutboundGenerator.BaseFixLenOutboundGenerator(String, String)}
      Specified by:
      generate in interface NetChangeOutboundGenerator
      Parameters:
      processingContext - NetChangeOutboundProcessingContext context to generate outbound data
    • getSqlDef

      public abstract SqlDef getSqlDef​(NetChangeOutboundProcessingContext processingContext)
      SqlDef to retrieve the models for which the outbound fixed length format file needs to be generated. NOTE: SqlDef should have queries only to retrieve the sysIds and NOT entire models. Separate calls to MDS.readById will be done automatically later to read the entire model based on the ids returned. Supported params include $START_DATE$ and $END_DATE$, along with $VC_ID$
      Parameters:
      processingContext -
      Returns:
    • populateCustomParams

      public void populateCustomParams​(SqlParams sqlParams, PlatformUserContext pltUserContext)
      Override this method if you need to use additional SqlParams as part of retrieving the models to generate outbound.
      Parameters:
      sqlParams -
      pltUserContext -
    • getModelsForOutboundProcessing

      protected java.util.List<Model> getModelsForOutboundProcessing​(NetChangeOutboundProcessingContext processingContext, java.util.List<java.lang.Long> sysIdsOfModels) throws java.lang.Exception
      Get models using ModelDataService.readByIds
      Parameters:
      processingContext - current processing context
      sysIdsOfModels - ids of models to be fetched
      Returns:
      List matching model objects
      Throws:
      java.lang.Exception
    • getModelTypeClass

      protected abstract <T extends Model> java.lang.Class<T> getModelTypeClass()
      Method to get the class of the model type being used to generate the outbound message.
      Returns:
    • getSysIdsForOutboundGeneration

      protected java.util.List<java.lang.Long> getSysIdsForOutboundGeneration​(NetChangeOutboundProcessingContext processingContext) throws java.lang.Exception
      Uses the SqlDef to get all the sysIds of the models to be used in generation.
      Parameters:
      processingContext -
      Returns:
      Throws:
      java.lang.Exception