com.netscape.pm.model
Interface IRoleManager


public interface IRoleManager

The manager/container for all the roles defined in the process definition for the current application. The IRoleManager is a part of the application's process definition; a handle to the role manager can be obtained via the IProcessDefinition interface.

See Also:
IRole, IProcessDefinition

Method Summary
 boolean containsRole(java.lang.String roleName)
          Returns true if the given role name corresponds to a role that has been registered with the role manager.
 IRole getRole(java.lang.String roleName)
          Returns the role with name roleName.
 java.util.Enumeration resolveRoles(IParticipant p)
          Returns an enumeration of the names of the roles the user belongs to.
 java.util.Enumeration resolveRoles(IParticipant p, IProcessInstance pi)
          Returns an enumeration of the names of the roles the user belongs to, given the context of the process instance.
 java.util.Enumeration roles()
          Returns a list of all the defined roles registered with the role manager.
 

Method Detail

containsRole

public boolean containsRole(java.lang.String roleName)
Returns true if the given role name corresponds to a role that has been registered with the role manager.
Parameters:
roleName - the name of the role to check
Returns:
true if the role has been registered with the role manager; false otherwise.
Since:
PM 6.0

getRole

public IRole getRole(java.lang.String roleName)
              throws PMException
Returns the role with name roleName. This method will throw an exception if there is no role with name roleName. Users should use containsRole instead to check if the role exists if that is the main intention.
Parameters:
roleName - the name of the role to fetch
Returns:
the role with name roleName.
Throws:
PMException - if there is no such role registered with the role manager.
Since:
PAE 4.0
See Also:
containsRole(java.lang.String), IRole

resolveRoles

public java.util.Enumeration resolveRoles(IParticipant p,
                                          IProcessInstance pi)
                                   throws PMException
Returns an enumeration of the names of the roles the user belongs to, given the context of the process instance. This method may be used in lieu of the getRoleUsers method of the IRoleCache interface; this method returns the set of role names the user belongs to within the context of this application, whereas the IRoleCache method returns the qualified role names of all the roles the user belongs to within the context of the cluster.
Parameters:
p - the user to search for
pi - the process instance to establish context
Returns:
an enumeration of the names of roles that the user is a member of.
Throws:
PMException - if there is a problem resolving any role's membership roster.
Since:
PAE 4.0
See Also:
IParticipant, IProcessInstance

resolveRoles

public java.util.Enumeration resolveRoles(IParticipant p)
                                   throws PMException
Returns an enumeration of the names of the roles the user belongs to. This method differs from the method resolveRoles( IParticipant ) in that this method should be called where there is no process instance to establish context. Users should note that the only role that relies upon the process instance to resolve itself is a data field role; thus this method can be used successfully in situations where a process instance is not available.
Parameters:
p - the user to search for
Returns:
an enumeration of the names of roles that the user is a member of.
Throws:
PMException - if there is a problem resolving any role's membership roster.
Since:
PAE 4.0
See Also:
IParticipant

roles

public java.util.Enumeration roles()
Returns a list of all the defined roles registered with the role manager.
Returns:
an enumeration of the IRole objects that have been registered with the role manager.
Since:
PAE 4.0
See Also:
IRole