public abstract class APIResource extends Object
APIResource
is the abstract implementation of a Resource in an Internal API.
An InternalAPI
must have one or more Resources. So if we want to register an internal api into EI,
we need to create one or more Resources extending this abstract class and make it accessible through
InternalAPI.getResources()
method.Constructor and Description |
---|
APIResource(String urlTemplate)
Constructor for creating an API Resource.
|
Modifier and Type | Method and Description |
---|---|
void |
buildMessage(org.apache.synapse.MessageContext synCtx)
Builds the message by consuming the input stream.
|
org.apache.synapse.rest.dispatch.DispatcherHelper |
getDispatcherHelper()
Gets the
DispatcherHelper related to the the Resource. |
abstract Set<String> |
getMethods()
Gets the HTTP methods supported by this Resource.
|
abstract boolean |
invoke(org.apache.synapse.MessageContext synCtx)
Invokes the API Resource.
|
public APIResource(String urlTemplate)
urlTemplate
- the url template of the Resourcepublic abstract Set<String> getMethods()
public abstract boolean invoke(org.apache.synapse.MessageContext synCtx)
synCtx
- the Synapse Message Contextpublic final org.apache.synapse.rest.dispatch.DispatcherHelper getDispatcherHelper()
DispatcherHelper
related to the the Resource.public final void buildMessage(org.apache.synapse.MessageContext synCtx)
synCtx
- the Synapse Message ContextCopyright © 2020 WSO2. All rights reserved.