Package org.ametys.plugins.hyperplanning
Class HyperplanningManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.hyperplanning.HyperplanningManager
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
public class HyperplanningManager
extends AbstractLogEnabled
implements Initializable, Component, Serviceable
Component handling the communication with a remote hyperplanning server
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresent a cancelled lesson from hyperplanning -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_getStudentIcal(UserIdentity userIdentity) Get the timetable of a studentgetCancelledLessons(LocalDateTime cancellationMinDate, LocalDateTime lessonMinDate, LocalDateTime lessonMaxDate) Get the list of cancelled lessons and the impacted students.getEtudiantCle(UserIdentity userIdentity) Get the hyperplanning student key corresponding to the user identitygetStudentIcal(UserIdentity userIdentity) Get the timetable of a studentgetUpcomingCancelledLessons(UserIdentity userIdentity) Get the list of cancelled lessons for a given user in the next 2 weeksvoidvoidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role
-
-
Constructor Details
-
HyperplanningManager
public HyperplanningManager()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getStudentIcal
Get the timetable of a student- Parameters:
userIdentity- the student identity- Returns:
- the timetable as an ICS string
-
_getStudentIcal
Get the timetable of a student- Parameters:
userIdentity- the student identity- Returns:
- the timetable as an ICS string
-
getUpcomingCancelledLessons
public Set<HyperplanningManager.CancelledLesson> getUpcomingCancelledLessons(UserIdentity userIdentity) throws UnknownStudentException Get the list of cancelled lessons for a given user in the next 2 weeks- Parameters:
userIdentity- the user identity- Returns:
- a list of
HyperplanningManager.CancelledLessonrepresenting the cancelled lessons or null if the user is unknown - Throws:
UnknownStudentException- when user is not linked to hyperplanning
-
getCancelledLessons
public Map<HyperplanningManager.CancelledLesson,List<String>> getCancelledLessons(LocalDateTime cancellationMinDate, LocalDateTime lessonMinDate, LocalDateTime lessonMaxDate) Get the list of cancelled lessons and the impacted students.- Parameters:
cancellationMinDate- a date to only return lessons that were cancelled after that date, or null.lessonMinDate- a date to only return lessons that start after that date, or null.lessonMaxDate- a date to only return lessons that start before that date, or null.- Returns:
- a map of cancelled lessons with the impacted CAS identifier
-
getEtudiantCle
protected Optional<String> getEtudiantCle(UserIdentity userIdentity) throws com.indexeducation.hyperplanning.ApiException Get the hyperplanning student key corresponding to the user identity- Parameters:
userIdentity- the user identity- Returns:
- the cle or empty if the user doesn't match a hyperplanning student
- Throws:
com.indexeducation.hyperplanning.ApiException- if an error occurs
-