public final class SlotSafeService extends Object
Modifier and Type | Method and Description |
---|---|
static void |
cleanSlotlist()
Clean slotlist
|
static Slot |
createSlot(Slot slot)
Create slot
|
static void |
decrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces,
int nIdSlot)
Update potential remaining places
|
static Map<Integer,Object> |
getListSlotInMemory()
Get the slot in memory
|
static Object |
getLockOnSlot(int nIdSlot)
get lock for slot
|
static void |
incrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces,
int nIdSlot,
TimerForLockOnSlot timer)
Update potential remaining places
|
static void |
removeSlotInMemory(int nIdSlot)
remove slot in map memory
|
static int |
saveAppointment(AppointmentDTO appointmentDTO,
javax.servlet.http.HttpServletRequest request)
Save a slot in database
|
static Slot |
saveSlot(Slot slot)
Save a slot in database
|
static void |
updateRemainingPlaces(Slot slot)
Update the capacity of the slot
|
static void |
updateRemaningPlacesWithAppointmentMovedDeletedOrCanceled(int nbPlaces,
int nIdSlot)
Set the new number of remaining places (and potential) when an appointment is deleted or cancelled This new value must take in account the capacity of
the slot, in case of the slot was already over booked
|
static Slot |
updateSlot(Slot slot)
Update a slot
|
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)
|
public static Map<Integer,Object> getListSlotInMemory()
public static Object getLockOnSlot(int nIdSlot)
nIdSlot
- the Id Slotpublic static void removeSlotInMemory(int nIdSlot)
nIdSlot
- the Id Slotpublic static void incrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot, TimerForLockOnSlot timer)
nbPotentialRemainingPlaces
- the nbPotentialRemainingPlacesnIdSlot
- the is Slottimer
- the timerpublic static void decrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot)
nbPotentialRemainingPlaces
- the nbPotentialRemainingPlacesnIdSlot
- the is Slotpublic static int saveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request)
slot
- the slot to savepublic static void updateRemaningPlacesWithAppointmentMovedDeletedOrCanceled(int nbPlaces, int nIdSlot)
nbPlaces
- the nb places taken of the appointment that we want to delete (or cancel, or move)slot
- the related slotpublic static void updateSlot(Slot slot, boolean bEndingTimeHasChanged, LocalTime previousEndingTime, boolean bShifSlot)
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 slotspublic static void updateRemainingPlaces(Slot slot)
slot
- the slot to updatepublic static Slot saveSlot(Slot slot)
slot
- the slot to savepublic static Slot updateSlot(Slot slot)
slot
- the slot updatedpublic static void cleanSlotlist()
Copyright © 2020 City of Paris. All rights reserved.