public interface RESTHandler
This SPI allows other bundles to register themselves as listeners for a certain URL sub-root, which is defined by specifying an OSGi property with key = RESTHandler.PROPERTY_REST_HANDLER_ROOT and value = URL.
The registered URL will be attached to the core REST Handler framework context root, which is /ibm/api.
As an example: if a bundle has an OSGi component implementing the RESTHandler interface and with a RESTHandler.PROPERTY_REST_HANDLER_ROOT=/myCustomRoot, then that OSGi component will be called everytime a new HTTPs request comes into:
https://<hostname>:<https_port>/ibm/api/myCustomRootThe feature that controls the REST Handler framework is "restHandler-1.0", but it is protected, therefore it must be enabled by another feature (ie: by the feature that contains the bundle that implements RESTHandler interface).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_REST_HANDLER_CONTEXT_ROOT
OSGi property used to define the context root that this rest handler contributes to, starting with a slash.
|
static java.lang.String |
PROPERTY_REST_HANDLER_CUSTOM_CORS
OSGi property used to specify whether or not this RESTHandler will implement its own Cross Origin Resource Sharing code.
|
static java.lang.String |
PROPERTY_REST_HANDLER_CUSTOM_ROUTING
OSGi property used to specify whether or not this RESTHandler will implement its own routing code.
|
static java.lang.String |
PROPERTY_REST_HANDLER_CUSTOM_SECURITY
OSGi property used to specify whether or not this RESTHandler will implement its own authorization code.
|
static java.lang.String |
PROPERTY_REST_HANDLER_DEFAULT_CONTEXT_ROOT
The value of the default context root.
|
static java.lang.String |
PROPERTY_REST_HANDLER_HIDDEN_API
OSGi property used to specify whether or not this RESTHandler should be hidden from the top-level ibm/api query of available APIs.
|
static java.lang.String |
PROPERTY_REST_HANDLER_ROOT
OSGi property used to define the sub-root that this rest handler listens to, starting with a slash.
|
Modifier and Type | Method and Description |
---|---|
void |
handleRequest(RESTRequest request,
RESTResponse response)
This method gets called for every URL request that came in through the RESTHandlerContainer and matched the registered paths of this handler.
|
static final java.lang.String PROPERTY_REST_HANDLER_ROOT
static final java.lang.String PROPERTY_REST_HANDLER_CONTEXT_ROOT
static final java.lang.String PROPERTY_REST_HANDLER_DEFAULT_CONTEXT_ROOT
static final java.lang.String PROPERTY_REST_HANDLER_CUSTOM_SECURITY
static final java.lang.String PROPERTY_REST_HANDLER_CUSTOM_ROUTING
static final java.lang.String PROPERTY_REST_HANDLER_CUSTOM_CORS
static final java.lang.String PROPERTY_REST_HANDLER_HIDDEN_API
void handleRequest(RESTRequest request, RESTResponse response) throws java.io.IOException
request
- encapsulates the artifacts for the HTTP requestresponse
- encapsulates the artifacts for the HTTP responsejava.io.IOException
- if an I/O exception occurred.