Sun Java System Access Manager 7 2005Q4 Developer's Guide

Using the Java API

The ClientSDK properties can also be set programmatically using the class: com.iplanet.am.util.SystemProperties. See Using the Java API.


Example 1–1 Setting ClientSDK Properties


import com.iplanet.am.util.SystemProperties;
import java.util.Properties;
public static void main(String[] args) {
        // To initialize a set of properties
        Properties props = new Properties();
        props.setProperty(”com.iplanet.am.naming.url’, 
					”http://sample.com/amserver/namingservice’);
        props.setProperty(”com.sun.identity.agents.app.username’, ”amAdmin’);
        props.setProperty(”com.iplanet.am.service.password’, ”11111111’);
        SystemProperties.initializeProperties(props) ;

        // To initialize a single property
        SystemProperties.initializeProperties(“com.iplanet.am.naming.url’, 
					”http://sample.com/amserver/namingservice’);
    // Application specific code ...
}