de.danet.an.workflow.spis.rms
Interface ResourceManagementService


public interface ResourceManagementService

This interface defines the workflow resource management service used in the workflow package.


Method Summary
 WfResource asResource(java.security.Principal principal)
          Given a principal, return the workflow resource associated with this principal by the resource management facility.
 java.util.Collection authorizers(WfResource resource)
          Given a WfResource object, return the collection of resources this resource is authorized for.
 java.util.Collection listResources()
          List all available resources.
 WfResource resourceByKey(java.lang.String key)
          Given a key, return the workflow resource associated with this key.
 java.util.Collection selectResources(java.lang.Object resSel)
          This optional method selects resources based on the resource selection criteria passed as parameter.
 

Method Detail

asResource

public WfResource asResource(java.security.Principal principal)
                      throws ResourceNotFoundException,
                             java.rmi.RemoteException
Given a principal, return the workflow resource associated with this principal by the resource management facility.

This method is usually used to get a WfResource object corresponding to the current user. The WfResource object can subsequently be used to e.g. determine the current user's worklist.

Parameters:
principal - the principal.
Returns:
a WfResource object corresponding to the given principal.
Throws:
ResourceNotFoundException - if the StaffMember with the given key can't be found or the key is not associate with an StaffMember object.
java.rmi.RemoteException - if a system-level error occurs.

authorizers

public java.util.Collection authorizers(WfResource resource)
                                 throws java.rmi.RemoteException
Given a WfResource object, return the collection of resources this resource is authorized for.

This method usually returns all groups the resource is a member of and all roles assigned to the resource.

Parameters:
resource - the resource.
Returns:
a collection of WfResource objects, not including resource
Throws:
java.rmi.RemoteException - if a system-level error occurs.

resourceByKey

public WfResource resourceByKey(java.lang.String key)
                         throws ResourceNotFoundException,
                                java.rmi.RemoteException
Given a key, return the workflow resource associated with this key.

This method is usually used to get a WfResource object corresponding to the given key.

Parameters:
key - the key.
Returns:
a WfResource object corresponding to the given key.
Throws:
ResourceNotFoundException - if the StaffMember or an StaffGroup with the given key can't be found.
java.rmi.RemoteException - if a system-level error occurs.

listResources

public java.util.Collection listResources()
                                   throws java.rmi.RemoteException
List all available resources.

Returns:
collection of WfResource objects.
Throws:
java.rmi.RemoteException - if a system-level error occurs.

selectResources

public java.util.Collection selectResources(java.lang.Object resSel)
                                     throws java.rmi.RemoteException,
                                            java.lang.UnsupportedOperationException
This optional method selects resources based on the resource selection criteria passed as parameter.

Usually, criteria for the resource selection must be determined within the resource assignment, based on the list of resources obtained with listResources. Implementations of resource management facilities may, however, support some query functionality that eases this task for the resource assignment service. The resource assignment service may have received such resource selection information from the workflow engine via autoAssignResources (the workflow component has obtained the information probably as part of the process description and passed it through transparently).

Parameters:
resSel - an object that describes resource selection criteria.
Returns:
collection of WfResource objects.
Throws:
java.rmi.RemoteException - if a system-level error occurs.
java.lang.UnsupportedOperationException - if the resource management service does not support this feature.