User exits

The Transaction Server incorporates user exits to allow customization of several operations by an experienced programmer. These user exits are different from the standard event handler in that they allow the exit-writer to modify the operation of Transaction Server as it does a specific task.

The following user exits are supported by the Transaction Server:
Table 1. User exits
User exit name Description
Load Expected Presentments This user exit is used to specify which expected batches (ICLs) are loaded, and to override certain specifications about the expected batches (ICLs) that are being loaded.
Selection User Exit (Transaction Server) This user exit is used to identify the target Transaction Server before the item retrieve request is made.
Transaction Server user exits must all implement the following interface:
     com.ibm.icpcs.utilities.userexit.UserExitInterface
This interface requires the implementation of the following methods:
     public void init ( Properties params );
     public void execute ( UserExitRequest params );

The init () method is called when the user exit is first loaded at Transaction Server startup. It relays parameters from the startup configuration to the user exit. The parameters are passed by using the standard java.util.Properties class object instance. The specific parameters for a particular user exit are outlined for each exit type supported. The user exit is responsible for saving any initialization parameters that it finds for the duration of the user exit lifetime.

The execute () method is called when the actual user exit is dispatched for the intended reason. A user exit request is passed on the invocation. This data object contains various parameters that are particular to the user exit that is being called. It also contains several helper services to assist the user exit in doing its work. The following table shows the various methods that can be called on the user exit request object instance:
Table 2. Execute methods
Method Description
public short getShort ( String name );
public int getInt ( String name );
public long getLong ( String name );
public boolean getBoolean ( String name );
public String getString ( String name );
public Timestamp getTimestamp ( String name );
public Object get ( String name );
Various accessors to allow retrieval of named parameters of various types during user exit invocation. Refer to the specific user exit description for a description of the parameters it receives.
public void set ( String name, short val );
public void set ( String name, int val );
public void set ( String name, long val );
public void set ( String name, Boolean val );
public void set ( String name, String val );
public void set ( String name, Timestamp val );
public void set ( String name, Object val );
Various mutators to allow the user exit to return information to the Transaction Server. You cannot return null values by using these mutators. To return a null value, fail to set the parameter. Refer to the specific user exit description for a description of the return information it requires.
public void trace ( String text );
public void log ( String text );
public void logInfo ( String text );
public void logWarning ( String text );
public void logError ( String text );
Can be called by the user exit to issue trace and log messages to the Transaction Server log files. The type of log message that is generated is determined by the method:
  1. trace
  2. log
  3. informational
  4. warning
  5. error
public Connection getConnection ( );
Returns a database connection for the FTM database to the caller. Not all user exits pass a database connection to the user exit. Check the exit description to ensure that a database connection is available on request.
Note: All parameters, both input and output, use case-sensitive naming. Therefore, you must specify the parameter by using the exact name as shown in the user exit description.