| 1 | package edu.ucsb.cs156.jobs.services; | |
| 2 | ||
| 3 | /** | |
| 4 | * A concrete job: the code that runs asynchronously, receiving a {@link JobContext} for logging. | |
| 5 | * Apps implement this interface (or pass a lambda) and hand instances to {@link | |
| 6 | * JobService#runAsJob}. | |
| 7 | */ | |
| 8 | @FunctionalInterface | |
| 9 | public interface JobContextConsumer { | |
| 10 | void accept(JobContext c) throws Exception; | |
| 11 | ||
| 12 | /** Name recorded on the {@code Job} row and shown in the admin UI. */ | |
| 13 | default String getJobName() { | |
| 14 |
1
1. getJobName : replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getJobName → KILLED |
return getClass().getSimpleName(); |
| 15 | } | |
| 16 | ||
| 17 | /** | |
| 18 | * Optional scope: the kind of app-domain object this job belongs to (e.g. {@code "course"}). Null | |
| 19 | * (the default) means the job is unscoped. | |
| 20 | */ | |
| 21 | default String getScopeType() { | |
| 22 |
1
1. getScopeType : replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeType → KILLED |
return null; |
| 23 | } | |
| 24 | ||
| 25 | /** Optional scope: the id of the app-domain object this job belongs to. */ | |
| 26 | default Long getScopeId() { | |
| 27 |
1
1. getScopeId : replaced Long return value with 0L for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeId → KILLED |
return null; |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 14 |
1.1 |
|
| 22 |
1.1 |
|
| 27 |
1.1 |