org.yawlfoundation.yawl.resourcing
Class TaskPrivileges

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.TaskPrivileges

public class TaskPrivileges
extends Object

Maps each of a set of User-Task Privileges to a set of Participants (if any) for one particular task. The mappings are listed in the specification file, and may map a privilege to individual participants and/or all the participants that fulfil a certain Role or Roles.

Author:
Michael Adams v0.1, 13/08/2007 Last Date: 20/09/2007

Field Summary
static int CAN_DEALLOCATE
           
static int CAN_DELEGATE
           
static int CAN_PILE
           
static int CAN_REALLOCATE_STATEFUL
           
static int CAN_REALLOCATE_STATELESS
           
static int CAN_SKIP
           
static int CAN_SUSPEND
           
 
Constructor Summary
TaskPrivileges()
           
TaskPrivileges(String taskID)
           
TaskPrivileges(YSpecificationID specID, String taskID)
           
 
Method Summary
 void addParticipantToPrivilegeUnchecked(String pid, int priv)
          grant the privilege to the Participant without checking the validity of the id.
 void addRoleToPrivilegeUnchecked(String rid, int priv)
          grant the privilege to the Role without checking the validity of the id.
 void allowAll(int privilege)
          grant a privilege to all Participants
 void allowAll(String privilegeStr)
           
 boolean canDeallocate(Participant p)
           
 boolean canDelegate(Participant p)
           
 boolean canPile(Participant p)
           
 boolean canReallocateStateful(Participant p)
           
 boolean canReallocateStateless(Participant p)
           
 boolean canSkip(Participant p)
           
 boolean canSuspend(Participant p)
          Convenience boolean methods - return true if the Particpant passed has been granted the privilege
 void disallowAll(int privilege)
          disallow a privilege for all Participants
 void disallowAll(String privilegeStr)
           
 int getPrivilegeType(String privStr)
          returns the privilege type for the string version passed
 YSpecificationID getSpecID()
           
 String getTaskID()
           
 void grant(int priv, Participant p)
          Grants a privilege to a Participant
 void grant(int priv, Set<Participant> pSet)
          Grants a privilege to set of Participant
 void grant(int priv, String id)
          Grants the privilege the Participant with id passed
 void grant(String privName, Participant p)
           
 void grant(String privName, Set<Participant> pSet)
           
 void grantByID(int priv, Set pSet)
          Grants a privilege to set of Participant using a set of ids
 void grantDeallocate(Participant p)
           
 void grantDeallocate(Set<Participant> p)
           
 void grantDeallocateByID(Set userids)
           
 void grantDeallocateByID(String userid)
           
 void grantDelegate(Participant p)
           
 void grantDelegate(Set<Participant> p)
           
 void grantDelegateByID(Set userids)
           
 void grantDelegateByID(String userid)
           
 void grantPile(Participant p)
           
 void grantPile(Set<Participant> p)
           
 void grantPileByID(Set userids)
           
 void grantPileByID(String userid)
           
 void grantReallocateStateful(Participant p)
           
 void grantReallocateStateful(Set<Participant> p)
           
 void grantReallocateStatefulByID(Set userids)
           
 void grantReallocateStatefulByID(String userid)
           
 void grantReallocateStateless(Participant p)
           
 void grantReallocateStateless(Set<Participant> p)
           
 void grantReallocateStatelessByID(Set userids)
           
 void grantReallocateStatelessByID(String userid)
           
 void grantSkip(Participant p)
           
 void grantSkip(Set<Participant> p)
           
 void grantSkipByID(Set userids)
           
 void grantSkipByID(String userid)
           
 void grantSuspend(Participant p)
          Convenience grant methods (by Participant, id, Participant set, id Set)
 void grantSuspend(Set<Participant> p)
           
 void grantSuspendByID(Set userids)
           
 void grantSuspendByID(String userid)
           
 boolean hasParticipants(int priv)
          returns true if at least one Participant has been granted the Privilege
 boolean hasPrivilege(Participant p, int privilege)
          returns true if the Participant has been granted the Privilege
 void parse(org.jdom.Element e, org.jdom.Namespace nsYawl)
          Parses the xml element passed into a set of privileges and who has them
 void setSpecID(YSpecificationID specID)
           
 void setTaskID(String taskID)
           
 String toXML()
          creates xml to describe the entire object
 String toXML(boolean full)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAN_SUSPEND

public static final int CAN_SUSPEND
See Also:
Constant Field Values

CAN_REALLOCATE_STATELESS

public static final int CAN_REALLOCATE_STATELESS
See Also:
Constant Field Values

CAN_REALLOCATE_STATEFUL

public static final int CAN_REALLOCATE_STATEFUL
See Also:
Constant Field Values

CAN_DEALLOCATE

public static final int CAN_DEALLOCATE
See Also:
Constant Field Values

CAN_DELEGATE

public static final int CAN_DELEGATE
See Also:
Constant Field Values

CAN_SKIP

public static final int CAN_SKIP
See Also:
Constant Field Values

CAN_PILE

public static final int CAN_PILE
See Also:
Constant Field Values
Constructor Detail

