Class SlotSafeService
java.lang.Object
fr.paris.lutece.plugins.appointment.service.SlotSafeService
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidClean slotliststatic SlotcreateSlot(Slot slot) Create slotstatic voiddecrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot) Update potential remaining placesGet the slot in memorystatic LockgetLockOnSlot(int nIdSlot) get lock for slotstatic voidincrementMaxCapacity(int nIdForm, int nIncrementingValue, LocalDateTime startindDateTime, LocalDateTime endingDateTime, boolean lace) Increment max capacitystatic SlotUpdate potential remaining placesstatic voidremoveSlotInMemory(int nIdSlot) remove slot in map memorystatic intsaveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request) Save a slot in databasestatic SlotSave a slot in databasestatic voidupdateRemainingPlaces(Slot slot) Update the capacity of the slotstatic SlotupdateSlot(Slot slot) Update a slotstatic voidupdateSlot(Slot slot, boolean bEndingTimeHasChanged, LocalTime previousEndingTime, boolean bShifSlot) Update a slot in database and possibly all the slots after (if the ending hour has changed, all the next slots are impacted in case of the user decide to shift the next slots)
-
Method Details
-
getListSlotInMemory
Get the slot in memory- Returns:
- Map of slot
-
getLockOnSlot
get lock for slot- Parameters:
nIdSlot- the Id Slot- Returns:
- return the lock
-
removeSlotInMemory
public static void removeSlotInMemory(int nIdSlot) remove slot in map memory- Parameters:
nIdSlot- the Id Slot
-
createSlot
Create slot- Parameters:
slot-- Returns:
- slot
-
incrementMaxCapacity
public static void incrementMaxCapacity(int nIdForm, int nIncrementingValue, LocalDateTime startindDateTime, LocalDateTime endingDateTime, boolean lace) Increment max capacity- Parameters:
nIdForm- the Id formnIncrementingValue- the incrementing valuestartindDateTime- the starting date TimeendingDateTime- the ending Date timelace- the lace
-
incrementPotentialRemainingPlaces
Update potential remaining places- Parameters:
task- the task timer
-
decrementPotentialRemainingPlaces
public static void decrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot) Update potential remaining places- Parameters:
nbPotentialRemainingPlaces- the nbPotentialRemainingPlacesnIdSlot- the is Slot
-
saveAppointment
public static int saveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request) Save a slot in database- Parameters:
slot- the slot to save- Returns:
- the slot saved
-
updateSlot
public static void updateSlot(Slot slot, boolean bEndingTimeHasChanged, LocalTime previousEndingTime, boolean bShifSlot) Update a slot in database and possibly all the slots after (if the ending hour has changed, all the next slots are impacted in case of the user decide to shift the next slots)- Parameters:
slot- the slot to updatebEndingTimeHasChanged- true if the ending time has changedpreviousEndingTime- the previous ending timebShifSlot- true if the user has decided to shift the next slots
-
updateRemainingPlaces
Update the capacity of the slot- Parameters:
slot- the slot to update
-
saveSlot
Save a slot in database- Parameters:
slot- the slot to save- Returns:
- the slot saved
-
updateSlot
Update a slot- Parameters:
slot- the slot updated
-
cleanSlotlist
public static void cleanSlotlist()Clean slotlist
-