Class LinkServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.plugins.rest.link.LinkServiceImpl
-
- All Implemented Interfaces:
LinkService
@Component public class LinkServiceImpl extends Object implements LinkService
Utility service for providing links in rest responses
-
-
Constructor Summary
Constructors Constructor Description LinkServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLinks(@NotNull AbstractRestModel resource, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Add links to the resource.void
addLinks(@NotNull AbstractRestModel resource, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String resourceLocation)
Add links to the resource.void
addPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Add pagination links to the pageResponse.void
addPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo, int nextStart)
Add pagination links to the pageResponse.void
addPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String pageLocation)
Add pagination links to the pageResponse.void
addPaginationSelfLink(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String pageLocation)
Add pagination self link only to the pageResponse.
-
-
-
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 interfaceLinkService
- Parameters:
resource
- the resource ready to go back to the useruriInfo
- 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 interfaceLinkService
- Parameters:
resource
- the resource ready to go back to the useruriInfo
- information about the current requestresourceLocation
- 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 interfaceLinkService
- Parameters:
page
- the paged response ready to go back to the useruriInfo
- 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 interfaceLinkService
- Parameters:
page
- the paged response ready to go back to the useruriInfo
- information about the current requestpageLocation
- 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 interfaceLinkService
- Parameters:
page
- the paged response ready to go back to the useruriInfo
- information about the current requestpageLocation
- 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 interfaceLinkService
- Parameters:
page
- the paged response ready to go back to the useruriInfo
- information about the current request
-
-