Package org.duracloud.common.queue.task
Class Task
- java.lang.Object
-
- org.duracloud.common.queue.task.Task
-
public class Task extends Object
Represents a basic unit of work. In essence it describes "what" is to be done. It knows nothing of the "how".- Author:
- Daniel Bernstein
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Task.Type
-
Constructor Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(String key, String value)
boolean
equals(Object obj)
int
getAttempts()
The number of completed attempts to process this task.Map<String,String>
getProperties()
String
getProperty(String key)
Task.Type
getType()
Integer
getVisibilityTimeout()
int
hashCode()
void
incrementAttempts()
Increments the attempts property.String
removeProperty(String key)
void
setType(Task.Type type)
void
setVisibilityTimeout(Integer visibilityTimeout)
String
toString()
-
-
-
Field Detail
-
KEY_TYPE
public static final String KEY_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public Task.Type getType()
-
setType
public void setType(Task.Type type)
-
getVisibilityTimeout
public Integer getVisibilityTimeout()
-
setVisibilityTimeout
public void setVisibilityTimeout(Integer visibilityTimeout)
-
getAttempts
public int getAttempts()
The number of completed attempts to process this task.- Returns:
-
incrementAttempts
public void incrementAttempts()
Increments the attempts property. This method should only be called by TaskQueue implementations.
-
-