Package org.silverpeas.components.resourcesmanager.web

## Class AbstractResourceManagerResource

- java.lang.Object
- - org.silverpeas.core.web.rs.RESTWebService
  - - org.silverpeas.components.resourcesmanager.web.AbstractResourceManagerResource

- All Implemented Interfaces:
    `org.silverpeas.core.web.rs.ProtectedWebResource`, `org.silverpeas.core.web.rs.WebAuthenticationValidation`, `org.silverpeas.core.web.rs.WebAuthorizationValidation`, `org.silverpeas.core.web.SilverpeasWebResource`
  Direct Known Subclasses:
    `ResourceManagerResource`

      public abstract class AbstractResourceManagerResource
      extends org.silverpeas.core.web.rs.RESTWebService

  Author:
    Yohann Chastagnier

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService

      `org.silverpeas.core.web.rs.RESTWebService.WebProcess<R extends Object>, org.silverpeas.core.web.rs.RESTWebService.WebTreatment<R extends Object>`

  - ### Field Summary

    - ### Fields inherited from class org.silverpeas.core.web.rs.RESTWebService

      `RESPONSE_HEADER_ARRAYSIZE`

    - ### Fields inherited from interface org.silverpeas.core.web.SilverpeasWebResource

      `BASE_PATH`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Collection<ReservedResourceEntity>` | `asWebEntities​(Long reservationId, List<Resource> resources)` | Converts the resources into its corresponding web entity list.
    `protected Collection<ReservationEntity>` | `asWebEntities​(List<Reservation> reservations)` | Converts the reservations into its corresponding web entity list.
    `protected ReservedResourceEntity` | `asWebEntity​(Long reservationId, Resource resource)` | Converts the reserved resource into its corresponding web entity.
    `protected ResourceCategoryEntity` | `asWebEntity​(Category category)` | Converts the category into its corresponding web entity.
    `protected ReservationEntity` | `asWebEntity​(Reservation reservation)` | Converts the reservation into its corresponding web entity.
    `protected ResourceEntity` | `asWebEntity​(Resource resource)` | Converts the resource into its corresponding web entity.
    `protected URI` | `buildReservationURI​(Reservation reservation)` | Centralized build of reservation URI.
    `protected URI` | `buildResourceCategoryURI​(Category category)` | Centralized build of resource reservation URI.
    `protected URI` | `buildResourceReservationURI​(Reservation reservation)` | Centralized build of resource reservation URI.
    `protected URI` | `buildResourceURI​(Resource resource)` | Centralized build of resource reservation URI.
    `String` | `getComponentId()` |
    `protected String` | `getResourceBasePath()` |
    `protected ResourcesManager` | `getResourceManager()` |

    - ### Methods inherited from class org.silverpeas.core.web.rs.RESTWebService

      `createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process`

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

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

    - ### Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource

      `validateUserAuthorization`

    - ### Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation

      `validateUserAuthentication`

- - ### Constructor Detail

    - #### AbstractResourceManagerResource

          public AbstractResourceManagerResource()

  - ### Method Detail

    - #### getResourceBasePath

          protected String getResourceBasePath()

      Specified by:
        `getResourceBasePath` in class `org.silverpeas.core.web.rs.RESTWebService`

    - #### getComponentId

          public String getComponentId()

    - #### asWebEntities

          protected Collection<ReservedResourceEntity> asWebEntities​(Long reservationId,
                                                                     List<Resource> resources)

      Converts the resources into its corresponding web entity list.
      Parameters:
        `reservationId` - the identifier of the linked reservation.
        `resources` - the resources to convert.
      Returns:
        the corresponding list of resource entity.

    - #### asWebEntity

          protected ReservedResourceEntity asWebEntity​(Long reservationId,
                                                       Resource resource)

      Converts the reserved resource into its corresponding web entity.
      Parameters:
        `reservationId` - the identifier of the linked reservation.
        `resource` - the resource to convert.
      Returns:
        the corresponding resource entity.

    - #### asWebEntity

          protected ResourceEntity asWebEntity​(Resource resource)

      Converts the resource into its corresponding web entity.
      Parameters:
        `resource` - the resource to convert.
      Returns:
        the corresponding resource entity.

    - #### asWebEntities

          protected Collection<ReservationEntity> asWebEntities​(List<Reservation> reservations)

      Converts the reservations into its corresponding web entity list.
      Parameters:
        `reservations` - the reservation events to convert.
      Returns:
        the corresponding list of reservation entity.

    - #### asWebEntity

          protected ReservationEntity asWebEntity​(Reservation reservation)

      Converts the reservation into its corresponding web entity.
      Parameters:
        `reservation` - the reservation event to convert.
      Returns:
        the corresponding reservation entity.

    - #### asWebEntity

          protected ResourceCategoryEntity asWebEntity​(Category category)

      Converts the category into its corresponding web entity.
      Parameters:
        `category` - the category to convert.
      Returns:
        the corresponding category entity.

    - #### buildReservationURI

          protected URI buildReservationURI​(Reservation reservation)

      Centralized build of reservation URI.
      Parameters:
        `reservation` -
      Returns:
        reservation URI

    - #### buildResourceReservationURI

          protected URI buildResourceReservationURI​(Reservation reservation)

      Centralized build of resource reservation URI.
      Parameters:
        `reservation` -
      Returns:
        reservation URI

    - #### buildResourceCategoryURI

          protected URI buildResourceCategoryURI​(Category category)

      Centralized build of resource reservation URI.
      Parameters:
        `category` -
      Returns:
        reservation URI

    - #### buildResourceURI

          protected URI buildResourceURI​(Resource resource)

      Centralized build of resource reservation URI.
      Parameters:
        `resource` -
      Returns:
        reservation URI

    - #### getResourceManager

          protected ResourcesManager getResourceManager()

      Returns:
        Resource manager service layer