PurgeEventHandler

The PurgeEventHandler handles the BusinessDayPurgeEvent event.

EXEC specification: com.ibm.paydir.ima.txsvr.event.appbridge.PurgeEventHandler

This event handler issues a Messaging API message on the JMS send queue when the BusinessDayPurgeEvent event occurs. When the data for a business day is purged by Transaction Server, a class in the Transaction Server is called to place a PurgeBusinessDay message on a message queue. The unit of work in the message contains the business day identifier.

The event parameters shown in Table 1 are used to describe the purge event that caused the PurgeEventHandler to run.

Event parameters

This event handler uses the general Messaging API event handler parameters and parameters that are specific to the event. Event parameters are specified in the Scheduler.xml file.

Table 1 shows the additional event parameters for the business day purge event.
Table 1. PurgeEventHandler parameters
Parameter name Type Value Description
purgeEventType Integer
1
Start overall purge
2
Start business day purge
3
End business day purge
4
Re-queue business day purge
5
End overall purge
A single business day purge event type code.
Note: The purgeEventType specified determines the posted event. The business day is deleted during the business day purge processing. If a purge event code is specified for an event that occurs after the business day is deleted, it is not possible to locate the business day in the database. A purgeEventType of two (2) is considered the best option.
requeue Boolean TRUE or FALSE Indicates event processing only occurs for purges in the specified re-queue state. This is normally set to FALSE to facilitate event processing only for the initial entry of the business day into the purge process. Subsequent purges that are re-queued after a failure are not processed again.

Message contents

The BusinessDayPurgeEvent notification is asynchronous and is posted to the target application to inform it that the business day is being removed. It is an asynchronous message and is not guaranteed delivery.

When the message is delivered to the target application, it contains the information that is shown in Table 2.
Table 2. Message content for PurgeEventHandler
Message part Value Description
Unit of Work Business Day ID as a long This value is used to locate the business day in the database, if it is not deleted. When the purge event type is 1 or 5, no business day ID is passed in the unit of work.
Payload com.ibm.paydir.ima.txacc.app.bridge.PurgeBusinessDayPayloadBean The PurgeBusinessDayPayloadBean class is an example of the type of payload delivered. This payload provides the accessor methods shown in Table 3 to retrieve the details of the event that occurred.
Contents XML that describes the business day Provides more information, such as the business date, category, and site, about the business day being purged. An example of the XML for the contents is:
<contents>
   <businessDay>
      <site>0</site>
      <category>NACHA</category>
      <date>20170317</date>
   </businessDay>
</contents>
Note: The contents of this message must match what the receiver is expecting.
Table 3. PurgeEventHandler accessor methods
Method name Return type Description
getBusinessDay ( ) Business Day Model Returns the business day model for the business day being purged. From this object it is possible to retrieve the site ID, business date, and business category.
getPurgeEventType ( ) Integer Returns the purge event code for the business day purge event that generated this payload. Refer to purgeEventType in Table 1 for possible values.
isRequeue ( ) Boolean Indicates this payload is generated by a re-queued purge for the business day. This occurs if a prior attempt to purge the business day failed and it had to be re-queued.

Response processing

The PurgeEventHandler does not expect a reply.

Example handler XML

The example XML shows a purgeBusinessDay Messaging API message sent to the FXH.DISTRIBUTION.INPUT.QUEUE on localhost when the BusinessDayPurgeEvent occurs. Because purgeEventType is set to 2, this message indicates that business day purge is starting.
<EVENT>
   <NAME>Distribution Business Day Clean-up</NAME>
   <TYPE>BusinessDayPurgeEvent</TYPE>
   <EXEC>
      com.ibm.paydir.ima.txsvr.event.appbridge.PurgeEventHandler
   </EXEC>
   <PARAMETER name="msgType">purgeBusinessDay</PARAMETER>
   <PARAMETER name="purgeEventType">2</PARAMETER>
   <PARAMETER name="requeue">FALSE</PARAMETER>
   <PARAMETER name="sourceID">PDTXS-02</PARAMETER>
   <PARAMETER name="destinationID">Presentment</PARAMETER>
   <PARAMETER name="jmsQmgrHostname">localhost</PARAMETER>
   <PARAMETER name="jmsQmgrChannel">SYSTEM.DEF.SVRCONN</PARAMETER>
   <PARAMETER name="jmsQmgrPort">1414</PARAMETER>
   <PARAMETER name="jmsClient">true</PARAMETER>
   <PARAMETER name="jmsQmgrName">FTM.QMANAGER</PARAMETER>
   <PARAMETER name="jmsSendQueue">FXH.DISTRIBUTION.INPUT.QUEUE</PARAMETER>
   <PARAMETER name="jmsReplyQueue">FXH.TRANSSERVER.INPUT.QUEUE</PARAMETER>
</EVENT>