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 Summary
Fields Modifier and Type Field Description protected static int
TRANSACTION_CHUNK_SIZE
Fields inherited from class com.onenetwork.platform.integ.fixlen.BaseFixLenOutboundGenerator
metadataFileName, moduleOrEptPrefix
-
Constructor Summary
Constructors Modifier Constructor Description 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. -
Method Summary
Modifier and Type Method Description void
generate(NetChangeOutboundProcessingContext processingContext)
Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseFixLenOutboundGenerator.BaseFixLenOutboundGenerator(String, String)}protected java.util.List<Model>
getModelsForOutboundProcessing(NetChangeOutboundProcessingContext processingContext, java.util.List<java.lang.Long> sysIdsOfModels)
Get models using ModelDataService.readByIdsprotected 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.abstract SqlDef
getSqlDef(NetChangeOutboundProcessingContext processingContext)
SqlDef to retrieve the models for which the outbound fixed length format file needs to be generated.protected java.util.List<java.lang.Long>
getSysIdsForOutboundGeneration(NetChangeOutboundProcessingContext processingContext)
Uses the SqlDef to get all the sysIds of the models to be used in generation.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.Methods inherited from class com.onenetwork.platform.integ.fixlen.BaseFixLenOutboundGenerator
createFixLenRow, createMessageDetailEntry, generate, generateRows, populatePrimaryRefTransDetailsOnMessageDetail
-
Field Details
-
TRANSACTION_CHUNK_SIZE
protected static final int TRANSACTION_CHUNK_SIZE- See Also:
- Constant Field Values
-
-
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
Combines functionality of both {@link #NetChangeOutboundGenerator.generate(com.onenetwork.platform.integ.msg.NetChangeOutboundProcessingContext)} and {@link #BaseFixLenOutboundGenerator.BaseFixLenOutboundGenerator(String, String)}- Specified by:
generate
in interfaceNetChangeOutboundGenerator
- Parameters:
processingContext
-NetChangeOutboundProcessingContext
context to generate outbound data
-
getSqlDef
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
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.ExceptionGet models using ModelDataService.readByIds- Parameters:
processingContext
- current processing contextsysIdsOfModels
- ids of models to be fetched- Returns:
- List
matching model objects - Throws:
java.lang.Exception
-
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.ExceptionUses the SqlDef to get all the sysIds of the models to be used in generation.- Parameters:
processingContext
-- Returns:
- Throws:
java.lang.Exception
-