com.xebialabs.deployit.task
Class ArchivingTaskRegistry

java.lang.Object
  extended by com.xebialabs.deployit.task.ArchivingTaskRegistry
All Implemented Interfaces:
TaskRegistry

public class ArchivingTaskRegistry
extends java.lang.Object
implements TaskRegistry


Constructor Summary
ArchivingTaskRegistry()
           
 
Method Summary
 void afterPropertiesSet()
           
 void assignMyTask(java.lang.String taskId, java.lang.String owner)
          Assigns the given task to the specified owner.
 void assignTask(java.lang.String taskId, java.lang.String owner)
          Assigns the given task to the specified owner.
 void cancelTask(java.lang.String id)
           
protected  void deleteRecoveryFile()
           
 void destroy()
           
 java.util.List<Task> getAllIncompleteTasks()
          Returns ALL incomplete tasks for any user.
 java.util.List<Task> getIncompleteTasksForUser(java.lang.String username)
          Returns all incomplete tasks for the given username.
 Task getTask(java.lang.String id)
           
 TaskArchive getTaskArchive()
           
 java.util.Collection<Task> getTasks()
           
 java.lang.String registerTask(Task task)
           
 void setRecoveryFile(java.io.File recoveryFile)
           
 void setRecoveryFileWritingIntervalMillis(int recoveryFileWritingIntervalMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchivingTaskRegistry

public ArchivingTaskRegistry()
Method Detail

setRecoveryFile

public void setRecoveryFile(java.io.File recoveryFile)

setRecoveryFileWritingIntervalMillis

public void setRecoveryFileWritingIntervalMillis(int recoveryFileWritingIntervalMillis)

registerTask

public java.lang.String registerTask(Task task)
Specified by:
registerTask in interface TaskRegistry

getTask

public Task getTask(java.lang.String id)
Specified by:
getTask in interface TaskRegistry

cancelTask

public void cancelTask(java.lang.String id)
Specified by:
cancelTask in interface TaskRegistry

getTasks

public java.util.Collection<Task> getTasks()
Specified by:
getTasks in interface TaskRegistry

getIncompleteTasksForUser

public java.util.List<Task> getIncompleteTasksForUser(java.lang.String username)
Description copied from interface: TaskRegistry
Returns all incomplete tasks for the given username.

Specified by:
getIncompleteTasksForUser in interface TaskRegistry

getAllIncompleteTasks

public java.util.List<Task> getAllIncompleteTasks()
Description copied from interface: TaskRegistry
Returns ALL incomplete tasks for any user.

Specified by:
getAllIncompleteTasks in interface TaskRegistry

assignTask

public void assignTask(java.lang.String taskId,
                       java.lang.String owner)
Description copied from interface: TaskRegistry
Assigns the given task to the specified owner. Current user is assumed to be allowed to perform the assignment, no further checks are made.

Specified by:
assignTask in interface TaskRegistry

assignMyTask

public void assignMyTask(java.lang.String taskId,
                         java.lang.String owner)
Description copied from interface: TaskRegistry
Assigns the given task to the specified owner. Checks wether the current user is also the current owner of the task.

Specified by:
assignMyTask in interface TaskRegistry

afterPropertiesSet

@PostConstruct
public void afterPropertiesSet()

destroy

public void destroy()
Specified by:
destroy in interface TaskRegistry

deleteRecoveryFile

protected void deleteRecoveryFile()

getTaskArchive

public TaskArchive getTaskArchive()
Specified by:
getTaskArchive in interface TaskRegistry