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

  1. Start in a working directory. Copy the ISI_Client_xx.x. x .zip file from the workspace\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 the ISI_Client_xx.x.x .zip file.
  2. Create a subdirectory to hold your compiled code. Here we use the subdirectory classes.
  3. Write Java code to access the MasterDataService.
  4. 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 API
  • com.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:

  1. Instantiate a MasterDataContextProvider implementation.
  2. Instantiate a MasterDataLoginProvider implementation.
  3. Instantiate the MasterDataService.
  4. Set the LoginProvider and ContextProvider on the MasterDataService.
  5. Start methods on the MasterDataService.
  6. 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:
  1. Configure madclient.properties to enable SSL.
    contextFactory.useSSL=true
    contextFactory.secLib=SSL
    contextFactory.sslVersion=SSLv3
    contextFactory.sslCertVerify=true
  2. 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>);
  3. 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>);
  4. Call setUseSSL(true) in the contextProvider.
    ctxProvider.setUseSSL(true);