Creating the Java client
The main class in the Enterprise Service Oriented Architecture (ESOA)
Toolkit is
the generated MasterDataService (in the com.ibm.mdm.esoa.client package
by default).
Before you begin
- You are using a supported version of the Java™ SDK. See the technical requirements.
- You have already generated the Enterprise Services for your InfoSphere® MDM Workbench project.
Procedure
- Start in a working directory. Copy the
ISI_Client_xx.x.x.zipfile from theworkspace\project_name\client\folder to the working directory. This compressed file contains your generated Java API and supporting libraries, as well as the generated documentation. Extract theISI_Client_xx.x.x.zipfile. - Create a subdirectory to hold your compiled code. Here
we use the subdirectory
classes. - Write Java code to access the MasterDataService.
- Compile and run the code.
Results
To use the MasterDataService, implementations of the following interfaces must be provided:
com.initiate.client.internal.MasterDataLoginProvider- analogous to madison.mpi.UsrHead in the core APIcom.initiate.client.internal.MasterDataContextProvider- analogous to madison.mpi.Context in the core API
These classes tell the MasterDataService the credentials to use to interact with the MDM operational server, and how to connect with the MDM operational server, respectively. The most common usage pattern is:
- Instantiate a MasterDataContextProvider implementation.
- Instantiate a MasterDataLoginProvider implementation.
- Instantiate the MasterDataService.
- Set the LoginProvider and ContextProvider on the MasterDataService.
- Start methods on the MasterDataService.
- Close the MasterDataContextProvider to release resources.
Custom implementations of MasterDataContextProvider and MasterDataLoginProvider can be created by the client as needed.
What to do next
- Optional: Configure the Java client for SSL
- To configure the Java client to use SSL, complete the following steps:
- Configure madclient.properties to enable
SSL.
contextFactory.useSSL=true contextFactory.secLib=SSL contextFactory.sslVersion=SSLv3 contextFactory.sslCertVerify=true - Set system properties for the truststore, truststore password, and truststore
type.
System.setProperty("javax.net.ssl.trustStore", <path_to_truststore>); System.setProperty("javax.net.ssl.trustStorePassword", <truststore_password>); System.setProperty("javax.net.ssl.trustStoreType", <truststore_type>); - If two way SSL authentication is needed, set the keystore for the
client.
System.setProperty("javax.net.ssl.keyStore", <path_to_keystore>); System.setProperty("javax.net.ssl.keyStorePassword", <keystore_password>); System.setProperty("javax.net.ssl.keyStoreType", <keystore_type>); - Call
setUseSSL(true)in the contextProvider.ctxProvider.setUseSSL(true);
- Configure madclient.properties to enable
SSL.