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 voidaddLinks(@NotNull AbstractRestModel resource, @NotNull javax.ws.rs.core.UriInfo uriInfo)Add links to the resource.voidaddLinks(@NotNull AbstractRestModel resource, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String resourceLocation)Add links to the resource.voidaddPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo)Add pagination links to the pageResponse.voidaddPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo, int nextStart)Add pagination links to the pageResponse.voidaddPaginationLinks(@NotNull RestPageModel<?> page, @NotNull javax.ws.rs.core.UriInfo uriInfo, @NotNull String pageLocation)Add pagination links to the pageResponse.voidaddPaginationSelfLink(@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:LinkServiceAdd 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:
addLinksin 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:LinkServiceAdd links to the resource. Links provide base/self urls if required.- Specified by:
addLinksin 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:LinkServiceAdd 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:
addPaginationLinksin 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:LinkServiceAdd pagination links to the pageResponse. Pagination links provide next/prev urls if required.- Specified by:
addPaginationLinksin 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:LinkServiceAdd pagination self link only to the pageResponse.- Specified by:
addPaginationSelfLinkin 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:LinkServiceAdd pagination links to the pageResponse. Pagination links provide next/prev urls if required.- Specified by:
addPaginationLinksin interfaceLinkService- Parameters:
page- the paged response ready to go back to the useruriInfo- information about the current request
-
-