Package ai.preferred.venom.job
Class BasicJob
- java.lang.Object
-
- ai.preferred.venom.job.BasicJob
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Job job)HandlergetHandler()Get the handler to handle the response of the job.PrioritygetPriority()Get the current priority set for this job.RequestgetRequest()Get the request of this job.intgetTryCount()Get attempt number of this job.voidreQueue()Remove any existing in queue, downgrades the priority and adds the job back into queue.
-
-
-
Constructor Detail
-
BasicJob
public BasicJob(Request request, Handler handler, Priority priority, Priority priorityFloor, java.util.Queue<Job> queue)
Constructs a basic job.- Parameters:
request- The request of this job.handler- The handler of this job.priority- The priority of this job.priorityFloor- The priority floor of this job.queue- The queue for this job.
-
-
Method Detail
-
getRequest
public final Request getRequest()
Description copied from interface:JobGet the request of this job.- Specified by:
getRequestin interfaceJob- Returns:
- Request of the job.
-
getHandler
public final Handler getHandler()
Description copied from interface:JobGet the handler to handle the response of the job.If handler is null, routed handler will be used to assign a handler to the response, based on its criteria.
- Specified by:
getHandlerin interfaceJob- Returns:
- Handler for the response or null.
-
getPriority
public final Priority getPriority()
Description copied from interface:JobGet the current priority set for this job.- Specified by:
getPriorityin interfaceJob- Returns:
- the current priority of the job.
-
reQueue
public final void reQueue()
Description copied from interface:JobRemove any existing in queue, downgrades the priority and adds the job back into queue.
-
getTryCount
public final int getTryCount()
Description copied from interface:JobGet attempt number of this job.- Specified by:
getTryCountin interfaceJob- Returns:
- Attempt (try) count of the job.
-
-