org.jwarp.flow.security
Interface IRoleManager

All Superinterfaces:
IConfigurable, IWorkflowSystemAware
All Known Implementing Classes:
RoleManager

public interface IRoleManager
extends IWorkflowSystemAware, IConfigurable

The role manager is the manager object which actually handles all role related stuff. Roles can created, removed and managed here. This class actually encapsulate the underlying communication to an actual implementation such as an EJB server containing the role definitions.


Method Summary
 IRole createRole(java.lang.String newName, java.lang.String description, IWorkflowSystem system, ITicket user)
          This creates a new global role within the given workflow system.
 IRole getRole(int id, ITicket user)
          Get a role.
 java.util.Iterator getRoles(IWorkflowSystem system, ITicket user)
          Return the global roles of a flow system.
 void removeRole(IRole role, ITicket user)
          Removes a role from the db.
 java.util.Iterator searchRoles(java.lang.String name, IWorkflowSystem system, IWorkflowModel model, IWorkflow flow, int user, ITicket admin)
          Search for roles.
 void updateRole(int id, java.lang.String newName, java.lang.String description, ITicket user)
          Update a roles value.
 
Methods inherited from interface org.jwarp.flow.IWorkflowSystemAware
getWorkflowSystem, setWorkflowSystem
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 

Method Detail

getRoles

public java.util.Iterator getRoles(IWorkflowSystem system,
                                   ITicket user)
                            throws java.lang.SecurityException
Return the global roles of a flow system.
Parameters:
system - The system
user - The user ticket
Returns:
The roles for according to the model
Throws:
java.lang.SecurityException - If access was denied.

createRole

public IRole createRole(java.lang.String newName,
                        java.lang.String description,
                        IWorkflowSystem system,
                        ITicket user)
                 throws InitializationException,
                        java.lang.SecurityException
This creates a new global role within the given workflow system.
Parameters:
newName - The name of the new role
description - The roles description
system - The system
user - The user ticket
Returns:
The newly created role
Throws:
InitializationException - If the role could not be created.
java.lang.SecurityException - If access was denied.

updateRole

public void updateRole(int id,
                       java.lang.String newName,
                       java.lang.String description,
                       ITicket user)
                throws NotFoundException,
                       java.lang.SecurityException
Update a roles value.
Parameters:
id - The roles id
newName - The new roles name
description - The new roles description
user - The user ticket
Returns:
The newly created role
Throws:
java.lang.SecurityException - If access was denied.
NotFoundException - If the role could not be located.

removeRole

public void removeRole(IRole role,
                       ITicket user)
                throws NotFoundException,
                       java.lang.SecurityException
Removes a role from the db. Note that a role can only be removed if all dependencies are also removed. Dependencies are transitions that act as this role.
Parameters:
role - The role
user - The user
Throws:
NotFoundException - If the role could not be located.
java.lang.SecurityException - If access was denied.

getRole

public IRole getRole(int id,
                     ITicket user)
              throws java.lang.SecurityException
Get a role.
Parameters:
id - The role's id number
user - The user ticket
Returns:
The role
Throws:
java.lang.SecurityException - If access was denied.

searchRoles

public java.util.Iterator searchRoles(java.lang.String name,
                                      IWorkflowSystem system,
                                      IWorkflowModel model,
                                      IWorkflow flow,
                                      int user,
                                      ITicket admin)
                               throws java.lang.SecurityException
Search for roles.
Parameters:
name - The role's name
system - The workflow system
model - The workflow model
flow - The workflow
user - Return the roles a user with the given id can act as
admin - The user ticket
Returns:
The role
Throws:
java.lang.SecurityException - If access was denied.

©   O R C A   S y s t e m s