Sun Identity Manager 8.1 System Administrator's Guide

To Debug an Adapter

    Follow these general steps to debug your custom adapter.

  1. Create a test program for your adapter, and be sure this Java file performs the following basic functions:

    1. Create a new resource

    2. Create a user

    3. Get a user

    4. Update a user

    5. Delete a user

    6. Perform create, get, update and delete operations on multiple users


      Note –

      A sample test file (SkeletonResourceTests.java) is provided in the /REF directory on your installation CD.


  2. Set an appropriate logging level for debugging.

    For example, for the first debugging pass, increase the logging level to 4 (maximum debugging output), set the log file path, and specify a maximum file size.

    When you start the adapter, all of the resource settings are written to the log file. You can use this information to validate that the adapter started and that all setting changes were saved.

  3. Compile and test your adapter.

    • To compile the test program, open a command window and enter the javac -d . test/filename.java command. This command creates the class file in the appropriate com/waveset/adapter/test directory.

    • To test your new adapter using this class file, be sure that your compiled adapter is in the com/waveset/adapter directory and use the following command to run the adapter:


      java– D waveset.home=path com.waveset.adapter.test.
      MyResourceAdapter
      
  4. Create an HTML help file for your resource.


    Note –
    • Example help files are supplied in the idm.jar file located in the com/waveset/msgcat/help/resources directory.

    • See Sun Identity Manager Deployment Reference for information about how to include online help with the application.


  5. (For Active Sync-enabled adapters only) To reset synchronization on the last resource, delete the XmlData SYNC_resourceName object.

  6. Read the error log and modify the adapter.

  7. Reset the logging level.

    For example, specifying Level 2 debugging yields information about the adapter settings and any errors, but limits the amount of log detail to a manageable level.

  8. Before starting Identity Manager, you must identify the new adapter in the $WSHOME/config/Waveset.properties file by placing the adapter name under the resource.adapters entry or Identity Manager cannot recognize the adapter.

  9. Install your adapter and its associated help file into Identity Manager.


    Note –

    Before Identity Manager can recognize an instance of a new adapter in the display, you must create a new resource of that type from the List Resource page.

    From this page, select New -> new adapter and use the Resource Wizard to create the new adapter.


  10. Use Identity Manager to create a resource and a user on that resource.


    Tip –

    When troubleshooting an Active Sync-enabled adapter, if you edit the XmlData SYNC_resourceName object to remove the MapEntry for the Active Sync synchronization process from the Debug page, the adapter starts over from the first detected change.

    If you used the IAPI event, you must set the Property() method to store synchronization state for the resource, such as a last change processed value. Setting this method is very useful for troubleshooting adapters. You can set the adapter to run and ignore past changes. Subsequently, you can modify the adapter and see your change results in the adapter log file.


    If your resource is an Active Sync resource, you might see additional information if you enable logging on the resource edit page. Set the logging level (0-4) and the file path where the log file will be written (as resource_name.log).

  11. (For Active Sync-enabled adapters only) Restart synchronization for the last resource.