AuthzGroup Refreshing Issue (Fnd SAK-6261)

Problem statement:

Currently, Realm information is updated with provider changes only when
A) a user logs in, and then only the information in the realm relating to that user get updated and
B) when the Update Participants button is selected in the Site Info tool.

When a client calls AuthzGroupService.getAuthzGroup(z), what information is returned? Specifically, a Realm object with references to Sakai's (internal) database objects relating to that realm. Those objects include in some cases, references to internally and externally defined users and there roles and permissions in the realm. Two types of realms which typically can have interanl and external user information are Sites, and Groups which map to Sections in the CourseManagementService.

Contract
Clients of the AuthzGroupService.getAuthzGroup(z) should be presented with the most up-to-date information possible about the realm z that is available.

Assumptions
Various implementations of 'provided' information to realms impose a wide variety of costs for getting the latest information about realm memberhips.

Dirty Cache Problem
I is useful to look at this issue as having similar characteristics as any typical cache implelentation might have. The purpose of a cache is to reduce average access time for data. And there are many ways to approach the codification of a cost/benefit analysis for deciding when to use a cached value for any given environment.

In this case, the cached data is the realm information stored in the internal Sakai database tables relating to authzGroups. The cache is determined to be 'dirty' (needs to be updated with the latest data) if