Class ReservationService


  • @Service
    public class ReservationService
    extends Object
    Author:
    ehugonnet
    • Constructor Detail

      • ReservationService

        public ReservationService()
    • Method Detail

      • createReservation

        public void createReservation​(Reservation reservation,
                                      List<Long> resourceIds)
      • computeReservationStatus

        public String computeReservationStatus​(Reservation reservation)
      • updateReservation

        public void updateReservation​(Reservation reservation)
      • getReservation

        public Reservation getReservation​(long id)
      • deleteReservation

        public void deleteReservation​(long id)
      • findAllReservationsInRange

        public List<Reservation> findAllReservationsInRange​(String instanceId,
                                                            Integer userId,
                                                            String startPeriod,
                                                            String endPeriod)
        Finds all reservations related to the given user on the given period. If user parameter (userId) is not defined, the reservations returned are not filtered by user.
        Parameters:
        instanceId - resource manager instance id
        userId - unique identifier of the user
        startPeriod - the start date of the period
        endPeriod - the end date of the period
        Returns:
        a list of reservations
      • findAllReservationsForCategoryInRange

        public List<Reservation> findAllReservationsForCategoryInRange​(String instanceId,
                                                                       Integer userId,
                                                                       Long categoryId,
                                                                       String startPeriod,
                                                                       String endPeriod)
        Finds all reservations related to the given user on the given period and for which at least one resource of the given category is attached. If user parameter (userId) is not defined, the reservations returned are not filtered by user.
        Parameters:
        instanceId - the resource manager instance identifier
        userId - the unique identifier of the user
        categoryId - the unique identifier of the category
        startPeriod - the start date of the period
        endPeriod - the end date of the period
        Returns:
        a list of reservations.
      • findAllReservationsForResourceInRange

        public List<Reservation> findAllReservationsForResourceInRange​(String instanceId,
                                                                       Integer userId,
                                                                       Long resourceId,
                                                                       String startPeriod,
                                                                       String endPeriod)
        Finds all reservations related to the given user on the given period and for which the given resource is attached. If user parameter (userId) is not defined, the reservations returned are not filtered by user.
        Parameters:
        instanceId - the resource manager instance identifier.
        userId - the unique identifier of the user
        resourceId - the unique identifier of the resource
        startPeriod - the start date of the period
        endPeriod - the end date of the period
        Returns:
        a list of reservations.