Class PushTeamsToCanvasJob

java.lang.Object
edu.ucsb.cs156.frontiers.jobs.PushTeamsToCanvasJob
All Implemented Interfaces:
edu.ucsb.cs156.jobs.services.JobContextConsumer

public class PushTeamsToCanvasJob extends Object implements edu.ucsb.cs156.jobs.services.JobContextConsumer
Updates the groups in a Canvas group set to match the teams in Frontiers: creates a Canvas group for each team that has none, adds and removes group members so that each group's membership matches the team's, and deletes Canvas groups that do not correspond to any team. A team is matched to a group by the team's stored Canvas id first, then by name. Staff teams are skipped: they have no students, so there is nothing to put in a Canvas group.

Problems with a single team, group or student (a student who is not enrolled in the Canvas course, a Canvas API call that fails) are logged as warnings and the job proceeds; only a failure to read the group set or the Canvas roster fails the job.

  • Constructor Details

    • PushTeamsToCanvasJob

      public PushTeamsToCanvasJob()
  • Method Details

    • getScopeType

      public String getScopeType()
      Specified by:
      getScopeType in interface edu.ucsb.cs156.jobs.services.JobContextConsumer
    • getScopeId

      public Long getScopeId()
      Specified by:
      getScopeId in interface edu.ucsb.cs156.jobs.services.JobContextConsumer
    • accept

      public void accept(edu.ucsb.cs156.jobs.services.JobContext ctx) throws Exception
      Specified by:
      accept in interface edu.ucsb.cs156.jobs.services.JobContextConsumer
      Throws:
      Exception