TaskPrivileges

public TaskPrivileges()

TaskPrivileges

public TaskPrivileges(String taskID)

TaskPrivileges

public TaskPrivileges(YSpecificationID specID,
                      String taskID)
Method Detail

getSpecID

public YSpecificationID getSpecID()

setSpecID

public void setSpecID(YSpecificationID specID)

getTaskID

public String getTaskID()

setTaskID

public void setTaskID(String taskID)

getPrivilegeType

public int getPrivilegeType(String privStr)
returns the privilege type for the string version passed


grant

public void grant(int priv,
                  String id)
Grants the privilege the Participant with id passed

Parameters:
priv - the privilege to grant
id - the id of the Participant (must be a known Participant id)

grant

public void grant(int priv,
                  Participant p)
Grants a privilege to a Participant

Parameters:
priv - the privilege to grant
p - the Participant

grant

public void grant(String privName,
                  Participant p)

grant

public void grant(int priv,
                  Set<Participant> pSet)
Grants a privilege to set of Participant

Parameters:
priv - the privilege to grant
pSet - the Participant Set

grant

public void grant(String privName,
                  Set<Participant> pSet)

grantByID

public void grantByID(int priv,
                      Set pSet)
Grants a privilege to set of Participant using a set of ids

Parameters:
priv - the privilege to grant
pSet - the Set of Participant ids

allowAll

public void allowAll(int privilege)
grant a privilege to all Participants


allowAll

public void allowAll(String privilegeStr)

disallowAll

public void disallowAll(int privilege)
disallow a privilege for all Participants


disallowAll

public void disallowAll(String privilegeStr)

addParticipantToPrivilegeUnchecked

public void addParticipantToPrivilegeUnchecked(String pid,
                                               int priv)
grant the privilege to the Participant without checking the validity of the id. Written to allow the editor to generate specification xml


addRoleToPrivilegeUnchecked

public void addRoleToPrivilegeUnchecked(String rid,
                                        int priv)
grant the privilege to the Role without checking the validity of the id. Written to allow the editor to generate specification xml


grantSuspend

public void grantSuspend(Participant p)
Convenience grant methods (by Participant, id, Participant set, id Set)


grantReallocateStateless

public void grantReallocateStateless(Participant p)

grantReallocateStateful

public void grantReallocateStateful(Participant p)

grantDeallocate

public void grantDeallocate(Participant p)

grantDelegate

public void grantDelegate(Participant p)

grantSkip

public void grantSkip(Participant p)

grantPile

public void grantPile(Participant p)

grantSuspend

public void grantSuspend(Set<Participant> p)

grantReallocateStateless

public void grantReallocateStateless(Set<Participant> p)

grantReallocateStateful

public void grantReallocateStateful(Set<Participant> p)

grantDeallocate

public void grantDeallocate(Set<Participant> p)

grantDelegate

public void grantDelegate(Set<Participant> p)

grantSkip

public void grantSkip(Set<Participant> p)

grantPile

public void grantPile(Set<Participant> p)

grantSuspendByID

public void grantSuspendByID(String userid)

grantReallocateStatelessByID

public void grantReallocateStatelessByID(String userid)

grantReallocateStatefulByID

public void grantReallocateStatefulByID(String userid)

grantDeallocateByID

public void grantDeallocateByID(String userid)

grantDelegateByID

public void grantDelegateByID(String userid)

grantSkipByID

public void grantSkipByID(String userid)

grantPileByID

public void grantPileByID(String userid)

grantSuspendByID

public void grantSuspendByID(Set userids)

grantReallocateStatelessByID

public void grantReallocateStatelessByID(Set userids)

grantReallocateStatefulByID

public void grantReallocateStatefulByID(Set userids)

grantDeallocateByID

public void grantDeallocateByID(Set userids)

grantDelegateByID

public void grantDelegateByID(Set userids)

grantSkipByID

public void grantSkipByID(Set userids)

grantPileByID

public void grantPileByID(Set userids)

canSuspend

public boolean canSuspend(Participant p)
Convenience boolean methods - return true if the Particpant passed has been granted the privilege


canReallocateStateless

public boolean canReallocateStateless(Participant p)

canReallocateStateful

public boolean canReallocateStateful(Participant p)

canDeallocate

public boolean canDeallocate(Participant p)

canDelegate

public boolean canDelegate(Participant p)

canSkip

public boolean canSkip(Participant p)

canPile

public boolean canPile(Participant p)

hasPrivilege

public boolean hasPrivilege(Participant p,
                            int privilege)
returns true if the Participant has been granted the Privilege


hasParticipants

public boolean hasParticipants(int priv)
returns true if at least one Participant has been granted the Privilege


parse

public void parse(org.jdom.Element e,
                  org.jdom.Namespace nsYawl)
Parses the xml element passed into a set of privileges and who has them

Parameters:
e - the element containing the privileges from the spec xml

toXML

public String toXML()
creates xml to describe the entire object


toXML

public String toXML(boolean full)


Copyright © 2004-2012 The YAWL Foundation.