org.jwarp.flow.security
Class RoleManager

java.lang.Object
  |
  +--org.jwarp.flow.security.RoleManager
All Implemented Interfaces:
IConfigurable, IRoleManager, IWorkflowSystemAware

public class RoleManager
extends java.lang.Object
implements IRoleManager

This is a component of the flow manager modelling roles. Each user acts in a certain role if he does interact with the system. By now these roles can be modeled but no concrete functinoality is depending on it. But future releases probably will use that information.


Field Summary
protected  java.util.LinkedList roles
          The list od currently defined roles.
 
Constructor Summary
RoleManager()
          Constructs a new RoleManager.
 
Method Summary
 void configure(org.jdom.Element config)
          Pass the Configuration to the Configurable class.
 IRole createRole(java.lang.String name, java.lang.String description, IWorkflowSystem system, ITicket user)
          This creates a new global role within the given workflow system.
 java.util.Iterator getGlobalRoles(IWorkflowSystem system, ITicket user)
          Return the global roles of a flow system.
 IRole getRole(int id, ITicket user)
          Getting a role given its internal id.
 java.util.Iterator getRoles(IWorkflowSystem system, ITicket user)
          Return all the roles valid for a model.
 IWorkflowSystem getWorkflowSystem()
           
 void removeRole(IRole role, ITicket user)
          This method removes a role from the repository.
 java.util.Iterator searchRoles(java.lang.String name, IWorkflowSystem system, IWorkflowModel model, IWorkflow flow, int user, ITicket admin)
          Search roles.
 void setWorkflowSystem(IWorkflowSystem system)
           
 void updateRole(int id, java.lang.String newName, java.lang.String description, ITicket user)
          Updates a role
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roles

protected java.util.LinkedList roles
The list od currently defined roles.
Constructor Detail

RoleManager

public RoleManager()
Constructs a new RoleManager.
Method Detail

configure

public void configure(org.jdom.Element config)
Description copied from interface: IConfigurable
Pass the Configuration to the Configurable class. This method must always be called after the constructor and before any other method.
Specified by:
configure in interface IConfigurable
Following copied from interface: org.jwarp.service.configuration.IConfigurable
Parameters:
configuration - the class configurations.

getRoles

public java.util.Iterator getRoles(IWorkflowSystem system,
                                   ITicket user)
                            throws java.lang.SecurityException
Return all the roles valid for a model. This method returns the model specific roles as also the flow system globally defined roles.
Specified by:
getRoles in interface IRoleManager
Parameters:
model - The model
user - The user ticket
Returns:
The roles for according to the model
Throws:
java.lang.SecurityException - If access was denied.

getGlobalRoles

public java.util.Iterator getGlobalRoles(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 name,
                        java.lang.String description,
                        IWorkflowSystem system,
                        ITicket user)
                 throws InitializationException,
                        java.lang.SecurityException
This creates a new global role within the given workflow system.
Specified by:
createRole in interface IRoleManager
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
Updates a role
Specified by:
updateRole in interface IRoleManager
Following copied from interface: org.jwarp.flow.security.IRoleManager
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.

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 roles.
Specified by:
searchRoles in interface IRoleManager
Parameters:
The - role name
The - corresponding workflow
The - user that can act in this role
The - user who tries to perform the role search request
Returns:
The matching roles

getRole

public IRole getRole(int id,
                     ITicket user)
              throws java.lang.SecurityException
Getting a role given its internal id.
Specified by:
getRole in interface IRoleManager
Parameters:
id - The role's id
Returns:
The corresponding role instance or null

removeRole

public void removeRole(IRole role,
                       ITicket user)
                throws NotFoundException,
                       java.lang.SecurityException
This method removes a role from the repository.
Specified by:
removeRole in interface IRoleManager
Parameters:
role - The role to be removed
Throws:
NotRFoundException - If the role passed could not be found

setWorkflowSystem

public void setWorkflowSystem(IWorkflowSystem system)
Specified by:
setWorkflowSystem in interface IWorkflowSystemAware

getWorkflowSystem

public IWorkflowSystem getWorkflowSystem()
Specified by:
getWorkflowSystem in interface IWorkflowSystemAware

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