The cleanseEx() method combines the attach(), cleanse() and release() methods into a single method. Use this method in a real-time environment when processing only one record at a time.
Syntax
public void cleanseEx(char systemID,
java.lang.String serverName,
java.lang.String trillName[],
java.lang.String inputData[],
java.lang.String updtRule[],
java.lang.String outputData[],
int retCode[]);
Parameters
Name |
Type |
Use |
Length |
Description |
---|---|---|---|---|
systemID |
char |
In |
1 |
System ID of requested server. |
serverName |
string |
In |
1-8 |
Name of requested server. |
trillName |
string[ ] |
In |
n* |
Array of strings that contains the field names of the data to be cleansed. Fields correspond to the field names in the DDLs. |
inputData |
string[ ] |
In |
n* |
Array of strings that contains data to cleanse. |
updtRule |
string[ ] |
In |
n* |
Array of strings that contains the update rules for the returned data. |
outputData |
string[ ] |
Out |
n* |
Array of strings that contains the cleansed data on return. Must be pre-allocated by the caller with the correct number of elements. |
retCode |
int[[ ] |
Out |
4 |
Error code that indicates status of method call. |
n* indicates maximum length allowed by the operating system and hardware on which the program runs.
Example
import java.util.*;
import java.io.*;
import java.lang.*;
import trillium.director.*;
class TestJNIClient {
public static void main(String[] args) {
TrilTGenClient testClient = new TrilTGenClient();
// Return code
int[] retCode= new int[1];
// Miscellaneous processing
int i;
int maxOut;
// System and Server ID for attach()
char systemID = 'G';
String serverName "Cleanser";
// Data for Cleanser
String[] trillName = {"LINE_01",
"LINE_03",
"LINE_09",
"FirstName",
"HouseNo",
"StreetAddress",
"City",
"State",
"PostalCode",
"Country"};
String[] updtRule = {"",
"",
"",
"PR_GIVEN_NAME1_RECODED_01",
"dr_house_number1",
"dr_street_name",
"dr_city_name",
"dr_region_name",
"dr_postal_code",
"WINDOW_KEY_01",
"WINDOW_KEY_03"};
String[] inputData = {"john smith",
"164 lexington",
"01821"};
// Create array contains returned cleansed data
// Must be initalized to contain all returned elements
String[] outputData = new String[12];
// Use cleanseEX method to cleanse
// (no attach or release required)
testClient.cleanseEx(systemID, serverName, trillName, inputData,
updtRule, outputData, retCode);
if (retCode[0] != 0) {
System.out.println("cleanseEX method returned " +
retCode[0]);
}
maxOut = outputData.length;
if (maxOut > 0) {
for (i = 0; i < maxOut; i++) {
System.out.println(outputData[i]);
}
}
}
}