Interface EndpointService
@ProviderType
public interface EndpointService
This is the interface for the EndpointService.
Using this service, the calling component can post to and retrieve from the endpoint.
All the plumbing around authentication will be taken care of.
Example how to use the service in your custom code:
Using this service, the calling component can post to and retrieve from the endpoint.
All the plumbing around authentication will be taken care of.
Example how to use the service in your custom code:
@Reference(target="(id=yourEndpointId)")private EndpointService endpointService;
-
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the headers that are set via the configuration.getId()The id of the endpoint that is defined via the configurationThe method of the endpoint that is defined via the configurationgetUrl()The url of the endpoint that is defined via the configurationbooleanThis is a test for the connection to the endpoint.com.google.gson.JsonObjectPerforms the action connected to the endpoint.com.google.gson.JsonObjectperformIO_Action(com.google.gson.JsonObject payload) Performs the action connected to the endpoint with the specified payload.com.google.gson.JsonObjectperformIO_Action(String url, String method, String[] headers, com.google.gson.JsonObject payload) Performs the action connected to the endpoint.com.google.gson.JsonObjectperformIO_Action(Map<String, String> queryParameters) Performs the action connected to the endpoint, with the specified queryParameters.
-
Method Details
-
getId
String getId()The id of the endpoint that is defined via the configuration- Returns:
- The ID of the endpoint
-
getMethod
String getMethod()The method of the endpoint that is defined via the configuration- Returns:
- The method of the endpoint
-
getUrl
String getUrl()The url of the endpoint that is defined via the configuration- Returns:
- The url of this endpoint
-
performIO_Action
com.google.gson.JsonObject performIO_Action()Performs the action connected to the endpoint.- Returns:
- JsonObject containing the result of the action
-
performIO_Action
com.google.gson.JsonObject performIO_Action(String url, String method, String[] headers, com.google.gson.JsonObject payload) Performs the action connected to the endpoint. With the parameters you can influence all the aspects of the api-call.- Parameters:
url- the url of the api call, the url can include queryparametermethod- the method of the api call, like GET or POSTheaders- headers that need to passed to the api, on top of the authentication headerspayload- an optional payload for the api-call- Returns:
- JsonObject containing the result of the action
-
performIO_Action
Performs the action connected to the endpoint, with the specified queryParameters.- Parameters:
queryParameters- query parameters to pass to the endpoint- Returns:
- JsonObject containing the result of the action
-
performIO_Action
com.google.gson.JsonObject performIO_Action(com.google.gson.JsonObject payload) Performs the action connected to the endpoint with the specified payload.- Parameters:
payload- JsonObject containing the data that is used in the action- Returns:
- JsonObject containing the result of the action
-
isConnected
boolean isConnected()This is a test for the connection to the endpoint. The test will be performed using the URL and the GET-method.- Returns:
- TRUE if connection is successful
-
getConfigServiceSpecificHeaders
String[] getConfigServiceSpecificHeaders()Gets the headers that are set via the configuration.- Returns:
- an array with the headers, in the format <name:value>
-