public final class JobUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<org.apache.http.HttpResponse,Option<Job>> |
jobFromHttpResponse |
| Modifier and Type | Method and Description |
|---|---|
static List<Job> |
getNonFinished(List<Job> jobs)
Get all jobs that are not in state
Job.Status.FINISHED. |
static com.entwinemedia.fn.data.Opt<String> |
getPayload(ServiceRegistry reg,
Job job)
Update the job from the service registry and get its payload.
|
static boolean |
isReadyToDispatch(Job job)
Returns
true if the job is ready to be dispatched. |
static Function<Job,MediaPackageElement> |
payloadAsMediaPackageElement(Job waiter,
ServiceRegistry reg)
Interpret the payload of a completed
Job as a MediaPackageElement. |
static Function<Job,MediaPackageElement> |
payloadAsMediaPackageElement(ServiceRegistry reg)
Interpret the payload of a completed
Job as a MediaPackageElement. |
static long |
sumQueueTime(List<Job> jobs)
Sum up the queue time of a list of jobs.
|
static com.entwinemedia.fn.data.Opt<Job> |
update(ServiceRegistry reg,
Job job)
Get the latest state of a job.
|
static JobBarrier.Result |
waitForJob(Job waiter,
ServiceRegistry reg,
Job job)
Check if
job is not done yet and wait in case. |
static Function<Job,JobBarrier.Result> |
waitForJob(Job waiter,
ServiceRegistry reg,
Option<Long> timeout)
|
static JobBarrier.Result |
waitForJob(Job waiter,
ServiceRegistry reg,
Option<Long> timeout,
Job job)
Check if
job is not done yet and wait in case. |
static JobBarrier.Result |
waitForJob(ServiceRegistry reg,
Job job)
Check if
job is not done yet and wait in case. |
static Function<Job,JobBarrier.Result> |
waitForJob(ServiceRegistry reg,
Option<Long> timeout)
|
static JobBarrier.Result |
waitForJob(ServiceRegistry reg,
Option<Long> timeout,
Job job)
Check if
job is not done yet and wait in case. |
static JobBarrier.Result |
waitForJobs(Job waiter,
ServiceRegistry reg,
Collection<Job> jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(Job waiter,
ServiceRegistry reg,
Job... jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(Job waiter,
ServiceRegistry reg,
long timeout,
Collection<Job> jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(Job waiter,
ServiceRegistry reg,
long timeout,
Job... jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(Job waiter,
ServiceRegistry reg,
long pollingInterval,
long timeout,
Job... jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(ServiceRegistry reg,
Collection<Job> jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(ServiceRegistry reg,
Job... jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(ServiceRegistry reg,
long timeout,
Collection<Job> jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static JobBarrier.Result |
waitForJobs(ServiceRegistry reg,
long timeout,
Job... jobs)
Waits for the result of a created barrier for
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. |
static Function<Job,Boolean> |
waitForJobSuccess(Job waiter,
ServiceRegistry reg,
Option<Long> timeout)
Wait for the job to complete and return the success value.
|
static Function<Job,Boolean> |
waitForJobSuccess(ServiceRegistry reg,
Option<Long> timeout)
Wait for the job to complete and return the success value.
|
public static com.entwinemedia.fn.data.Opt<String> getPayload(ServiceRegistry reg, Job job) throws NotFoundException, ServiceRegistryException
NotFoundExceptionServiceRegistryExceptionpublic static com.entwinemedia.fn.data.Opt<Job> update(ServiceRegistry reg, Job job) throws ServiceRegistryException
job parameter.ServiceRegistryExceptionpublic static JobBarrier.Result waitForJobs(Job waiter, ServiceRegistry reg, long pollingInterval, long timeout, Job... jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. The
waiter is the job which is waiting for the other jobs to finish.waiter - the job waiting for the other jobs to finishreg - the service registrypollingInterval - the time in miliseconds between two polling operationstimeout - the maximum amount of time to waitjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(Job waiter, ServiceRegistry reg, long timeout, Job... jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. The
waiter is the job which is waiting for the other jobs to finish.waiter - the job waiting for the other jobs to finishreg - the service registrytimeout - the maximum amount of time to waitjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(Job waiter, ServiceRegistry reg, Job... jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. The
waiter is the job which is waiting for the other jobs to finish.waiter - the job waiting for the other jobs to finishreg - the service registryjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(ServiceRegistry reg, long timeout, Job... jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval.reg - the service registrytimeout - the maximum amount of time to waitjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(ServiceRegistry reg, Job... jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval.reg - the service registryjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(Job waiter, ServiceRegistry reg, long timeout, Collection<Job> jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. The
waiter is the job which is waiting for the other jobs to finish.waiter - the job waiting for the other jobs to finishreg - the service registrytimeout - the maximum amount of time to waitjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(ServiceRegistry reg, long timeout, Collection<Job> jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval.reg - the service registrytimeout - the maximum amount of time to waitjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(Job waiter, ServiceRegistry reg, Collection<Job> jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval. The
waiter is the job which is waiting for the other jobs to finish.waiter - the job waiting for the other jobs to finishreg - the service registryjobs - the jobs to monitorpublic static JobBarrier.Result waitForJobs(ServiceRegistry reg, Collection<Job> jobs)
jobs, using registry to poll for the
outcome of the monitored jobs using the default polling interval.reg - the service registryjobs - the jobs to monitorpublic static JobBarrier.Result waitForJob(Job waiter, ServiceRegistry reg, Option<Long> timeout, Job job)
job is not done yet and wait in case.public static JobBarrier.Result waitForJob(ServiceRegistry reg, Option<Long> timeout, Job job)
job is not done yet and wait in case.public static JobBarrier.Result waitForJob(Job waiter, ServiceRegistry reg, Job job)
job is not done yet and wait in case.waiter - the job waiting for the other jobs to finishreg - the service registryjob - the job to monitorpublic static JobBarrier.Result waitForJob(ServiceRegistry reg, Job job)
job is not done yet and wait in case.public static boolean isReadyToDispatch(Job job) throws IllegalStateException
true if the job is ready to be dispatched.job - the jobtrue whether the job is ready to be dispatchedIllegalStateException - if the job status is unknownpublic static Function<Job,JobBarrier.Result> waitForJob(ServiceRegistry reg, Option<Long> timeout)
public static Function<Job,JobBarrier.Result> waitForJob(Job waiter, ServiceRegistry reg, Option<Long> timeout)
public static Function<Job,Boolean> waitForJobSuccess(Job waiter, ServiceRegistry reg, Option<Long> timeout)
public static Function<Job,Boolean> waitForJobSuccess(ServiceRegistry reg, Option<Long> timeout)
public static Function<Job,MediaPackageElement> payloadAsMediaPackageElement(Job waiter, ServiceRegistry reg)
Job as a MediaPackageElement. Wait for the job to complete if
necessary.public static Function<Job,MediaPackageElement> payloadAsMediaPackageElement(ServiceRegistry reg)
Job as a MediaPackageElement. Wait for the job to complete if
necessary.public static long sumQueueTime(List<Job> jobs)
public static List<Job> getNonFinished(List<Job> jobs)
Job.Status.FINISHED.Copyright © 2009–2021 Opencast Project. All rights reserved.