public class TAPJob extends UWSJob
On the contrary to UWSJob
, it is loading parameters from
TAPParameters
instances rather than UWSParameters
. However,
TAPParameters
is an extension of UWSParameters
. That's what
allow the UWS library to use both TAPJob
and TAPParameters
.
Modifier and Type | Class and Description |
---|---|
static class |
TAPJob.NoDBConnectionAvailableException
This exception is thrown by a job execution when no database connection
are available anymore.
|
UWSJob.JobTimeOut
Modifier and Type | Field and Description |
---|---|
protected TAPExecutionReport |
execReport
Internal query execution report.
|
static java.lang.String |
FORMAT_VOTABLE
FORMAT value meaning the VOTable format: "votable".
|
static java.lang.String |
LANG_ADQL
LANG value meaning ADQL language: "ADQL".
|
static java.lang.String |
LANG_PQL
LANG value meaning PQL language: "PQL".
|
static java.lang.String |
PARAM_FORMAT
Name of the standard TAP parameter which specifies the output format
(format of a query result): "FORMAT".
|
static java.lang.String |
PARAM_LANGUAGE
Name of the standard TAP parameter which specifies the query language:
"LANG".
|
static java.lang.String |
PARAM_MAX_REC
Name of the standard TAP parameter which specifies the maximum number of
rows that must be returned in the query result: "MAXREC".
|
static java.lang.String |
PARAM_PROGRESSION
Name of the library parameter which informs about a query execution
progression: "PROGRESSION".
|
static java.lang.String |
PARAM_QUERY
Name of the standard TAP parameter which specifies the query to execute:
"QUERY".
|
static java.lang.String |
PARAM_REQUEST
Name of the standard TAP parameter which specifies the type of request
to execute: "REQUEST".
|
static java.lang.String |
PARAM_UPLOAD
Name of the standard TAP parameter which defines the tables to upload in
the database for the query execution: "UPLOAD".
|
static java.lang.String |
PARAM_VERSION
Name of the standard TAP parameter which specifies the version of the
TAP protocol that must be used: "VERSION".
|
static java.lang.String |
REQUEST_DO_QUERY
REQUEST value meaning an ADQL query must be executed: "doQuery".
|
static java.lang.String |
REQUEST_GET_CAPABILITIES
REQUEST value meaning VO service capabilities must be returned:
"getCapabilities".
|
protected TAPParameters |
tapParams
Parameters of this job for its execution.
|
static int |
UNLIMITED_MAX_REC
Special MAXREC value meaning the number of output rows is not limited.
|
static java.lang.String |
VERSION_1_0
VERSION value meaning the version 1.0 of TAP: "1.0".
|
ACTION_DELETE, ANONYMOUS_OWNER, creationTime, dateFormat, DEFAULT_DATE_FORMAT, errorSummary, inputParams, jobId, jobInfo, lastId, owner, PARAM_ACTION, PARAM_CREATION_TIME, PARAM_DESTRUCTION_TIME, PARAM_END_TIME, PARAM_ERROR_SUMMARY, PARAM_EXECUTION_DURATION, PARAM_JOB_ID, PARAM_JOB_INFO, PARAM_OWNER, PARAM_PARAMETERS, PARAM_PHASE, PARAM_QUOTE, PARAM_RESULTS, PARAM_RUN_ID, PARAM_START_TIME, PHASE_ABORT, PHASE_RUN, QUOTE_NOT_KNOWN, results, stopping, thread, UNLIMITED_DURATION, waitForStop
Constructor and Description |
---|
TAPJob(JobOwner owner,
TAPParameters tapParams)
Build a pending TAP job with the given parameters.
|
TAPJob(JobOwner owner,
TAPParameters tapParams,
java.lang.String requestID)
Build a pending TAP job with the given parameters.
|
TAPJob(java.lang.String jobID,
long creationTime,
JobOwner owner,
TAPParameters params,
long quote,
long startTime,
long endTime,
java.util.List<Result> results,
ErrorSummary error)
Restore a job in a state defined by the given parameters.
|
Modifier and Type | Method and Description |
---|---|
TAPExecutionReport |
getExecReport()
Get the execution report.
|
java.lang.String |
getFormat()
Get the value of the FORMAT parameter.
|
java.lang.String |
getLanguage()
Get the value of the LANG parameter.
|
int |
getMaxRec()
Get the value of the MAXREC parameter.
|
java.lang.String |
getQuery()
Get the value of the QUERY parameter (i.e.
|
java.lang.String |
getRequest()
Get the value of the REQUEST parameter.
|
DALIUpload[] |
getTablesToUpload()
Get the list of tables to upload in the database for the query execution.
|
TAPParameters |
getTapParams()
Get the object storing and managing the set of all (UWS and TAP)
parameters.
|
java.lang.String |
getUpload()
Get the value of the UPLOAD parameter.
|
java.lang.String |
getVersion()
Get the value of the VERSION parameter.
|
boolean |
isReadyForExecution()
Check whether this job is able to start right now.
|
void |
setExecReport(TAPExecutionReport execReport)
Set the execution report.
|
void |
start(boolean useManager)
Starts the job.
|
protected void |
stop()
Stops the thread that executes the work of this job.
|
abort, addObserver, addOrUpdateParameter, addOrUpdateParameter, addOrUpdateParameters, addOrUpdateParameters, addResult, applyPhaseParam, archive, clearResources, clearResources, equals, error, generateJobId, getAdditionalParameters, getAdditionalParameterValue, getCreationTime, getDestructionTime, getEndTime, getErrorSummary, getExecutionDuration, getExecutionManager, getFactory, getFileManager, getJobId, getJobInfo, getJobList, getLogger, getNbAdditionalParameters, getNbObservers, getNbResults, getObservers, getOwner, getParameter, getPhase, getPhaseManager, getQuote, getRestorationDate, getResult, getResults, getRunId, getStartTime, getTimeToWaitForEnd, getUrl, getWorkError, hashCode, isFinished, isRunning, isStopped, notifyObservers, removeAdditionalParameter, removeAllObservers, removeObserver, serialize, serialize, serialize, setDestructionTime, setEndTime, setErrorSummary, setExecutionDuration, setJobInfo, setJobList, setPhase, setPhase, setPhaseManager, setQuote, setRunId, setStartTime, setTimeToWaitForEnd, start, toString
serialize, serialize, serialize
public static final java.lang.String PARAM_REQUEST
public static final java.lang.String REQUEST_DO_QUERY
public static final java.lang.String REQUEST_GET_CAPABILITIES
public static final java.lang.String PARAM_LANGUAGE
public static final java.lang.String LANG_ADQL
public static final java.lang.String LANG_PQL
public static final java.lang.String PARAM_VERSION
public static final java.lang.String VERSION_1_0
public static final java.lang.String PARAM_FORMAT
public static final java.lang.String FORMAT_VOTABLE
public static final java.lang.String PARAM_MAX_REC
public static final int UNLIMITED_MAX_REC
public static final java.lang.String PARAM_QUERY
public static final java.lang.String PARAM_UPLOAD
public static final java.lang.String PARAM_PROGRESSION
protected TAPExecutionReport execReport
protected final TAPParameters tapParams
public TAPJob(JobOwner owner, TAPParameters tapParams) throws TAPException
Note:
If the parameter UWSJob.PARAM_PHASE
(phase) is given with the
value UWSJob.PHASE_RUN
the job execution starts immediately after the
job has been added to a job list or after
UWSJob.applyPhaseParam(JobOwner)
is called.
owner
- User who owns this job. MAY BE NULLtapParams
- Set of parameters.TAPException
- If one of the given parameters has a forbidden or
wrong value.public TAPJob(JobOwner owner, TAPParameters tapParams, java.lang.String requestID) throws TAPException
Note:
If the parameter UWSJob.PARAM_PHASE
(phase) is given with the
value UWSJob.PHASE_RUN
the job execution starts immediately after the
job has been added to a job list or after
UWSJob.applyPhaseParam(JobOwner)
is called.
owner
- User who owns this job. MAY BE NULLtapParams
- Set of parameters.requestID
- ID of the HTTP request which has initiated the creation
of this job.
Note: if NULL, empty or already used, a job ID will
be generated thanks to UWSJob.generateJobId()
.TAPException
- If one of the given parameters has a forbidden or
wrong value.public TAPJob(java.lang.String jobID, long creationTime, JobOwner owner, TAPParameters params, long quote, long startTime, long endTime, java.util.List<Result> results, ErrorSummary error) throws TAPException
UWSJob.setPhase(uws.job.ExecutionPhase, boolean)
, where the second
parameter is true.jobID
- ID of the job.creationTime
- Creation date/time of the job
(SHOULD NOT BE NEGATIVE OR NULL).owner
- User who owns this job.params
- Set of not-standard UWS parameters (i.e. what is
called by UWSJob
as additional parameters ;
they includes all TAP parameters).quote
- Quote of this job.startTime
- Date/Time at which this job started.
(if not null, it means the job execution was
finished, so a endTime should be provided)endTime
- Date/Time at which this job finished.results
- List of results.
NULL if the job has not been executed, has been
aborted or finished with an error.error
- Error with which this job ends.TAPException
- If one of the given parameters has a forbidden or
wrong value.public final TAPParameters getTapParams()
public final java.lang.String getRequest()
This value must be "doQuery".
public final java.lang.String getFormat()
public final java.lang.String getLanguage()
This value should always be "ADQL" in this version of the library
public final int getMaxRec()
If this value is negative, it means the number of output rows is not limited.
public final java.lang.String getQuery()
getLanguage()
, to execute).public final java.lang.String getVersion()
This value should be "1.0" in this version of the library.
public final java.lang.String getUpload()
This value must be formatted as specified by the TAP standard (= a semicolon separated list of DALI uploads).
public final DALIUpload[] getTablesToUpload()
The returned array is an interpretation of the UPLOAD parameter.
public final TAPExecutionReport getExecReport()
This report is available only during or after the job execution. It tells in which step the execution is, and how long was the previous steps. It can also give more information about the number of resulting rows and columns.
public final void setExecReport(TAPExecutionReport execReport) throws UWSException
IMPORTANT: This function can be called only if the job is running or is being restored, otherwise an exception would be thrown. It should not be used by implementors, but only by the internal library processing.
execReport
- An execution report.UWSException
- If this job has never been restored and is not
running.public final boolean isReadyForExecution()
Basically, this function try to get a database connection. If none is available, then this job can not start and this function return FALSE. In all the other cases, TRUE is returned.
Warning: This function will indirectly open and keep a database connection, so that the job can be started just after its call. If it turns out that the execution won't start just after this call, the DB connection should be closed in some way in order to save database resources.
public final void start(boolean useManager) throws UWSException
UWSJob
Note: This function does nothing if the job is already running!
start
in class UWSJob
useManager
- true to let the execution manager deciding
whether the job starts immediately or whether it
must be put in a queue until enough resources are
available,
false to start the execution immediately.UWSException
- If there is an error while changing the
execution phase or when starting the
corresponding thread.UWSJob.isRunning()
,
UWSFactory.createJobThread(UWSJob)
,
ExecutionManager.execute(UWSJob)
,
UWSJob.setPhase(ExecutionPhase)
,
UWSJob.isFinished()
,
UWSJob.startTime