public final class ResponseUtil extends Object
| Constructor and Description |
|---|
ResponseUtil() |
| Modifier and Type | Method and Description |
|---|---|
static javax.ws.rs.core.Response.ResponseBuilder |
created(AbstractElement<?,?> element,
javax.ws.rs.core.UriInfo info) |
static javax.ws.rs.core.Response.ResponseBuilder |
created(AbstractElement element,
javax.ws.rs.core.UriInfo info,
String id)
Deprecated.
This is only used by the deprecated REST API
|
static javax.ws.rs.core.Response.ResponseBuilder |
created(Collection<? extends AbstractElement<?,?>> data,
javax.ws.rs.core.UriInfo info) |
static javax.ws.rs.core.Response.ResponseBuilder |
created(javax.ws.rs.core.UriInfo info,
Spliterator<String> ids)
Deprecated.
This returns just ids of the newly created entities in the response. That is not satisfactory.
|
static void |
createPagingHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
javax.ws.rs.core.UriInfo uriInfo,
Page<?> resultList)
Create the paging headers for collections and attach them to the passed builder.
|
static <T> javax.ws.rs.core.Response.ResponseBuilder |
pagedResponse(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo uriInfo,
com.fasterxml.jackson.databind.ObjectMapper mapper,
Page<T> page) |
static <T> javax.ws.rs.core.Response.ResponseBuilder |
pagedResponse(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo uriInfo,
Page<T> page,
Object data) |
@Deprecated public static javax.ws.rs.core.Response.ResponseBuilder created(AbstractElement element, javax.ws.rs.core.UriInfo info, String id)
Response.created(java.net.URI) into
one place until this JIRA is resolved somehow.element - the newly created element. This will be returned in the response body as a JSON payloadinfo - the UriInfo instance of the current requestid - the ID of a newly created entity under the basepublic static javax.ws.rs.core.Response.ResponseBuilder created(AbstractElement<?,?> element, javax.ws.rs.core.UriInfo info) throws URISyntaxException
URISyntaxException@Deprecated public static javax.ws.rs.core.Response.ResponseBuilder created(javax.ws.rs.core.UriInfo info, Spliterator<String> ids)
created(AbstractElement, UriInfo, String) but used when more than 1 entity is created
during the request.
The provided list of ids is converted to URIs (by merely appending the ids using the
UriBuilder.segment(String...) method) and put in the response as its entity.
info - uri info to help with converting ids to URIsids - the list of ids of the entitiespublic static javax.ws.rs.core.Response.ResponseBuilder created(Collection<? extends AbstractElement<?,?>> data, javax.ws.rs.core.UriInfo info)
public static <T> javax.ws.rs.core.Response.ResponseBuilder pagedResponse(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo uriInfo,
com.fasterxml.jackson.databind.ObjectMapper mapper,
Page<T> page)
public static <T> javax.ws.rs.core.Response.ResponseBuilder pagedResponse(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo uriInfo,
Page<T> page,
Object data)
public static void createPagingHeader(javax.ws.rs.core.Response.ResponseBuilder builder,
javax.ws.rs.core.UriInfo uriInfo,
Page<?> resultList)
builder - The ResponseBuilder that receives the headersuriInfo - The uriInfo of the incoming request to build the urlsresultList - The collection with its paging informationCopyright © 2015–2016 Red Hat, Inc.. All rights reserved.