Package com.nicholasalfonso.lato.service
Class SyncService
java.lang.Object
com.nicholasalfonso.lato.service.SyncService
Service for synchronizing course and assignment data from LMS providers via iCalendar feeds.
-
Constructor Summary
ConstructorsConstructorDescriptionSyncService(IntegrationRepository integrationRepository, ICSDownloader iCSDownloader, LMSAdapterRegistry lMSAdapterRegistry, CourseRepository courseRepository, AssignmentRepository assignmentRepository) Creates the sync service with required repositories and adapter registry. -
Method Summary
Modifier and TypeMethodDescriptionsyncIntegration(Integration integration) Synchronizes a single LMS integration with the LMS provider.voidsyncUserIntegrations(User user) Synchronizes all LMS integrations for the given user.updateAssignments(Integration integration, Set<ImportedAssignment> importedAssignments) Updates the assignments for a given integration.
-
Constructor Details
-
SyncService
public SyncService(IntegrationRepository integrationRepository, ICSDownloader iCSDownloader, LMSAdapterRegistry lMSAdapterRegistry, CourseRepository courseRepository, AssignmentRepository assignmentRepository) Creates the sync service with required repositories and adapter registry.- Parameters:
integrationRepository- repository for integration accessiCSDownloader- downloader for iCalendar feed retrievallMSAdapterRegistry- registry for LMS adapter resolutioncourseRepository- repository for course persistenceassignmentRepository- repository for assignment persistence
-
-
Method Details
-
syncUserIntegrations
Synchronizes all LMS integrations for the given user.- Parameters:
user- the user whose integrations should be synced
-
syncIntegration
Synchronizes a single LMS integration with the LMS provider.- Parameters:
integration- the integration to sync- Returns:
- response containing imported courses and assignments
-
updateAssignments
public Set<ImportedAssignment> updateAssignments(Integration integration, Set<ImportedAssignment> importedAssignments) Updates the assignments for a given integration.- Parameters:
integration- The integration for which to update assignments.importedAssignments- The set of imported assignments to update.- Returns:
- The updated set of imported assignments.
-