Package ru.yoomoney.tech.dbqueue.api
Class TaskRecord
- java.lang.Object
-
- ru.yoomoney.tech.dbqueue.api.TaskRecord
-
public final class TaskRecord extends java.lang.ObjectRaw database record with task parameters and payload- Since:
- 09.07.2017
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTaskRecord.BuilderBuilder for theTaskRecordclass
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TaskRecord.Builderbuilder()booleanequals(java.lang.Object obj)longgetAttemptsCount()Get number of attempts to execute the task, including the current one.java.time.ZonedDateTimegetCreatedAt()Get date and time when the task was added into the queue.java.util.Map<java.lang.String,java.lang.String>getExtData()Get the map of external user-defined parameters, where the key is the column name in the tasks table.longgetId()Get unique (sequence id) identifier of the task.java.time.ZonedDateTimegetNextProcessAt()Get date and time of the next task execution.java.lang.StringgetPayload()Get raw task payload.longgetReenqueueAttemptsCount()Get number of attempts to postpone (re-enqueue) the task.longgetTotalAttemptsCount()Get sum of all attempts to execute the task, including all task re-enqueue attempts and all failed attempts.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getId
public long getId()
Get unique (sequence id) identifier of the task.- Returns:
- task identifier
-
getPayload
@Nullable public java.lang.String getPayload()
Get raw task payload.- Returns:
- task payload
-
getAttemptsCount
public long getAttemptsCount()
Get number of attempts to execute the task, including the current one.- Returns:
- number of attempts to execute the task.
-
getReenqueueAttemptsCount
public long getReenqueueAttemptsCount()
Get number of attempts to postpone (re-enqueue) the task.- Returns:
- number of attempts to postpone (re-enqueue) the task.
-
getTotalAttemptsCount
public long getTotalAttemptsCount()
Get sum of all attempts to execute the task, including all task re-enqueue attempts and all failed attempts.
This counter should never be reset.- Returns:
- sum of all attempts to execute the task
-
getCreatedAt
@Nonnull public java.time.ZonedDateTime getCreatedAt()
Get date and time when the task was added into the queue.- Returns:
- date and time when the task was added into the queue.
-
getNextProcessAt
@Nonnull public java.time.ZonedDateTime getNextProcessAt()
Get date and time of the next task execution.- Returns:
- Date and time of the next task execution.
-
getExtData
@Nonnull public java.util.Map<java.lang.String,java.lang.String> getExtData()
Get the map of external user-defined parameters, where the key is the column name in the tasks table.- Returns:
- map of external user-defined parameters, where the key is the column name in the tasks table.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static TaskRecord.Builder builder()
-
-