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

Initializing the Client SDK

Before Access Manager Client SDK can communicate with Access Manager Server, you must initialize some properties in the client SDK. You can set these properties in one of three ways:

Using a Properties File

You can set properties in a properties file and then provide a path to it at runtime. The properties files must be in the CLASSPATH. The default properties file name is AMConfig.properties and is always read at start-up.

ProcedureTo Set ClientSDK Properties in a Properties File

  1. Generate a sample AMConfig.properties by running the following command:

    make -f Makefile.clientsdk properties

    The AMConfig.properties will be present in the temp directory.

  2. Edit properties to suit your environment.

  3. At runtime if the file name is different from AMConfig, provide the edited properties filename (without the .properties extension, and also with the path. The path should be in the CLASSPATH) by declaring the JVM option:

    -Damconfig=filname

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 ...
}


            

Setting Individual Properties

You can set properties one at a time. For example, you can declare the following JVM option at run time to assign a value to a particular property:

-DpropertyName=propertyValue

The following sections describe the properties expected by Access Manager Client SDK. A client application deployed within a servlet container can register for changes to session, user attributes and policy decisions. These properties must be set to receive such notifications.

Naming URL Properties

com.iplanet.am.naming.url. This is a required property. The value of this property represents the URL where the Client SDK would retrieve the URLs of Access Manager internal services. This is the URI for the Naming Service. Example:

com.iplanet.am.naming.url=http://AcceessManager-HostName.domain_name:
		port/ amserver/namingservice

com.iplanet.am.naming.failover.url. This property can be used by any remote SDK application that wants failover in, for example, session validation or getting the service URLs. Example:

com.iplanet.am.naming.failover.url= http:// 
		AcceessManager-HostName.domain_name:port/		amserver/failover

Debug Properties

com.iplanet.services.debug.level

Specifies the debug level. Possible values are levels are: off, error , warning, or message.

com.iplanet.services.debug.directory

The value of this property is the output directory for the debug information. This directory should be writable by the server process. Example:

com.iplanet.services.debug.directory=/var/opt/SUNWam/debug

.

Notification URL Properties

com.iplanet.am.notification.url.

The value of this property is the URI of the Notification Service running on the host machine where you installed the Client SDK. Example:

com.iplanet.am.notification.url= http://clientSDK_host.domain_name:
		port/amserver/notificationservice
com.sun.identity.agents.notification.enabled

This property enables or disables notifications for remote policy API. Example:

com.sun.identity.agents.notification.enabled=false

com.sun.identity.agents.notification.url

This property defines the notification URL for remote policy API.