-
- All Implemented Interfaces:
public final class CallHTTP request context. It holds client supplied data and methods to change the response.
-
-
Field Summary
Fields Modifier and Type Field Description private final Map<String, Object>attributesprivate final StringrequestTypeprivate final SerializationFormatrequestFormatprivate final StringresponseTypeprivate final SerializationFormatresponseFormatprivate final Map<String, String>pathParametersprivate final Map<String, List<String>>queryParametersValuesprivate final Map<String, List<String>>formParametersValuesprivate final Map<String, String>queryParametersprivate final Map<String, String>formParametersprivate final Requestrequestprivate final Responseresponseprivate final Sessionsession
-
Method Summary
Modifier and Type Method Description final Map<String, Object>getAttributes()Call attributes (for the current request). final StringgetRequestType()final SerializationFormatgetRequestFormat()final StringgetResponseType()final SerializationFormatgetResponseFormat()final Map<String, String>getPathParameters()final Map<String, List<String>>getQueryParametersValues()final Map<String, List<String>>getFormParametersValues()final Map<String, String>getQueryParameters()final Map<String, String>getFormParameters()final RequestgetRequest()final ResponsegetResponse()final SessiongetSession()final Unitok(Object content, String contentType)Sends success response with given content type. final Unitok(Object content, SerializationFormat serializationFormat, Charset charset)Sends success response serialized using given SerializationFormat and Charset. final Unitsend(Integer code, Object content, String contentType)Sends response to the client. final Unitsend(Integer code, Object content, SerializationFormat serializationFormat, Charset charset)Sends response to the client after serializing using given SerializationFormat and Charset. final Unitsend(Integer code, Object content, ContentType contentType)Sends response to the client after serializing using given ContentType instance. final Voidhalt(Object content)Sends error response. final Voidhalt(Integer code, Object content)Sends error response. final Unitredirect(String url)Sends a redirect response to the client using the specified redirect URL. -
-
Method Detail
-
getAttributes
final Map<String, Object> getAttributes()
Call attributes (for the current request). Same as HttpServletRequest.setAttribute().
-
getRequestType
final String getRequestType()
-
getRequestFormat
final SerializationFormat getRequestFormat()
-
getResponseType
final String getResponseType()
-
getResponseFormat
final SerializationFormat getResponseFormat()
-
getPathParameters
final Map<String, String> getPathParameters()
-
getQueryParametersValues
final Map<String, List<String>> getQueryParametersValues()
-
getFormParametersValues
final Map<String, List<String>> getFormParametersValues()
-
getQueryParameters
final Map<String, String> getQueryParameters()
-
getFormParameters
final Map<String, String> getFormParameters()
-
getRequest
final Request getRequest()
-
getResponse
final Response getResponse()
-
getSession
final Session getSession()
-
ok
final Unit ok(Object content, String contentType)
Sends success response with given content type.
- Parameters:
content- Content of the response.contentType- Content type of the response.
-
ok
final Unit ok(Object content, SerializationFormat serializationFormat, Charset charset)
Sends success response serialized using given SerializationFormat and Charset.
- Parameters:
content- Content of the response.serializationFormat- Serialization format for serializing the response.charset- Character Set to be used for the content type.
-
send
final Unit send(Integer code, Object content, String contentType)
Sends response to the client.
- Parameters:
code- Status code of the response.content- Content of the response.contentType- Content type of the response.
-
send
final Unit send(Integer code, Object content, SerializationFormat serializationFormat, Charset charset)
Sends response to the client after serializing using given SerializationFormat and Charset.
- Parameters:
code- Status code of the response.content- Content of the response.serializationFormat- Serialization format for serializing the response.charset- Character Set to be used for the content type.
-
send
final Unit send(Integer code, Object content, ContentType contentType)
Sends response to the client after serializing using given ContentType instance.
- Parameters:
code- Status code of the response.content- Content of the response.contentType- Content type of the response.
-
halt
final Void halt(Object content)
Sends error response.
- Parameters:
content- Message for error response.
-
halt
final Void halt(Integer code, Object content)
Sends error response.
- Parameters:
code- Status code for error response.content- Message for error response.
-
-
-
-