public class HttpResponseFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static javax.ws.rs.core.Response |
createAcceptedResponse(String message)
Creates a HTTP-202 response for signalling that a process was started.
|
static javax.ws.rs.core.Response |
createBadRequestResponse()
Creates a HTTP-400 response with "N/A" as message.
|
static javax.ws.rs.core.Response |
createBadRequestResponse(String message)
Creates a HTTP-400 response with a specified message.
|
static javax.ws.rs.core.Response |
createBusyResponse(String message,
long retryInSeconds)
Creates a response, replying that the service is not available at the moment.
|
static javax.ws.rs.core.Response |
createFubarResponse()
Creates a HTTP-500 response for the case that the service is broken
beyond all repair.
|
static javax.ws.rs.core.Response |
createInitResponse()
Creates a HTTP-503 response that should be returned during
the initialization state of the harvester.
|
static javax.ws.rs.core.Response |
createKnownErrorResponse(String message)
Creates a HTTP-500 response for a known but unexpected server error.
|
static javax.ws.rs.core.Response |
createMethodNotAllowedResponse()
Creates a HTTP-405 response.
|
static javax.ws.rs.core.Response |
createOkResponse(Object entity)
Creates a HTTP-200 message with a specified entity.
|
static javax.ws.rs.core.Response |
createPlainTextOkResponse(String message)
Creates a HTTP-200 plain text response.
|
static javax.ws.rs.core.Response |
createServerErrorResponse()
Creates an error message depending on the current state of the harvester.
|
static javax.ws.rs.core.Response |
createSynchronousEventResponse(ISynchronousEvent<?> event)
Creates a server response for an ISynchronousEvent.
|
static javax.ws.rs.core.Response |
createUnknownErrorResponse()
Creates a HTTP-500 response for unknown server errors.
|
static javax.ws.rs.core.Response |
createValueResponse(javax.ws.rs.core.Response.Status statusCode,
com.google.gson.JsonElement value)
Creates a response with a specified status code and entity.
|
public static javax.ws.rs.core.Response createInitResponse()
public static javax.ws.rs.core.Response createBusyResponse(String message, long retryInSeconds)
message - an error message, explaining what has failedretryInSeconds - the number of seconds until the request should be attempted
again, or -1 if this number is unknownpublic static javax.ws.rs.core.Response createAcceptedResponse(String message)
message - a message, explaining what has startedpublic static javax.ws.rs.core.Response createFubarResponse()
public static javax.ws.rs.core.Response createUnknownErrorResponse()
public static javax.ws.rs.core.Response createKnownErrorResponse(String message)
message - the message that is passed as an entity of the responsepublic static javax.ws.rs.core.Response createBadRequestResponse()
public static javax.ws.rs.core.Response createBadRequestResponse(String message)
message - the message that is passed as an entity of the responsepublic static javax.ws.rs.core.Response createMethodNotAllowedResponse()
public static javax.ws.rs.core.Response createOkResponse(Object entity)
entity - the entity that is passed along with the responsepublic static javax.ws.rs.core.Response createPlainTextOkResponse(String message)
message - the response textpublic static javax.ws.rs.core.Response createValueResponse(javax.ws.rs.core.Response.Status statusCode,
com.google.gson.JsonElement value)
statusCode - the HTTP return code of the responsevalue - the entity that is passed along with the responsepublic static javax.ws.rs.core.Response createServerErrorResponse()
public static javax.ws.rs.core.Response createSynchronousEventResponse(ISynchronousEvent<?> event)
event - the synchronous event that is to be dispatchedCopyright © 2017–2019. All rights reserved.