Class SlotSafeService


  • public final class SlotSafeService
    extends Object
    • Method Detail

      • getListSlotInMemory

        public static Map<Integer,​Lock> getListSlotInMemory()
        Get the slot in memory
        Returns:
        Map of slot
      • getLockOnSlot

        public static 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
      • createSlot

        public static Slot createSlot​(Slot slot)
        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 form
        nIncrementingValue - the incrementing value
        startindDateTime - the starting date Time
        endingDateTime - the ending Date time
        lace - 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 nbPotentialRemainingPlaces
        nIdSlot - 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 update
        bEndingTimeHasChanged - true if the ending time has changed
        previousEndingTime - the previous ending time
        bShifSlot - 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