PSClientAwareContextFactory mapFac = null;
try {
mapFac = PSClientAwareContextFactory.getInstance();
} catch (SAALException se) {
// return to login page
return;
}
//
// To get the global context (when session is not available)
//
ClientAwareAppContext caAppContext = null;
try {
caAppContext = mapFac.getClientAwareAppContext();
} catch (SAALException se) {
// return to login page
return;
}
//
// To get a user specific context - pass in the SSOAdapterSession
//
try {
ClientAwareUserContext caUserContext =
mapFac.getClientAwareUserContext(session);
} catch (IllegalStateException ie) {
// return to login page
return;
} catch (SAALException se) {
// return to login page
return;
}
Map serviceMap = new HashMap();
serviceMap.put ("serviceName", "DesktopMailService");
//
// The global attributes can be obtained using either the
// global context or the user context.
// Ex: When using a global context (without a session)
// Pass in the servicename (or any other) backend service
// specific requirements through the serviceMap
//
String mailConnectionPoolCacheSize =
caAppContext.getStringAttribute (serviceMap, "cachesize");
//
// To get a user specific attribute's value
//
String mailUserName =
caUserContext.getStringAttribute (serviceMap, "userName");
//
// Since the default behaviour of the API is to fetch
// User/Dynamic attributes, the serviceMap can be null.
//
String mailUserName =
caUserContext.getStringAttribute (null, "userName");