The attach() method connects to a Director instance and establishes a communication path to a Director cleansing or matcher server.
The returned value is the communication path (handle) to the server. The handle must be used in subsequent API calls to exchange data with the server. (If the returned value is 0, see “Return Values” below.)
Syntax
public int attach(char systemID,
java.lang.String serverName,
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. |
retCode |
int[] |
Out |
4 |
Error code that indicates status of method call. |
Return Values
A returned value of 0 indicates a failed attempt to attach to a Director server, and the retCode will indicate the specific error. For a description of the contents of the retCode parameter, refer to Return Values.
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();
int handle = 0; // System and Server ID for attach()
char systemID = 'G';
String serverName = “Cleanser”; // Attach to G Cleanser
handle = testClient.attach(systemID, serverName, retCode);
//
// Cleanse or match requests not shown for this example
//
if (retCode[0] == 0) { testClient.release(handle, retCode);
}
}