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 classTask.Type
-
Constructor Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(String key, String value)booleanequals(Object obj)intgetAttempts()The number of completed attempts to process this task.Map<String,String>getProperties()StringgetProperty(String key)Task.TypegetType()IntegergetVisibilityTimeout()inthashCode()voidincrementAttempts()Increments the attempts property.StringremoveProperty(String key)voidsetType(Task.Type type)voidsetVisibilityTimeout(Integer visibilityTimeout)StringtoString()
-
-
-
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.
-
-