public interface AdaptersAPI
Context
private AdaptersAPI adaptersApi;
}
Modifier and Type | Method and Description |
---|---|
org.apache.http.client.methods.HttpUriRequest |
createJavascriptAdapterRequest(java.lang.String adapter,
java.lang.String procedure,
java.lang.Object[] args)
Helper method to create request to a JS adapter (via REST)
|
org.apache.http.HttpResponse |
executeAdapterRequest(org.apache.http.client.methods.HttpUriRequest request)
Sends HTTP request to another REST or Javascript adapter.
|
java.lang.String |
getAdapterName()
Returns the name of the current adapter
|
java.lang.Object |
getJaxRsApplication(java.lang.Class applicationClass)
Returns the Jax-RS application class of the current adapter, casted to the given class.
|
JSONObject |
getResponseAsJSON(org.apache.http.HttpResponse response)
Reads the response to JSON.
|
org.apache.http.HttpResponse executeAdapterRequest(org.apache.http.client.methods.HttpUriRequest request) throws java.io.IOException
request
- - Apache HttpUriRequest
to be sent to the adapter. The URI of this request must not be
absolute. It must be relative to the "/adapters" endpoint. For example: "/myadapter/getStories"HttpResponse
)java.io.IOException
MFPServerOAuthException
JSONObject getResponseAsJSON(org.apache.http.HttpResponse response) throws java.io.IOException
response
- - The response to be readjava.io.IOException
org.apache.http.client.methods.HttpUriRequest createJavascriptAdapterRequest(java.lang.String adapter, java.lang.String procedure, java.lang.Object[] args)
adapter
- - The adapter nameprocedure
- - The procedure nameargs
- - Arguments to be passed (Optional)java.lang.String getAdapterName()
java.lang.Object getJaxRsApplication(java.lang.Class applicationClass)
java.lang.IllegalArgumentException
- if applicationClass is null or not applicable
© Copyright IBM Corp. 2006, 2015. All Rights Reserved.