Class LinkServiceImpl

  • All Implemented Interfaces:
    LinkService

    @Component
    public class LinkServiceImpl
    extends Object
    implements LinkService
    Utility service for providing links in rest responses
    • Constructor Detail

      • LinkServiceImpl

        public LinkServiceImpl()
    • Method Detail

      • addLinks

        public void addLinks​(@NotNull
                             @NotNull AbstractRestModel resource,
                             @NotNull
                             @NotNull javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: LinkService
        Add links to the resource. Links provide base/self urls if required. Assumes the resource is at the level requested by the client, NOT an expand/sub object. i.e it uses the current request url to determine the base/self urls
        Specified by:
        addLinks in interface LinkService
        Parameters:
        resource - the resource ready to go back to the user
        uriInfo - information about the current request
      • addLinks

        public void addLinks​(@NotNull
                             @NotNull AbstractRestModel resource,
                             @NotNull
                             @NotNull javax.ws.rs.core.UriInfo uriInfo,
                             @NotNull
                             @NotNull String resourceLocation)
        Description copied from interface: LinkService
        Add links to the resource. Links provide base/self urls if required.
        Specified by:
        addLinks in interface LinkService
        Parameters:
        resource - the resource ready to go back to the user
        uriInfo - information about the current request
        resourceLocation - the url for the resource being returned relative to the base URI
      • addPaginationLinks

        public void addPaginationLinks​(@NotNull
                                       @NotNull RestPageModel<?> page,
                                       @NotNull
                                       @NotNull javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: LinkService
        Add pagination links to the pageResponse. Pagination links provide next/prev urls if required. Assumes the pagination is at the level requested by the client, NOT an expand/sub object. i.e it uses the current request url to determine the next/prev urls
        Specified by:
        addPaginationLinks in interface LinkService
        Parameters:
        page - the paged response ready to go back to the user
        uriInfo - information about the current request
      • addPaginationLinks

        public void addPaginationLinks​(@NotNull
                                       @NotNull RestPageModel<?> page,
                                       @NotNull
                                       @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                       @NotNull
                                       @NotNull String pageLocation)
        Description copied from interface: LinkService
        Add pagination links to the pageResponse. Pagination links provide next/prev urls if required.
        Specified by:
        addPaginationLinks in interface LinkService
        Parameters:
        page - the paged response ready to go back to the user
        uriInfo - information about the current request
        pageLocation - the url for the resource being paged
      • addPaginationSelfLink

        public void addPaginationSelfLink​(@NotNull
                                          @NotNull RestPageModel<?> page,
                                          @NotNull
                                          @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                          @NotNull
                                          @NotNull String pageLocation)
        Description copied from interface: LinkService
        Add pagination self link only to the pageResponse.
        Specified by:
        addPaginationSelfLink in interface LinkService
        Parameters:
        page - the paged response ready to go back to the user
        uriInfo - information about the current request
        pageLocation - the url for the resource being paged
      • addPaginationLinks

        public void addPaginationLinks​(@NotNull
                                       @NotNull RestPageModel<?> page,
                                       @NotNull
                                       @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                       int nextStart)
        Description copied from interface: LinkService
        Add pagination links to the pageResponse. Pagination links provide next/prev urls if required.
        Specified by:
        addPaginationLinks in interface LinkService
        Parameters:
        page - the paged response ready to go back to the user
        uriInfo - information about the current request