Class APIResource
java.lang.Object
org.wso2.carbon.inbound.endpoint.internal.http.api.APIResource
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidbuildMessage(org.apache.synapse.MessageContext synCtx) Builds the message by consuming the input stream.final org.apache.synapse.api.dispatch.DispatcherHelperGets theDispatcherHelperrelated to the the Resource.Gets the HTTP methods supported by this Resource.abstract booleaninvoke(org.apache.synapse.MessageContext synCtx) Invokes the API Resource.
-
Constructor Details
-
APIResource
Constructor for creating an API Resource.- Parameters:
urlTemplate- the url template of the Resource
-
-
Method Details
-
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 theDispatcherHelperrelated 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
-