org.jcreme.permissioning
Class Task

java.lang.Object
  extended byorg.jcreme.enumerations.Enumeration
      extended byorg.jcreme.permissioning.Task
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class Task
extends Enumeration

A Task represents an action from a functional point of view. It is associated to a purpose that defines the intention of the action. Each task is also associated to a Role. Users that hold that role are the only legitimate Users that can accomplish this Task.

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
protected static java.util.Hashtable fromName
           
protected  Purpose purpose
           
protected  Role role
           
protected  java.util.HashSet subTasks
           
 
Fields inherited from class org.jcreme.enumerations.Enumeration
 
Constructor Summary
protected Task(java.lang.String name)
           
 
Method Summary
 void addSubTask(Task t)
           
static boolean contains(java.lang.String name)
           
static Task get(java.lang.String name)
           
protected  java.util.Hashtable getFromName()
          This method is for internal use only.
 Purpose getPurpose()
           
 Role getRole()
           
 Task[] getSubTasks()
           
static Task[] getTasks()
           
static Enumeration[] getValues()
          This method enables to retrieve all the possible values of an Enumeration class.
 boolean isLeaf()
           
 boolean isSubTask(Task t)
           
static void remove(java.lang.String name)
           
 void removeSubTask(Task t)
           
 void setPurpose(Purpose p)
           
 void setRole(Role r)
           
 
Methods inherited from class org.jcreme.enumerations.Enumeration
compareTo, getName, readResolve, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fromName

protected static final java.util.Hashtable fromName

purpose

protected Purpose purpose

subTasks

protected java.util.HashSet subTasks

role

protected Role role
Constructor Detail

Task

protected Task(java.lang.String name)
Method Detail

setPurpose

public void setPurpose(Purpose p)

getPurpose

public Purpose getPurpose()

setRole

public void setRole(Role r)

getRole

public Role getRole()

getSubTasks

public Task[] getSubTasks()

addSubTask

public void addSubTask(Task t)
                throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

removeSubTask

public void removeSubTask(Task t)

isSubTask

public boolean isSubTask(Task t)

isLeaf

public boolean isLeaf()

get

public static Task get(java.lang.String name)

contains

public static boolean contains(java.lang.String name)

remove

public static void remove(java.lang.String name)

getFromName

protected java.util.Hashtable getFromName()
Description copied from class: Enumeration
This method is for internal use only.

Specified by:
getFromName in class Enumeration
Returns:
the Hashtable that links the enumerated values names with the actual enumerated value.
See Also:
Enumeration.getFromName()

getTasks

public static Task[] getTasks()

getValues

public static Enumeration[] getValues()
Description copied from class: Enumeration
This method enables to retrieve all the possible values of an Enumeration class. This method should be overriden in the subclasses to have the desired result. The method in this class returns an empty array.



Copyright 2006 null. All Rights Reserved.