|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Cache for application roles and users. The cache is meant to act as the Corporate directory interface for all IRole objects.
ICorporateDirectory | |
IRoleCache | |
IRole | IRole |
The primary purpose for the role cache is to provide a simple reverse
mapping between a user and the groups that user belongs to. This is
function is necessary to correctly display the workitems that belong to
a given user since workitems that are assigned to a group have as their
assignee id, a qualified role name (see the getQualifiedRoleName(java.lang.String, java.lang.String)
getQualifiedRoleName} method).
The cache is bound off the cluster bean (since it needs to be available for access from the IFinder). To prevent role name collisions, it will be necessary to qualify each role name with the application it comes from.
ICorporateDirectory
,
IRole
Method Summary | |
boolean |
contains(java.lang.String qRoleName,
java.lang.String userId)
Check if the specified user id is a member of the role specified by roleName . |
java.lang.String |
getQualifiedRoleName(java.lang.String appName,
java.lang.String roleName)
Returns the role name qualified with the name of the application it is defined in. |
java.lang.String[] |
getRoleUsers(java.lang.String qRoleName)
Returns the list of users that the role currently contains. |
java.lang.String |
getUnqualifiedRoleName(java.lang.String qRoleName)
Returns the unqualified role name from a qualified role name. |
java.lang.String[] |
getUserRoles(java.lang.String userId)
Returns a list of roles that the user belongs to. |
void |
refresh()
Refresh all the user/role information in the cache. |
void |
registerRole(IRole role,
java.util.Vector membership)
Register the role with the cache - that is, create an internal representation of the role within the cache. |
void |
setCorporateDirectory(ICorporateDirectory cd)
Binds the cluster corporate directory to the role cache. |
Method Detail |
public java.lang.String getQualifiedRoleName(java.lang.String appName, java.lang.String roleName)
Users should not rely on the format of the qualified role name to remain static and thus forgo the use of this method. The format may undergo changes in future versions.
appName
- the current application nameroleName
- the name of the role to qualifypublic java.lang.String getUnqualifiedRoleName(java.lang.String qRoleName)
Users should not rely on the format of the qualified role name to remain static and thus forgot the use of this method. The format may undergo changes in future versions.
qRoleName
- the qualified role name to unqualifypublic void setCorporateDirectory(ICorporateDirectory cd)
cd
- the cluster corporate directoryICorporateDirectory
public void registerRole(IRole role, java.util.Vector membership) throws PMException
Users should not concern themselves with this method, since all the roles associated with the applications are automatically registered as part of the application initialization phase.
role
- the role to register with the cachemembership
- the user membership list to associate with
the role; the value of this parameter will
differ according to the type of role being
registeredPMException
- if there is a problem with registering the
role with the cache.IRole
public boolean contains(java.lang.String qRoleName, java.lang.String userId)
roleName
. Returns true
if user id is a
member; otherwise returns false
.roleName
- a qualified role nameuserId
- the id of the user to check for role membershiptrue
if the user id is a member of the role;
false
otherwise.getQualifiedRoleName(java.lang.String, java.lang.String)
public java.lang.String[] getUserRoles(java.lang.String userId)
userId
- public java.lang.String[] getRoleUsers(java.lang.String qRoleName)
roleName
- qualified role namepublic void refresh() throws PMException
PMException
- if there is a problem with resolving one of
the roles currently registered with the
cache.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |