Package org.silverpeas.components.resourcesmanager.service

## Class ReservationService

- java.lang.Object
- - org.silverpeas.components.resourcesmanager.service.ReservationService

-     @Service
      public class ReservationService
      extends Object

  Author:
    ehugonnet

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ReservationService()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `computeReservationStatus​(Reservation reservation)` |
    `void` | `createReservation​(Reservation reservation, List<Long> resourceIds)` |
    `void` | `deleteReservation​(long id)` |
    `List<Reservation>` | `findAllReservations​(String instanceId)` |
    `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.
    `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.
    `List<Reservation>` | `findAllReservationsForUser​(String instanceId, Integer userId)` |
    `List<Reservation>` | `findAllReservationsForValidation​(String instanceId, Long userId, String startPeriod, String endPeriod)` |
    `List<Reservation>` | `findAllReservationsInRange​(String instanceId, Integer userId, String startPeriod, String endPeriod)` | Finds all reservations related to the given user on the given period.
    `Reservation` | `getReservation​(long id)` |
    `void` | `updateReservation​(Reservation reservation)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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)

    - #### findAllReservations

          public List<Reservation> findAllReservations​(String instanceId)

    - #### findAllReservationsForUser

          public List<Reservation> findAllReservationsForUser​(String instanceId,
                                                              Integer userId)

    - #### findAllReservationsForValidation

          public List<Reservation> findAllReservationsForValidation​(String instanceId,
                                                                    Long userId,
                                                                    String startPeriod,
                                                                    String endPeriod)

    - #### 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.