Class SlotSafeService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.SlotSafeService
-
public final class SlotSafeService extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcleanSlotlist()Clean slotliststatic SlotcreateSlot(Slot slot)Create slotstatic voiddecrementPotentialRemainingPlaces(int nbPotentialRemainingPlaces, int nIdSlot)Update potential remaining placesstatic java.util.Map<java.lang.Integer,java.util.concurrent.locks.Lock>getListSlotInMemory()Get the slot in memorystatic java.util.concurrent.locks.LockgetLockOnSlot(int nIdSlot)get lock for slotstatic voidincrementMaxCapacity(int nIdForm, int nIncrementingValue, java.time.LocalDateTime startindDateTime, java.time.LocalDateTime endingDateTime, boolean lace)Increment max capacitystatic SlotincrementPotentialRemainingPlaces(SlotEditTask task)Update potential remaining placesstatic voidremoveSlotInMemory(int nIdSlot)remove slot in map memorystatic intsaveAppointment(AppointmentDTO appointmentDTO, javax.servlet.http.HttpServletRequest request)Save a slot in databasestatic SlotsaveSlot(Slot slot)Save a slot in databasestatic voidupdateRemainingPlaces(Slot slot)Update the capacity of the slotstatic SlotupdateSlot(Slot slot)Update a slotstatic voidupdateSlot(Slot slot, boolean bEndingTimeHasChanged, java.time.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 Detail
-
getListSlotInMemory
public static java.util.Map<java.lang.Integer,java.util.concurrent.locks.Lock> getListSlotInMemory()
Get the slot in memory- Returns:
- Map of slot
-
getLockOnSlot
public static java.util.concurrent.locks.Lock getLockOnSlot(int nIdSlot)
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
-
incrementMaxCapacity
public static void incrementMaxCapacity(int nIdForm, int nIncrementingValue, java.time.LocalDateTime startindDateTime, java.time.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
public static Slot incrementPotentialRemainingPlaces(SlotEditTask task)
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, java.time.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
public static void updateRemainingPlaces(Slot slot)
Update the capacity of the slot- Parameters:
slot- the slot to update
-
saveSlot
public static Slot saveSlot(Slot slot)
Save a slot in database- Parameters:
slot- the slot to save- Returns:
- the slot saved
-
updateSlot
public static Slot updateSlot(Slot slot)
Update a slot- Parameters:
slot- the slot updated
-
cleanSlotlist
public static void cleanSlotlist()
Clean slotlist
-
-