|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.rest.Response.Builder
public static class Response.Builder
REST Response builder.
| Constructor Summary | |
|---|---|
protected |
Response.Builder()
Must not be visible for external class. |
| Method Summary | |
|---|---|
static Response.Builder |
accepted()
create Builder with HTTP status 202 (ACCEPTED). |
static Response.Builder |
badRequest()
create Builder with HTTP status 400 (BAD REQUEST). |
Response |
build()
create REST Response with parameters collected by Builder. |
Response.Builder |
cacheControl(CacheControl c)
|
Response.Builder |
contentLenght(long length)
set Content-Length header. |
Response.Builder |
cookies(Cookie... cc)
Add new cookies. |
static Response.Builder |
created(Object e,
String location)
create Builder with status 201 (CREATED) and entity. |
static Response.Builder |
created(String location)
create Builder with status 201 (CREATED). |
Response.Builder |
encodings(List<String> encodings)
set Content-Encoding. |
Response.Builder |
entity(Object e)
add entity to the Builder. |
Response.Builder |
entity(Object e,
String mediaType)
add entity to the Builder and set entity Content-Type. |
Response.Builder |
errorMessage(String message)
Prepared error response and set transformer. |
static Response.Builder |
forbidden()
create Builder with HTTP status 403 (FORBIDDEN). |
Response.Builder |
header(String key,
String value)
add response single header. |
Response.Builder |
headers(MultivaluedMetadata headers)
set response headers. |
Response.Builder |
languages(List<String> languages)
set Content-Language. |
Response.Builder |
lastModified(Date lastModified)
set Last-Modified header. |
Response.Builder |
locations(String location)
set Location header. |
Response.Builder |
mediaType(String mediaType)
set entity Content-Type. |
protected static Response.Builder |
newInstance()
Create a new instance of builder. |
static Response.Builder |
noContent()
create Builder with HTTP status 204 (NO CONTENT). |
static Response.Builder |
notFound()
create Builder with HTTP status 404 (NOT FOUND). |
static Response.Builder |
notModified()
create Builder with HTTP status 304 (NOT MODIFIED). |
static Response.Builder |
notModified(String tag)
create Builder with HTTP status 304 (NOT MODIFIED) and HTTP EntityTag. |
static Response.Builder |
ok()
create Builder with HTTP status 200 (OK). |
static Response.Builder |
ok(Object e)
create Builder with HTTP status 200 (OK) and entity. |
static Response.Builder |
ok(Object e,
String mediaType)
create Builder with HTTP status 200 (OK),entity and set entity type. |
static Response.Builder |
representation(Object e)
create Builder with HTTP status 200 (OK) and entity. |
static Response.Builder |
representation(Object e,
String type)
create Builder with HTTP status 200 (OK), entity and set entity type. |
static Response.Builder |
serverError()
create Builder with HTTP status 500 (INTERNAL SERVER ERROR). |
Response.Builder |
setTransformerParameters(Map<String,String> trfParams)
set parameters for OutputEntityTransformer. |
Response.Builder |
status(int st)
return Buider with changed status. |
Response.Builder |
tag(String tag)
set HTTP EntityTag header. |
static Response.Builder |
temporaryRedirect(String location)
created Builder with HTTP status 307 (TEMPORARY REDIRECT). |
Response.Builder |
transformer(OutputEntityTransformer trf)
set OutputEntityTransformer. |
static Response.Builder |
withStatus(int st)
create Builder with selected status. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Response.Builder()
| Method Detail |
|---|
protected static Response.Builder newInstance()
public Response build()
public static Response.Builder withStatus(int st)
st - the HTTP status
public static Response.Builder representation(Object e)
e - the entity.
public static Response.Builder representation(Object e,
String type)
e - the entity.type - the entity type.
public static Response.Builder ok()
public static Response.Builder ok(Object e)
e - the entity.
public static Response.Builder ok(Object e,
String mediaType)
e - the entity.mediaType - the entity type.
public static Response.Builder created(String location)
location - the location created resources.
public static Response.Builder created(Object e,
String location)
e - the entity.location - the location created resources.
public static Response.Builder accepted()
public static Response.Builder noContent()
public static Response.Builder temporaryRedirect(String location)
location - the new resource location.
public static Response.Builder notModified()
public static Response.Builder notModified(String tag)
tag - the HTTP EntityTag.
public static Response.Builder forbidden()
public static Response.Builder notFound()
public static Response.Builder badRequest()
public static Response.Builder serverError()
public Response.Builder status(int st)
st - the HTTP status.
public Response.Builder entity(Object e)
e - the entity (object with represents requested resource).
public Response.Builder entity(Object e,
String mediaType)
e - the entity (object with represents requested resource).mediaType - the entity media type.
public Response.Builder mediaType(String mediaType)
mediaType - the entity media type.
public Response.Builder languages(List<String> languages)
languages - the List < String > of language.
public Response.Builder encodings(List<String> encodings)
encodings - the List < String > of content encoding.
public Response.Builder locations(String location)
location - the Location string.
public Response.Builder lastModified(Date lastModified)
lastModified - the date of last change in resource.
public Response.Builder contentLenght(long length)
length - the size of data in bytes.
public Response.Builder tag(String tag)
tag - the HTTP entity tag.
public Response.Builder transformer(OutputEntityTransformer trf)
trf - the output transformer.
org.exoplatform.services.rest.transformer.OutputEntityTransformer.public Response.Builder setTransformerParameters(Map<String,String> trfParams)
trfParams - parameters.
public Response.Builder header(String key,
String value)
key - the key.value - the value.
public Response.Builder headers(MultivaluedMetadata headers)
headers - key-values pair of HTTP response header.
public Response.Builder cacheControl(CacheControl c)
c - the CacheControl.
org.exoplatform.services.rest.CacheControl.public Response.Builder cookies(Cookie... cc)
cc - the new cookies that will be added to response.
public Response.Builder errorMessage(String message)
message - - error message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||