The OpenSSO Cache is Not The Enemy
A cache is a collection of frequently accessed data that duplicates original values computed earlier and stored in a main memory store. In a write-through cache, every write to the cache causes a synchronous write to the main memory store. In a write-back cache, writes are not immediately mirrored to the store; the cache tracks which of its data locations have been written over and the data in these locations is collected and written to the main memory store all at once. A clean entry accurately reflects the contents of the main memory store and a dirty entry does not.
Two main OpenSSO components that rely heavily on caching are the Service Management and Identity Repository classes. When caching is enabled and a client invokes these services, the resulting session data is captured by the Client SDK and written to its local cache. To enable caching for the service management and identity repository services on the machine in which the Client SDK is installed, a combination oftrue and false values for the following properties are defined in AMConfig.properties on the Client SDK host machine.
NOTE: AMConfig.properties is used to store configuration data for the Client SDK (for example, the information needed to point the Client SDK to a remote instance of OpenSSO) and must be accessible from the machine on which the Client SDK is hosted. It is created during installation of the Client SDK.
com.iplanet.am.sdk.caching.enabledenables both caches when set totrue(default). A value offalsedisables both caches.com.sun.identity.idm.cache.enabledcontrols the Identity Repository cache. Whencom.iplanet.am.sdk.caching.enabledis set tofalse, enable the Identity Repository cache ONLY with a value oftrue. A value offalsekeeps it disabled.com.sun.identity.sm.cache.enabledcontrols the Service Management cache. Whencom.iplanet.am.sdk.caching.enabledis set tofalse, enable the Service Management cache ONLY with a value oftrue. A value offalsekeeps it disabled.
com.iplanet.am.sdk.cache.maxSize, also in AMConfig.properties, limits the size of the Identity Repository cache to, by default, 10000 entries. There is no corresponding entry to limit the cache size for the Service Management cache.
When caching is enabled, OpenSSO has three options that can be used to invalidate dirty cache entries. The first is to set up a URL with which the OpenSSO server can send session change notifications to clients on remote web containers. This works for web and standalone applications that can listen for HTTP(s) traffic. The second method (which works ONLY if notification is disabled) is polling. In this case, the client periodically checks the OpenSSO server for session changes. The third method is referred to as Time-to-Live (TTL) and enforces a limit on the period of time dirty data remains in the cache before it is discarded. See the following sections for more information.
- Configuring for Notification
- Configuring for Polling
- Configuring for TTL
- Sample Configuration
- The Enemy
com.sun.identity.client.notification.urldefines the URI of the Notification Service running on the host machine on which the Client SDK is installed; by default,http://SDK-host.domain:port /opensso/notificationservice. This value is used for both the Service Management and Identity Repository caches. If no URL is specified, notification is disabled.com.sun.identity.idm.remote.notification.enabledis used to enable or disable the notifications for the Identity Repository cache. If set totruenotifications are enabled;falsedisabled. If there is no value defined, it defaults totrue.
com.sun.identity.sm.notification.enabled is used to enable or disable the notifications for the Service Management cache. If set to true notifications are enabled; false disabled. If there is no value defined, it defaults to true.com.sun.identity.client.notification.url contains no value. The following properties relate to polling and are configured on the machine in which the Client SDK is installed.
com.sun.identity.sm.cacheTimeis the time (in minutes) that the Service Management cache will poll for updates.com.iplanet.am.sdk.remote.pollingTimeis the time (in minutes) that the Identity Repository cache (and the legacy AM SDK classes cache) will poll for updates.
com.sun.identity.idm.cache.entry.expire.enabledtakes a value oftrueorfalsewhich enables or disables respectively the Identity Repository TTL feature.com.sun.identity.idm.cache.entry.default.expire.timespecifies the time (in minutes) that non-user Identity Repository cache entries remain valid after their last modification. In other words, after the specified time (by default, one minute) has elapsed (following a modification or directory read), the data for the cached entry will expire and new requests for this data must be read from the directory.com.sun.identity.idm.cache.entry.user.expire.timespecifies the time (in minutes) that user Identity Repository cache entries remain valid after their last modification. In other words, after the specified time (by default, one minute) has elapsed (following a modification or directory read), the data for the cached entry will expire and new requests for this data must be read from the directory.com.sun.identity.sm.cache.ttl.enabletakes a value oftrueorfalsewhich enables or disables respectively the Service Management TTL feature.com.sun.identity.sm.cache.ttlspecifies the time (in minutes) that Service Management cache entries remain valid after their last modification. In other words, after the specified time (by default, 30 minutes) has elapsed (following a modification or directory read), the data for the cached entry will expire and new requests for this data must be read from the directory.- NOTE ON LEGACY SUPPORT: To enable TTL for the
com.iplanet.am.sdkclasses, configurecom.iplanet.am.sdk.cache.entry.expire.enabled,com.iplanet.am.sdk.cache.entry.user.expire.time, andcom.iplanet.am.sdk.cache.entry.default.expire.time.
- Enable caching for Service Management and Identity Repository
com.iplanet.am.sdk.caching.enabled=falsecom.sun.identity.idm.cache.enabled=truecom.sun.identity.sm.cache.enabled=true
- Disable notifications for Service Management and Identity Repository
com.sun.identity.idm.remote.notification.enabled=falsecom.sun.identity.sm.notification.enabled=false
- Enable TTL for Service Management, Identity Repository and, if desired, the legacy AM SDK.
com.sun.identity.sm.cache.ttl.enable=truecom.sun.identity.sm.cache.ttl=30
com.sun.identity.idm.cache.entry.expire.enabled=truecom.sun.identity.idm.cache.entry.user.expire.time=1com.sun.identity.idm.cache.entry.default.expire.time=1com.iplanet.am.sdk.cache.entry.expire.enabled=truecom.iplanet.am.sdk.cache.entry.user.expire.time=1com.iplanet.am.sdk.cache.entry.default.expire.time=1- Enable polling for Service Management and disable polling for Identity Repository
com.iplanet.am.sdk.remote.pollingTime=0com.sun.identity.sm.cacheTime=10
Posted at 03:44PM Feb 06, 2009 by Michael Teger in Sun | Comments[1]

Nice - The Enemy, from Coventry, my hometown :-)
Not sure I'd classify it as old school punk, though...
Posted by Pat Patterson on February 06, 2009 at 05:42 PM PST #