R
- the request type associated to the jobpublic abstract class AbstractJobStatus<R extends Request> extends Object implements JobStatus, CancelableJobStatus
JobStatus
.JobStatus.State
Constructor and Description |
---|
AbstractJobStatus(R request,
JobStatus parentJobStatus,
org.xwiki.observation.ObservationManager observationManager,
org.xwiki.logging.LoggerManager loggerManager)
Deprecated.
since 9.2RC1, use
AbstractJobStatus(String, Request, JobStatus, ObservationManager, LoggerManager) instead |
AbstractJobStatus(String jobType,
R request,
JobStatus parentJobStatus,
org.xwiki.observation.ObservationManager observationManager,
org.xwiki.logging.LoggerManager loggerManager) |
Modifier and Type | Method and Description |
---|---|
void |
answered()
Indicate that the question has been answered.
|
void |
ask(Object question) |
boolean |
ask(Object question,
long time,
TimeUnit unit) |
void |
cancel()
Cancel the job.
|
Date |
getEndDate() |
Throwable |
getError() |
String |
getJobType() |
org.xwiki.logging.LogQueue |
getLog()
Deprecated.
|
List<org.xwiki.logging.event.LogEvent> |
getLog(org.xwiki.logging.LogLevel level)
Deprecated.
|
org.xwiki.logging.tail.LoggerTail |
getLoggerTail() |
org.xwiki.logging.tail.LogTail |
getLogTail() |
JobStatus |
getParentJobStatus() |
JobProgress |
getProgress() |
Object |
getQuestion() |
long |
getQuestionTimeLeft(TimeUnit unit) |
R |
getRequest() |
Date |
getStartDate() |
JobStatus.State |
getState() |
void |
ignoreLogs(boolean ignore) |
boolean |
isCancelable() |
boolean |
isCanceled() |
boolean |
isIsolated() |
boolean |
isSerialized() |
boolean |
isSubJob() |
void |
setCancelable(boolean cancelable) |
void |
setEndDate(Date endDate) |
void |
setError(Throwable error) |
void |
setIsolated(boolean isolated) |
void |
setLoggerTail(org.xwiki.logging.tail.LoggerTail loggerTail) |
void |
setStartDate(Date startDate) |
void |
setState(JobStatus.State state) |
void |
startListening()
Start listening to events.
|
void |
stopListening()
Stop listening to events.
|
@Deprecated public AbstractJobStatus(R request, JobStatus parentJobStatus, org.xwiki.observation.ObservationManager observationManager, org.xwiki.logging.LoggerManager loggerManager)
AbstractJobStatus(String, Request, JobStatus, ObservationManager, LoggerManager)
insteadrequest
- the request provided when started the jobparentJobStatus
- the status of the parent job (i.e. the status of the job that started this one); pass
null
if this job hasn't been started by another job (i.e. if this is not a sub-job)observationManager
- the observation manager componentloggerManager
- the logger manager componentpublic AbstractJobStatus(String jobType, R request, JobStatus parentJobStatus, org.xwiki.observation.ObservationManager observationManager, org.xwiki.logging.LoggerManager loggerManager)
jobType
- the type of the jobrequest
- the request provided when started the jobparentJobStatus
- the status of the parent job (i.e. the status of the job that started this one); pass
null
if this job hasn't been started by another job (i.e. if this is not a sub-job)observationManager
- the observation manager componentloggerManager
- the logger manager componentpublic void startListening()
@Unstable public void ignoreLogs(boolean ignore)
ignore
- true to ignore logs produced by the job executionpublic void stopListening()
public String getJobType()
getJobType
in interface JobStatus
public JobStatus.State getState()
public void setState(JobStatus.State state)
state
- the general state of the jobpublic Throwable getError()
public void setError(Throwable error)
error
- the Throwable
on which the job stoppedpublic R getRequest()
getRequest
in interface JobStatus
public org.xwiki.logging.tail.LogTail getLogTail()
getLogTail
in interface JobStatus
public org.xwiki.logging.tail.LoggerTail getLoggerTail()
LoggerTail
instancepublic void setLoggerTail(org.xwiki.logging.tail.LoggerTail loggerTail)
loggerTail
- the logger tailpublic JobProgress getProgress()
getProgress
in interface JobStatus
public void ask(Object question) throws InterruptedException
ask
in interface JobStatus
question
- the question to ask as a Java beanInterruptedException
- if the current thread is interrupted (and interruption of thread suspension is
supported)public boolean ask(Object question, long time, TimeUnit unit) throws InterruptedException
ask
in interface JobStatus
question
- the question to ask as a Java beantime
- the maximum time to waitunit
- the time unit of the time
argumentfalse
if the waiting time detectably elapsed before return from the method, else true
InterruptedException
- if the current thread is interrupted (and interruption of thread suspension is
supported)public long getQuestionTimeLeft(TimeUnit unit)
getQuestionTimeLeft
in interface JobStatus
unit
- the time unit of the returned valuepublic Object getQuestion()
getQuestion
in interface JobStatus
public void answered()
JobStatus
public Date getStartDate()
getStartDate
in interface JobStatus
public void setStartDate(Date startDate)
startDate
- the date and time when the job has been startedpublic Date getEndDate()
getEndDate
in interface JobStatus
public void setEndDate(Date endDate)
endDate
- the date and time when the job finishedpublic boolean isSubJob()
public boolean isIsolated()
isIsolated
in interface JobStatus
public void setIsolated(boolean isolated)
isolated
- true if the job log should be grabbedpublic JobStatus getParentJobStatus()
null
if
the job has no parent, i.e. if the job hasn't been started by another jobpublic boolean isCancelable()
isCancelable
in interface CancelableJobStatus
true
if the job support being canceledpublic void setCancelable(boolean cancelable)
cancelable
- true if the job can be canceledpublic void cancel()
cancel
in interface CancelableJobStatus
CancelableJobStatus.cancel()
public boolean isCanceled()
isCanceled
in interface CancelableJobStatus
true
if the job was canceled, false
otherwiseCancelableJobStatus.isCanceled()
public boolean isSerialized()
isSerialized
in interface JobStatus
@Deprecated public org.xwiki.logging.LogQueue getLog()
@Deprecated public List<org.xwiki.logging.event.LogEvent> getLog(org.xwiki.logging.LogLevel level)
Copyright © 2004–2021 XWiki. All rights reserved.