org.openprivacy.reptile.tasks
Interface Task

All Known Implementing Classes:
BaseTask, FeedUpdateTask, PeerAdvertisementIndexTask, ProxyUpdateTask, SearchGCTask, SubscriptionProxyUpdateTask

public interface Task

Generic interface for running tasks in the background. These are basically just Threads.

Version:
$Id: Task.java,v 1.10 2002/03/23 22:31:35 burton Exp $
Author:
burtonator

Field Summary
static java.lang.String MESSAGE_SUCCESSFUL
           
static java.lang.String STATE_FAILED
          Task was just run but it failed.
static java.lang.String STATE_PAUSED
           
static java.lang.String STATE_RUNNING
           
static java.lang.String STATE_STOPPED
           
static java.lang.String TYPE_OCS
          Specify a Task type of OCS
static java.lang.String TYPE_RSS
          Specify a Task type of RSS
static java.lang.String TYPE_UNKNOWN
           
 
Method Summary
 java.lang.String getIdentifier()
          Get an identifier for this Task.
 long getInterval()
          Get the interval that this task must run.
 java.lang.String getLastMessage()
          Get the last message generated for this task.
 long getLastRan()
          Get the last time this task was ran.
 java.lang.String getState()
          Set the state for this Task.
 java.lang.String getType()
          Return the type of this Task.
 boolean isRunning()
          Return true if this task is running.
 void run()
          Just like a runnable but we can throw an Exception.
 void setIdentifier(java.lang.String identifier)
           
 void setInterval(long interval)
           
 void setLastMessage(java.lang.String message)
           
 void setLastMessage(java.lang.Throwable t)
           
 void setLastRan(long lastRan)
           
 void setState(java.lang.String state)
           
 void setType(java.lang.String type)
          Set the type of this Task.
 

Field Detail

TYPE_RSS

public static final java.lang.String TYPE_RSS
Specify a Task type of RSS

See Also:
Constant Field Values

TYPE_OCS

public static final java.lang.String TYPE_OCS
Specify a Task type of OCS

See Also:
Constant Field Values

TYPE_UNKNOWN

public static final java.lang.String TYPE_UNKNOWN
See Also:
Constant Field Values

MESSAGE_SUCCESSFUL

public static final java.lang.String MESSAGE_SUCCESSFUL
See Also:
Constant Field Values

STATE_STOPPED

public static final java.lang.String STATE_STOPPED
See Also:
Constant Field Values

STATE_PAUSED

public static final java.lang.String STATE_PAUSED
See Also:
Constant Field Values

STATE_RUNNING

public static final java.lang.String STATE_RUNNING
See Also:
Constant Field Values

STATE_FAILED

public static final java.lang.String STATE_FAILED
Task was just run but it failed.

See Also:
Constant Field Values
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Get an identifier for this Task.


setIdentifier

public void setIdentifier(java.lang.String identifier)
See Also:
getIdentifier()

getLastRan

public long getLastRan()
Get the last time this task was ran.


setLastRan

public void setLastRan(long lastRan)

getInterval

public long getInterval()
Get the interval that this task must run.


setInterval

public void setInterval(long interval)
See Also:
getInterval()

getLastMessage

public java.lang.String getLastMessage()
Get the last message generated for this task.


setLastMessage

public void setLastMessage(java.lang.String message)
See Also:
getLastMessage()

setLastMessage

public void setLastMessage(java.lang.Throwable t)
See Also:
getLastMessage()

getState

public java.lang.String getState()
Set the state for this Task.


setState

public void setState(java.lang.String state)
See Also:
setState

getType

public java.lang.String getType()
Return the type of this Task.


setType

public void setType(java.lang.String type)
Set the type of this Task.


isRunning

public boolean isRunning()
Return true if this task is running.


run

public void run()
         throws java.lang.Exception
Just like a runnable but we can throw an Exception.

java.lang.Exception