public class DefaultTAPBackupManager extends DefaultUWSBackupManager
Let backup all TAP asynchronous jobs.
note: Basically the saved data are the same, but in addition some execution statistics are also added.
DefaultUWSBackupManager
DefaultUWSBackupManager.JSONArrayReader, DefaultUWSBackupManager.JSONObjectReader, DefaultUWSBackupManager.SingleInputIterator
AT_USER_ACTION, backupFreq, byUser, DEFAULT_FREQUENCY, enabled, lastBackup, lastRestoration, MANUAL, timAutoBackup, uws
Constructor and Description |
---|
DefaultTAPBackupManager(UWS uws)
Build a default TAP jobs backup manager.
|
DefaultTAPBackupManager(UWS uws,
boolean byUser)
Build a default TAP jobs backup manager.
|
DefaultTAPBackupManager(UWS uws,
boolean byUser,
long frequency)
Build a default TAP jobs backup manager.
|
DefaultTAPBackupManager(UWS uws,
long frequency)
Build a default TAP jobs backup manager.
|
Modifier and Type | Method and Description |
---|---|
protected org.json.JSONObject |
getDALIUploadJson(DALIUpload upl)
Get the JSON representation of the given
DALIUpload . |
protected org.json.JSONObject |
getJSONJob(UWSJob job,
java.lang.String jlName)
Serializes the given job into a JSON object.
|
protected void |
restoreOtherJobParams(org.json.JSONObject json,
UWSJob job)
Restores other job parameters, either from the given JSON object or from the parameters map of the given job.
|
fromBase64, getBackupFreq, getError, getJSONJobInfo, getJSONUser, getLastBackup, getLastRestoration, getLogger, getParameters, getResult, getResults, getUploadFile, getUploadJson, getUser, isEnabled, restoreAll, restoreJob, restoreJobInfo, saveAll, saveOwner, saveOwner, setBackupFreq, setEnabled, toBase64
public DefaultTAPBackupManager(UWS uws)
uws
- The UWS containing all the jobs to backup.DefaultUWSBackupManager.DefaultUWSBackupManager(UWS)
public DefaultTAPBackupManager(UWS uws, long frequency)
uws
- The UWS containing all the jobs to backup.frequency
- The backup frequency (in ms ; MUST BE positive and different from 0.
If negative or 0, the frequency will be automatically set to DEFAULT_FREQUENCY).DefaultUWSBackupManager.DefaultUWSBackupManager(UWS, long)
public DefaultTAPBackupManager(UWS uws, boolean byUser) throws UWSException
uws
- The UWS containing all the jobs to backup.byUser
- Backup mode.UWSException
DefaultUWSBackupManager.DefaultUWSBackupManager(UWS, boolean)
public DefaultTAPBackupManager(UWS uws, boolean byUser, long frequency) throws UWSException
uws
- The UWS containing all the jobs to backup.byUser
- Backup mode.frequency
- The backup frequency (in ms ; MUST BE positive and different from 0.
If negative or 0, the frequency will be automatically set to DEFAULT_FREQUENCY).UWSException
DefaultUWSBackupManager.DefaultUWSBackupManager(UWS, boolean, long)
protected org.json.JSONObject getJSONJob(UWSJob job, java.lang.String jlName) throws UWSException, org.json.JSONException
DefaultUWSBackupManager
Serializes the given job into a JSON object.
note:
the structure of the returned JSON object is decided by Json4Uws.getJson(UWSJob)
.
Only one attribute is added: "jobListName".
getJSONJob
in class DefaultUWSBackupManager
job
- The job to save.jlName
- Name of the jobs list containing the given job.UWSException
- If there is an error while getting job parameters and serializing them.org.json.JSONException
- If there is an error while building the JSON object.protected org.json.JSONObject getDALIUploadJson(DALIUpload upl) throws org.json.JSONException
DALIUpload
.upl
- The DALI upload specification to serialize in JSON.org.json.JSONException
- If there is an error while building the JSON object.protected void restoreOtherJobParams(org.json.JSONObject json, UWSJob job) throws UWSException
DefaultUWSBackupManager
Restores other job parameters, either from the given JSON object or from the parameters map of the given job. The job is supposed to be updated after the call of this function.
note: By default, this function does nothing ! It is called by DefaultUWSBackupManager.restoreJob(JSONObject, Map)
just after the default restoration from the given JSON and just before to add the job in its dedicated jobs list.
restoreOtherJobParams
in class DefaultUWSBackupManager
json
- JSON backup of the given job.job
- Default restoration of the job.UWSException
- If there is an error while restoring other job parameters.DefaultUWSBackupManager.restoreJob(JSONObject, Map)