Transaction Server selection user exit
The selection user exit allows you to identify the target Transaction Server before the item retrieve request is made. The user exit sends data from the transaction (such as sorter number, item sequence number, business date, business category, and so on) to select the target Transaction Server.
public void setTransactionServerList(TransactionServer[] serverList) {
this.serverList = serverList;
}
public List getTransactionServerList(ICLItemRecord itemRecord) {
List newServerList = new Vector();
// do nothing if not server set.
if (this.serverList == null || this.serverList.length == 0)
return newServerList;
// add the server list to the collection.
for (int i = 0; i < serverList.length; i++)
newServerList.add(this.serverList[i]);
if (itemRecord != null) {
if (itemRecord.getBusinessDayModel() != null) {
if (itemRecord.getBusinessDayModel().getDate() != null &&
itemRecord.getBusinessDayModel().getDate().toString().equals("20080108")) {
if (newServerList.size() > 1) {
// remove the first server from the list.
newServerList.remove(0);
}
} else
if ("08".equals(itemRecord.getBusinessDayModel().getCategory())) {
if (newServerList.size() > 1) {
// remove the last server from the list.
newServerList.remove(newServerList.size()-1);
}
}
} else
if (itemRecord.getItemSequenceNum() == 888888888) {
if (newServerList.size() > 1) {
// switch the position of the first one and the last one
TransactionServer lastServer = newServerList.remove(newServerList.size()-1);
TransactionServer firstServer = newServerList.remove(0);
newServerList.add(0, lastServer);
newServerList.add(firstServer);
}
} else
if (itemRecord.getItemSorter() == 88) {
if (newServerList.size() > 2) {
// remove the first two servers from the list
newServerList.remove(0);
newServerList.remove(0);
}
}
}
return newServerList;
}
The files for user exits are provided in the FTM artifacts pod and must be downloaded from the pod. For more information about getting files from the artifacts container for your offering, see Getting the files from the artifacts container for your FTM offering. For more information about installing compiled user exits, see User exits for the FTM components.
com.ibm.icpcs.utilities.user.UserTransactionServersSelectionand it implements
the following methods:
public abstract void setTransactionServerList(TransactionServer[] serverList);
public abstract List getTransactionServerList(ICLItemRecord itemRecord);The setTransactionServerList() method is invoked to set the list of Transaction Server instances.
The getTransactionServerList() method is invoked to return the selected target Transaction Server instances.
ClientDispatchItemReader constructor:
public ClientDispatchItemReader(String applicationName, TransactionServer[] servers,
String itsSelectionName) throws ClientApiExceptionitsSelectionName
is the name of the user exit.