org.springframework.extensions.surf.task
Interface Task

All Known Implementing Classes:
AbstractTask, ImportTask

public interface Task

Task interface

Author:
muzquiano

Method Summary
 void cancel()
          Cancels the task
 void execute()
          Executes the task
 String getCreator()
          Returns the creator of the task
 String getDescription()
          Returns the description of the task
 Date getEndTime()
          The end time of the task
 List<String> getHistory()
          Full history of all status updates to the task
 String getId()
          Returns the internal id of the task
 String getName()
          Returns the name of the task
 int getProgress()
          Returns how far the task has progressed down the progress bar.
 int getProgressSize()
          Returns the total size of the progress bar.
 Date getStartTime()
          The start time of the task
 String getStatus()
          Current status of the task
 Throwable getThrowable()
          If the task resulted in an error, retrieves the throwable obtained by the task worker thread.
 void increment()
          Increments the progress
 boolean isCancelled()
          Whether the task was cancelled
 boolean isError()
          Whether the task resulted in an error
 boolean isFinished()
          Whether the tasks completed
 boolean isRunning()
          Whether the task is still running
 boolean isSuccess()
          Whether the task completed successfully
 void setCreator(String creator)
          Sets the creator of the task
 void setDescription(String description)
          Sets a description for the task
 void setStatus(String status)
          Sets the status
 

Method Detail

getId

String getId()
Returns the internal id of the task

Returns:
id

getName

String getName()
Returns the name of the task

Returns:
name

setDescription

void setDescription(String description)
Sets a description for the task

Parameters:
description -

getDescription

String getDescription()
Returns the description of the task

Returns:
description

setCreator

void setCreator(String creator)
Sets the creator of the task

Parameters:
creator -

getCreator

String getCreator()
Returns the creator of the task

Returns:
creator

getProgress

int getProgress()
Returns how far the task has progressed down the progress bar.

Returns:
progress count

getProgressSize

int getProgressSize()
Returns the total size of the progress bar.

Returns:
progress bar total size

increment

void increment()
Increments the progress


execute

void execute()
             throws Throwable
Executes the task

Throws:
Throwable

cancel

void cancel()
Cancels the task


isError

boolean isError()
Whether the task resulted in an error

Returns:

isSuccess

boolean isSuccess()
Whether the task completed successfully

Returns:

isFinished

boolean isFinished()
Whether the tasks completed

Returns:

isRunning

boolean isRunning()
Whether the task is still running

Returns:

isCancelled

boolean isCancelled()
Whether the task was cancelled

Returns:

getStartTime

Date getStartTime()
The start time of the task

Returns:

getEndTime

Date getEndTime()
The end time of the task

Returns:

getThrowable

Throwable getThrowable()
If the task resulted in an error, retrieves the throwable obtained by the task worker thread.

Returns:

setStatus

void setStatus(String status)
Sets the status

Parameters:
status -

getStatus

String getStatus()
Current status of the task

Returns:

getHistory

List<String> getHistory()
Full history of all status updates to the task

Returns:


Copyright © 2009 SpringSource, Inc. All Rights Reserved.