JobService
import io.skipcheck.tm1.client.service.security.JobService; Active jobs on TM1 12 (/Jobs): what each database replica is running right now,
which jobs are blocking it, its session and replica, and cancelling a job. Needs schema
12.2.0 (waitingOn needs 12.3.0); on TM1 11, every method fails with
Tm1UnsupportedOperationException before sending a request (use
ThreadService on TM1 11).
See what the server is busy with:
// Active jobs running on TM1 12
return tm1.jobs()
.list(ODataQuery.none().select(Job.ID, Job.DESCRIPTION, Job.STATE, Job.ELAPSED_TIME))
.map(job -> job.id() + ": " + job.description() + " (" + job.state() + ")");
Cancel a running job:
// Cancel an active job by its ID
return tm1.jobs().cancel(jobId);
Members
JobService constructor | A service sending its requests through session. |
list | GET Jobs, streamed. |
get | GET Jobs('id'). |
waitingOn | GET Jobs('id')/WaitingOn, streamed. |
session | The session this job is servicing. |
replica | The database replica this job is running on. |
cancel | Asks the job to stop what it's doing. |
JobService
constructorJobService(Tm1Session session) A service sending its requests through session.
Parameters
session- the session
list
Flux<Job> list(ODataQuery query) GET Jobs, streamed. Needs schema 12.2.0.
Parameters
query- what to select, filter and order
Returns
- the active jobs
TM1 REST EntitySet Jobs
get
Mono<Job> get(String id, ODataQuery query) GET Jobs('id'). Needs schema 12.2.0.
Parameters
id- the job's ID
query- what to select and expand
Returns
- the job, or a
Tm1NotFoundExceptionif it's gone
TM1 REST EntitySet Jobs
waitingOn
Flux<Job> waitingOn(String id, ODataQuery query) GET Jobs('id')/WaitingOn, streamed: the jobs blocking this job. Needs
schema 12.3.0.
Parameters
id- the job's ID
query- what to select and filter
Returns
- the blocking jobs
TM1 REST Navigation Job/WaitingOn
session
Mono<Session> session(String id, ODataQuery query) GET Jobs('id')/Session: the session this job is servicing. Needs schema
12.2.0.
Parameters
id- the job's ID
query- what to select
Returns
- the job's session
TM1 REST Navigation Job/Session
replica
Mono<DatabaseReplica> replica(String id, ODataQuery query) GET Jobs('id')/Replica: the database replica this job is running on. Needs
schema 12.2.0.
Parameters
id- the job's ID
query- what to select
Returns
- the job's database replica
TM1 REST Navigation Job/Replica
cancel
Mono<Void> cancel(String id) tm1.Cancel: asks the job to stop what it's doing. Needs schema 12.2.0.
Parameters
id- the job's ID
Returns
- completes when the request is accepted
TM1 REST Action Job/Cancel
Also in the Javadoc.