@RestResource(allowedMethodParams="OPTIONS") @HtmlDocConfig(navlinks={"up: request:/..","options: servlet:/?method=OPTIONS"}) public abstract class BasicRest extends Object implements BasicRestConfig
BasicRestServlet
but doesn't extend from HttpServlet
.
Constructor and Description |
---|
BasicRest() |
Modifier and Type | Method and Description |
---|---|
protected RestContext |
getContext()
Returns the read-only context object that contains all the configuration information about this resource.
|
Swagger |
getOptions(RestRequest req)
[OPTIONS /*] - Show resource options.
|
RestRequest |
getRequest()
Returns the current HTTP request.
|
RestResponse |
getResponse()
Returns the current HTTP response.
|
void |
log(Level level,
String msg,
Object... args)
Log a message.
|
void |
log(Level level,
Throwable cause,
String msg,
Object... args)
Log a message.
|
void |
log(String msg)
Log a message.
|
void |
log(String msg,
Throwable cause)
Log a message.
|
void |
logObjects(Level level,
String msg,
Object... args)
Log a message.
|
void |
onPostInit(RestContext context)
Post-initialization hook to retrieve the
RestContext object for this resource. |
public BasicRest()
@RestHook(value=POST_INIT) public void onPostInit(RestContext context)
RestContext
object for this resource.context
- The context for this resource.public Swagger getOptions(RestRequest req)
getOptions
in interface BasicRestConfig
req
- The HTTP request.protected RestContext getContext()
public void log(String msg, Throwable cause)
msg
- The message to log.cause
- The cause.public void log(Level level, String msg, Object... args)
level
- The log level.msg
- The message to log.args
- Optional MessageFormat
-style arguments.public void logObjects(Level level, String msg, Object... args)
level
- The log level.msg
- The message to log.args
- Optional MessageFormat
-style arguments.public void log(Level level, Throwable cause, String msg, Object... args)
level
- The log level.cause
- The cause.msg
- The message to log.args
- Optional MessageFormat
-style arguments.public RestRequest getRequest()
public RestResponse getResponse()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.