public final class DefaultJobTable extends Object implements JobTable
JobTable
.JobTable.Connection, JobTable.Job, JobTable.JobServices
Modifier and Type | Method and Description |
---|---|
void |
close() |
static DefaultJobTable |
create() |
Optional<JobTable.Connection> |
getConnection(JobID jobId)
Gets the connection registered under jobId.
|
Optional<JobTable.Connection> |
getConnection(ResourceID resourceId)
Gets the connection registered under resourceId.
|
Optional<JobTable.Job> |
getJob(JobID jobId)
Gets the job registered under jobId.
|
Collection<JobTable.Job> |
getJobs()
Gets all registered jobs.
|
<E extends Exception> |
getOrCreateJob(JobID jobId,
SupplierWithException<? extends JobTable.JobServices,E> jobServicesSupplier)
Gets a registered
JobTable.Job or creates one if not present. |
boolean |
isEmpty()
Returns
true if the job table does not contain any jobs. |
public <E extends Exception> JobTable.Job getOrCreateJob(JobID jobId, SupplierWithException<? extends JobTable.JobServices,E> jobServicesSupplier) throws E extends Exception
JobTable
JobTable.Job
or creates one if not present.getOrCreateJob
in interface JobTable
jobId
- jobId identifies the job to getjobServicesSupplier
- jobServicesSupplier create new JobTable.JobServices
if a
new job needs to be createdE
- if the job services could not be createdE extends Exception
public Optional<JobTable.Job> getJob(JobID jobId)
JobTable
getJob
in interface JobTable
jobId
- jobId identifying the job to getOptional
containing the JobTable.Job
registered under jobId, or an empty
Optional
if no job has been registeredpublic Optional<JobTable.Connection> getConnection(JobID jobId)
JobTable
getConnection
in interface JobTable
jobId
- jobId identifying the connection to getOptional
containing the JobTable.Connection
registered under jobId, or an
empty Optional
if no connection has been registered (this could also mean that a
job which has not been connected exists)public Optional<JobTable.Connection> getConnection(ResourceID resourceId)
JobTable
getConnection
in interface JobTable
resourceId
- resourceId identifying the connection to getOptional
containing the JobTable.Connection
registered under resourceId, or
an empty Optional
if no connection has been registeredpublic Collection<JobTable.Job> getJobs()
JobTable
public boolean isEmpty()
JobTable
true
if the job table does not contain any jobs.public static DefaultJobTable create()
public void close()
close
in interface AutoCloseable
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.