Class AbstractService

    • Field Detail

      • LOG

        protected static final Logger LOG
      • uriInfo

        @Context
        protected javax.ws.rs.core.UriInfo uriInfo
    • Constructor Detail

      • AbstractService

        public AbstractService()
    • Method Detail

      • findActualKey

        protected String findActualKey​(AnyDAO<?> dao,
                                       String pretendingKey)
      • isNullPriorityAsync

        protected boolean isNullPriorityAsync()
      • getPreference

        protected Preference getPreference()
        Reads Prefer header from request and parses into a Preference instance.
        Returns:
        a Preference instance matching the passed Prefer header, or Preference.NONE if missing.
      • applyPreference

        protected javax.ws.rs.core.Response.ResponseBuilder applyPreference​(ProvisioningResult<?> provisioningResult,
                                                                            javax.ws.rs.core.Response.ResponseBuilder builder)
      • createResponse

        protected javax.ws.rs.core.Response createResponse​(ProvisioningResult<?> provisioningResult)
        Builds response to successful create request, taking into account any Prefer header.
        Parameters:
        provisioningResult - the entity just created
        Returns:
        response to successful create request
      • modificationResponse

        protected javax.ws.rs.core.Response modificationResponse​(Object entity)
        Builds response to successful modification request, taking into account any Prefer header.
        Parameters:
        entity - the entity just modified
        Returns:
        response to successful modification request
      • checkETag

        protected void checkETag​(String etag)
      • buildPagedResult

        protected <T extends BaseBeanPagedResult<T> buildPagedResult​(List<T> list,
                                                                       int page,
                                                                       int size,
                                                                       int totalCount)
        Builds a paged result out of a list of items and additional information.
        Type Parameters:
        T - result type
        Parameters:
        list - bare list of items to be returned
        page - current page
        size - requested size
        totalCount - total result size (not considering pagination)
        Returns:
        paged result