Personalized Session Timeouts for uPortal

Pre-beta work in progress

Note that this is a pre-beta code sketch work in progress. It has not been tested, performance profiled, packaged for release, or had any other love and care applied. Nonetheless, it is freely shared here.

License

As this code is intended to be available for direct inclusion in the uPortal codebase, it is available here under the New BSD license (standard for the project).

The files

  File Modified

ZIP Archive personalized_session_timeouts.zip updated version of PortalSessionManager

Nov 16, 2007 by Tuyhang Ly

The design

API for determining session timeout in seconds for a given IPerson. Hack to PortalSessionManager servlet to poll an instance of this API and apply the timeout. Couple of concrete implementations around delegating, simply implementing, and discriminating based on groups. Configure an instance in Spring applicationContext.xml which hacked PortalSessionManager servlet grabs via magic bean name.

THIS API IS PROBLEMATIC. Particularly, Andrew Petro isn't thrilled with the code duplication and runtime execution duplication the boolean "do I have an opinion" and the integer "what is my opinion" methods introduce. Possibly needs a TimeoutRecommendation domain object to return instead that could combine these.

Discriminators continue to proliferate in uPortal. Figuring out group membership in fragment application, permission application, and now session timeout application is all the same figuring out. Possibly this API should just bind to AudienceEvaluator and allow re-use of all of those.

How to use

The attached .zip contains source code for inclusion in uPortal, examples of changed source code from that appearing in the uPortal distribution, unit tests, and examples of changed configuration files to configure this system.

This amounts to a new package org.jasig.portal.services.sessiontimeout, an additional bean declaration in applicationContext.xml, and modifications to PortalSessionManager.java to make use of these.