public class ServiceBridge extends BaseCommunicationBridge implements IService, APIBridge
apiGroup| Constructor and Description |
|---|
ServiceBridge(IService delegate)
Constructor with delegate.
|
| Modifier and Type | Method and Description |
|---|---|
IService |
getDelegate()
Get the delegate implementation.
|
ServiceRequest |
getServiceRequest(ServiceToken serviceToken)
Create a service request for the given ServiceToken.
|
ServiceToken[] |
getServicesRegistered()
Returns all the possible service tokens configured in the platform's XML service definition file.
|
ServiceToken |
getServiceToken(java.lang.String serviceName,
java.lang.String endpointName,
java.lang.String functionName,
IServiceMethod method)
Obtains a ServiceToken for the given parameters to be used for the creation of requests.
|
ServiceToken |
getServiceTokenByUri(java.lang.String uri)
Obtains a Service token by a concrete uri (http://domain.com/path).
|
APIResponse |
invoke(APIRequest request)
Invokes the given method specified in the API request object.
|
void |
invokeService(ServiceRequest serviceRequest,
IServiceResultCallback callback)
Executes the given ServiceRequest and provides responses to the given callback handler.
|
boolean |
isServiceRegistered(java.lang.String serviceName,
java.lang.String endpointName,
java.lang.String functionName,
IServiceMethod method)
Checks whether a specific service, endpoint, function and method type is configured in the platform's
XML service definition file.
|
void |
setDelegate(IService delegate)
Set the delegate implementation.
|
getAPIGroup, getAPIVersion, getJSONParserclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAPIGroup, getAPIVersionpublic ServiceBridge(IService delegate)
delegate - The delegate implementing platform specific functions.public final IService getDelegate()
public final void setDelegate(IService delegate)
delegate - The delegate implementing platform specific functions.public ServiceRequest getServiceRequest(ServiceToken serviceToken)
getServiceRequest in interface IServiceserviceToken - ServiceToken to be used for the creation of the request.public ServiceToken getServiceToken(java.lang.String serviceName, java.lang.String endpointName, java.lang.String functionName, IServiceMethod method)
getServiceToken in interface IServiceserviceName - Service name.endpointName - Endpoint name.functionName - Function name.method - Method type.public ServiceToken getServiceTokenByUri(java.lang.String uri)
getServiceTokenByUri in interface IServiceuri - Unique Resource Identifier for a Service-Endpoint-Path-Methodpublic ServiceToken[] getServicesRegistered()
getServicesRegistered in interface IServicepublic void invokeService(ServiceRequest serviceRequest, IServiceResultCallback callback)
invokeService in interface IServiceserviceRequest - ServiceRequest with the request body.callback - IServiceResultCallback to handle the ServiceResponse.public boolean isServiceRegistered(java.lang.String serviceName,
java.lang.String endpointName,
java.lang.String functionName,
IServiceMethod method)
isServiceRegistered in interface IServiceserviceName - Service name.endpointName - Endpoint name.functionName - Function name.method - Method type.public APIResponse invoke(APIRequest request)
invoke in interface APIBridgeinvoke in class BaseCommunicationBridgerequest - APIRequest object containing method name and parameters.