Constructor and Description |
---|
RestCall(HttpServletRequest req,
HttpServletResponse res)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
RestCall |
debug(boolean b)
Enables or disabled debug mode on this call.
|
RestCall |
exception(Throwable e)
Identifies that an exception occurred during this call.
|
RestCall |
finish()
Called at the end of a call to finish any remaining tasks such as flushing buffers and logging the response.
|
String |
getMethod()
Returns the HTTP method name.
|
Object |
getOutput()
Shortcut for calling
|
String |
getPathInfo()
Shortcut for calling
|
String |
getPathInfoUndecoded()
Same as
getPathInfo() but doesn't decode encoded characters. |
HttpServletRequest |
getRequest()
Returns the HTTP servlet request of this REST call.
|
HttpServletResponse |
getResponse()
Returns the HTTP servlet response of this REST call.
|
RestRequest |
getRestRequest()
Returns the REST request of this REST call.
|
RestResponse |
getRestResponse()
Returns the REST response of this REST call.
|
String |
getServletPath()
Shortcut for calling
|
int |
getStatus()
Shortcut for calling
|
UrlPathInfo |
getUrlPathInfo()
Returns the request path info as a
UrlPathInfo bean. |
boolean |
hasOutput()
Shortcut for calling
|
RestCall |
logger(RestCallLogger logger)
Sets the logger to use when logging this call.
|
RestCall |
loggerConfig(RestCallLoggerConfig config)
Sets the logging configuration to use when logging this call.
|
RestCall |
output(Object output)
Sets the output object to serialize as the response of this call.
|
RestCall |
request(HttpServletRequest req)
Overrides the request object on the REST call.
|
RestCall |
response(HttpServletResponse res)
Overrides the response object on the REST call.
|
RestCall |
responseMeta(ResponseBeanMeta meta)
Sets metadata about the response.
|
RestCall |
restRequest(RestRequest rreq)
Set the
RestRequest object on this REST call. |
RestCall |
restResponse(RestResponse rres)
Set the
RestResponse object on this REST call. |
RestCall |
status(int code)
Sets the HTTP status on this call.
|
public RestCall(HttpServletRequest req, HttpServletResponse res)
req
- The incoming HTTP servlet request object.res
- The incoming HTTP servlet response object.public RestCall request(HttpServletRequest req)
req
- The new HTTP servlet request.public RestCall response(HttpServletResponse res)
res
- The new HTTP servlet response.public RestCall restRequest(RestRequest rreq)
RestRequest
object on this REST call.rreq
- The RestRequest
object on this REST call.public RestCall restResponse(RestResponse rres)
RestResponse
object on this REST call.rres
- The RestResponse
object on this REST call.public HttpServletRequest getRequest()
public HttpServletResponse getResponse()
public RestRequest getRestRequest()
public RestResponse getRestResponse()
public RestCall logger(RestCallLogger logger)
logger
- The logger to use when logging this call.public RestCall loggerConfig(RestCallLoggerConfig config)
config
- The logging configuration to use when logging this call.public RestCall debug(boolean b) throws IOException
b
- The debug flag value.IOException
- Occurs if request body could not be cached into memory.public RestCall status(int code)
code
- The status code.public RestCall exception(Throwable e)
e
- The thrown exception.public RestCall responseMeta(ResponseBeanMeta meta)
meta
- The metadata about the response.public RestCall output(Object output)
output
- The response output POJO.public RestCall finish()
public String getServletPath()
public UrlPathInfo getUrlPathInfo()
UrlPathInfo
bean.UrlPathInfo
bean.public String getPathInfo()
public String getPathInfoUndecoded()
getPathInfo()
but doesn't decode encoded characters.public String getMethod()
public int getStatus()
public boolean hasOutput()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.