net.incongru.taskman.hibernate
Class HibernatedTaskMan

java.lang.Object
  extended by net.incongru.taskman.hibernate.HibernatedTaskMan
All Implemented Interfaces:
TaskMan

public class HibernatedTaskMan
extends java.lang.Object
implements TaskMan

Version:
$Revision: $
Author:
greg, $Author: $ (last edit)

Nested Class Summary
protected  class HibernatedTaskMan.TaskContextImpl
           
 
Constructor Summary
HibernatedTaskMan(org.hibernate.Session session, TaskActionManager actionManager)
           
HibernatedTaskMan(org.hibernate.Session session, TaskActionManager actionManager, IdGenerator idGenerator)
           
 
Method Summary
 void addVariable(TaskInstance task, java.lang.String name, java.lang.Object value)
           
 void assign(TaskInstance task, Assignee newAssignee)
           
 void cancel(TaskInstance task)
           
 TaskDef deployTaskDef(TaskDefParser taskDefParser, boolean forceEvenIfEquals)
          Since a deployed TaskDef is by nature incomplete (doesn't have an id, versionId, nor deploymentDate), we here pass a TaskDefParser instance, which will somehow load our TaskDef definition (from an xml file for instance), and pass it on for actual deployment.
 java.util.List<TaskInstance> findRemainingTasks()
          For scheduler: find tasks which are due and not finished.
 java.util.List<TaskInstance> getPendingTasksByAssignee(Assignee assignee)
          Retrieves the pending tasks assigned to an assignee (or a group/pool of actors TODO ?), so that a specific actor can see what tasks he could do if he's bored.
 java.util.List<TaskInstance> getPendingTasksByReporterId(java.lang.String actorId)
          Retrieves the pending tasks assigned to this specific actor.
 TaskInstance getTaskById(java.lang.String taskId)
           
 java.util.List<TaskInstance> getTasksByAssignee(Assignee assignee)
          Retrieves all the tasks assigned to an assignee (or a group/pool of actors TODO ?).
 java.util.List<TaskInstance> getTasksByReporterId(java.lang.String actorId)
          Retrieves the tasks assigned to this specific actor.
 TaskInstance newTaskInstance(java.lang.String taskDefName, java.lang.String reporterId, java.lang.String taskId, java.lang.String taskName, java.lang.String taskDesc)
          Creates a new instance of a given task definition (the last deployed TaskDef with the given name), reported by the given userid, assigns it a specific id, name and description.
 void start(TaskInstance task)
           
 void stop(TaskInstance task)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernatedTaskMan

public HibernatedTaskMan(org.hibernate.Session session,
                         TaskActionManager actionManager)

HibernatedTaskMan

public HibernatedTaskMan(org.hibernate.Session session,
                         TaskActionManager actionManager,
                         IdGenerator idGenerator)
Method Detail

deployTaskDef

public TaskDef deployTaskDef(TaskDefParser taskDefParser,
                             boolean forceEvenIfEquals)
Description copied from interface: TaskMan
Since a deployed TaskDef is by nature incomplete (doesn't have an id, versionId, nor deploymentDate), we here pass a TaskDefParser instance, which will somehow load our TaskDef definition (from an xml file for instance), and pass it on for actual deployment.

Specified by:
deployTaskDef in interface TaskMan
forceEvenIfEquals - if false, the TaskDef will not be deployed if it is same as the latest deployed TaskDef with that name
See Also:
TaskDef.isSameAs(net.incongru.taskman.def.TaskDef)

getTaskById

public TaskInstance getTaskById(java.lang.String taskId)
Specified by:
getTaskById in interface TaskMan

getTasksByReporterId

public java.util.List<TaskInstance> getTasksByReporterId(java.lang.String actorId)
Description copied from interface: TaskMan
Retrieves the tasks assigned to this specific actor.

Specified by:
getTasksByReporterId in interface TaskMan

getPendingTasksByReporterId

public java.util.List<TaskInstance> getPendingTasksByReporterId(java.lang.String actorId)
Description copied from interface: TaskMan
Retrieves the pending tasks assigned to this specific actor.

Specified by:
getPendingTasksByReporterId in interface TaskMan

getTasksByAssignee

public java.util.List<TaskInstance> getTasksByAssignee(Assignee assignee)
Description copied from interface: TaskMan
Retrieves all the tasks assigned to an assignee (or a group/pool of actors TODO ?).

Specified by:
getTasksByAssignee in interface TaskMan

getPendingTasksByAssignee

public java.util.List<TaskInstance> getPendingTasksByAssignee(Assignee assignee)
Description copied from interface: TaskMan
Retrieves the pending tasks assigned to an assignee (or a group/pool of actors TODO ?), so that a specific actor can see what tasks he could do if he's bored.

Specified by:
getPendingTasksByAssignee in interface TaskMan

newTaskInstance

public TaskInstance newTaskInstance(java.lang.String taskDefName,
                                    java.lang.String reporterId,
                                    java.lang.String taskId,
                                    java.lang.String taskName,
                                    java.lang.String taskDesc)
Description copied from interface: TaskMan
Creates a new instance of a given task definition (the last deployed TaskDef with the given name), reported by the given userid, assigns it a specific id, name and description. Any of these last 3 parameters can be null, in which case they get a default value. (a generated id, null and null, respectively)

Specified by:
newTaskInstance in interface TaskMan

assign

public void assign(TaskInstance task,
                   Assignee newAssignee)
Specified by:
assign in interface TaskMan

start

public void start(TaskInstance task)
Specified by:
start in interface TaskMan

cancel

public void cancel(TaskInstance task)
Specified by:
cancel in interface TaskMan

stop

public void stop(TaskInstance task)
Specified by:
stop in interface TaskMan

addVariable

public void addVariable(TaskInstance task,
                        java.lang.String name,
                        java.lang.Object value)
Specified by:
addVariable in interface TaskMan
See Also:
TaskInstance.getVariableNames()

findRemainingTasks

public java.util.List<TaskInstance> findRemainingTasks()
Description copied from interface: TaskMan
For scheduler: find tasks which are due and not finished. Should then probably keep track of the last reminder ?

Specified by:
findRemainingTasks in interface TaskMan


Copyright © 2004-2007. All Rights Reserved.