Class APIResource
- java.lang.Object
-
- org.wso2.carbon.inbound.endpoint.internal.http.api.APIResource
-
public abstract class APIResource extends Object
APIResource
is the abstract implementation of a Resource in an Internal API. AnInternalAPI
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 throughInternalAPI.getResources()
method.
-
-
Constructor Summary
Constructors Constructor Description APIResource(String urlTemplate)
Constructor for creating an API Resource.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
buildMessage(org.apache.synapse.MessageContext synCtx)
Builds the message by consuming the input stream.org.apache.synapse.api.dispatch.DispatcherHelper
getDispatcherHelper()
Gets theDispatcherHelper
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.
-
-
-
Constructor Detail
-
APIResource
public APIResource(String urlTemplate)
Constructor for creating an API Resource.- Parameters:
urlTemplate
- the url template of the Resource
-
-
Method Detail
-
getMethods
public abstract Set<String> getMethods()
Gets the HTTP methods supported by this Resource.- Returns:
- the supported HTTP methods
-
invoke
public abstract boolean invoke(org.apache.synapse.MessageContext synCtx)
Invokes the API Resource.- Parameters:
synCtx
- the Synapse Message Context- Returns:
- whether to continue post invocation tasks
-
getDispatcherHelper
public final org.apache.synapse.api.dispatch.DispatcherHelper getDispatcherHelper()
Gets theDispatcherHelper
related to the the Resource.- Returns:
- the DispatcherHelper
-
buildMessage
public final void buildMessage(org.apache.synapse.MessageContext synCtx)
Builds the message by consuming the input stream.- Parameters:
synCtx
- the Synapse Message Context
-
-