public class WS extends Object implements WSInterface
Constructor and Description |
---|
WS() |
Modifier and Type | Method and Description |
---|---|
Alive |
alive()
Get information about the engine
|
void |
checkIfLocal() |
boolean |
deleteBatch(String batchId)
Delete all jobs with the given batchId
|
boolean |
deleteClient(String clientId)
Delete a client
|
boolean |
deleteJob(String jobId)
Delete a single job
|
List<Job> |
getBatch(String batchId)
Get all jobs with the given batchId
|
Client |
getClient(String clientId)
Get a client
|
List<Client> |
getClients()
List all clients
|
DataType |
getDataType(String dataTypeId)
Get a single data type
|
Map<String,String> |
getDataTypes()
Get all data types
|
String |
getEndpoint()
Return which Pipeline 2 Web API endpoint is currently used
|
Job |
getJob(String jobId,
long msgSeq)
Get a single job
|
String |
getJobLog(String jobId)
Get the log file for a job
|
File |
getJobResultAsFile(String jobId,
String href)
Get results from a job as a File
|
InputStream |
getJobResultAsStream(String jobId,
String href)
Get results from a job as an InputStream
|
List<Job> |
getJobs()
Get all jobs
|
List<Property> |
getProperties()
Get the properties used in the Pipeline 2 engine
|
JobQueue |
getQueue()
Get the job queue
|
Script |
getScript(String scriptId)
Get a single script
|
List<Script> |
getScripts()
Get all scripts
|
String |
getShutDownKey()
Get the key meant to be used when invoking /admin/halt
|
JobSizes |
getSizes()
Get the size used to store each job
|
String |
getUsername()
Get the username used to authenticate with the Pipeline 2 Web API
|
boolean |
halt()
Stop the web service
|
JobQueue |
moveDownQueue(String jobId)
Move job down the queue
|
JobQueue |
moveUpQueue(String jobId)
Move job up the queue
|
Job |
postJob(Job job)
Submit a job to the engine
|
void |
setCredentials(String username,
String secret)
Set the credentials to use for the Pipeline 2 Web API.
|
void |
setEndpoint(String endpoint)
Set which Pipeline 2 Web API endpoint to use.
|
void |
setShutDownKey(String shutDownKey)
Set the key used when invoking /admin/halt to shut down the engine.
|
public void setEndpoint(String endpoint)
setEndpoint
in interface WSInterface
endpoint
- the endpoint to usepublic String getEndpoint()
WSInterface
getEndpoint
in interface WSInterface
public void setCredentials(String username, String secret)
setCredentials
in interface WSInterface
username
- the username to usesecret
- the secret to usepublic String getUsername()
WSInterface
getUsername
in interface WSInterface
public void setShutDownKey(String shutDownKey)
setShutDownKey
in interface WSInterface
shutDownKey
- the shutdown key to usepublic String getShutDownKey()
WSInterface
getShutDownKey
in interface WSInterface
public Alive alive()
WSInterface
alive
in interface WSInterface
public boolean halt()
WSInterface
halt
in interface WSInterface
public List<Property> getProperties()
WSInterface
getProperties
in interface WSInterface
public List<Script> getScripts()
WSInterface
getScripts
in interface WSInterface
public Script getScript(String scriptId)
WSInterface
getScript
in interface WSInterface
scriptId
- the ID of the scriptpublic Map<String,String> getDataTypes()
WSInterface
getDataTypes
in interface WSInterface
public DataType getDataType(String dataTypeId)
WSInterface
getDataType
in interface WSInterface
dataTypeId
- the ID of the datatypepublic List<Job> getJobs()
WSInterface
getJobs
in interface WSInterface
public Job getJob(String jobId, long msgSeq)
WSInterface
getJob
in interface WSInterface
jobId
- the job IDmsgSeq
- the number of the first message to includepublic Job postJob(Job job)
WSInterface
postJob
in interface WSInterface
job
- the job to postpublic boolean deleteJob(String jobId)
WSInterface
deleteJob
in interface WSInterface
jobId
- the job IDpublic JobSizes getSizes()
WSInterface
getSizes
in interface WSInterface
public List<Job> getBatch(String batchId)
WSInterface
getBatch
in interface WSInterface
batchId
- the batch IDpublic boolean deleteBatch(String batchId)
WSInterface
deleteBatch
in interface WSInterface
batchId
- the batch IDpublic String getJobLog(String jobId)
WSInterface
getJobLog
in interface WSInterface
jobId
- the job IDpublic InputStream getJobResultAsStream(String jobId, String href)
WSInterface
getJobResultAsStream
in interface WSInterface
jobId
- the job IDhref
- the relative path to the desired job result filepublic File getJobResultAsFile(String jobId, String href)
WSInterface
getJobResultAsFile
in interface WSInterface
jobId
- the job IDhref
- the relative path to the desired job result filepublic JobQueue getQueue()
WSInterface
getQueue
in interface WSInterface
public JobQueue moveUpQueue(String jobId)
WSInterface
moveUpQueue
in interface WSInterface
jobId
- the job IDpublic JobQueue moveDownQueue(String jobId)
WSInterface
moveDownQueue
in interface WSInterface
jobId
- the job IDpublic List<Client> getClients()
WSInterface
getClients
in interface WSInterface
public Client getClient(String clientId)
WSInterface
getClient
in interface WSInterface
clientId
- the client IDpublic boolean deleteClient(String clientId)
WSInterface
deleteClient
in interface WSInterface
clientId
- the client IDpublic void checkIfLocal()
Copyright © 2012–2022 The DAISY Consortium. All rights reserved.