Interface JobContextConsumer

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JobContextConsumer
A concrete job: the code that runs asynchronously, receiving a JobContext for logging. Apps implement this interface (or pass a lambda) and hand instances to JobService.runAsJob(edu.ucsb.cs156.jobs.services.JobContextConsumer).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    default String
    Name recorded on the Job row and shown in the admin UI.
    default Long
    Optional scope: the id of the app-domain object this job belongs to.
    default String
    Optional scope: the kind of app-domain object this job belongs to (e.g.
  • Method Details

    • accept

      void accept(JobContext c) throws Exception
      Throws:
      Exception
    • getJobName

      default String getJobName()
      Name recorded on the Job row and shown in the admin UI.
    • getScopeType

      default String getScopeType()
      Optional scope: the kind of app-domain object this job belongs to (e.g. "course"). Null (the default) means the job is unscoped.
    • getScopeId

      default Long getScopeId()
      Optional scope: the id of the app-domain object this job belongs to.