Package com.avoka.tm.svc
Class ServiceInvoker
java.lang.Object
com.avoka.tm.svc.ServiceInvoker
Provides a Service Definition service invoker class.
Examples
Please find the service invoker examples below.
Service Invoke Example
These Groovy examples show how to invoke service by name, client and version (current, highest, third).
import com.avoka.tm.svc.ServiceInvoker Object currentVer = new ServiceInvoker() .setServiceName("myServiceName") .setClientCode("client") .invoke(); Object highestVer = new ServiceInvoker() .setServiceName("myServiceName") .setClientCode("client") .withHighestVersion() .invoke(); Object thirdVer = new ServiceInvoker() .setServiceName("myServiceName") .setClientCode("client") .setVersion("0.3.1") .invoke()
- Since:
- 5.0.0
-
Constructor Summary
ConstructorDescriptionCreate a service invoker object.ServiceInvoker
(SvcDef svcDef) Create a service invoker object. -
Method Summary
Modifier and TypeMethodDescriptioninvoke()
Invoke the service specified by the service definition name, version and client code and return the resulting object.Invoke the service specified by the service definition name, version and client code and return the resulting object.Invoke the service specified by the service definition name, version and client code, with the given params and return the resulting object.setClientCode
(String clientCode) Set the service definition organization client code to invoke.Set the service logger.setServiceName
(String serviceName) Set the service definition name to invoke.Set the service definition to invoke.setVersion
(String version) Set the service definition version to invoke.setVersionNumber
(int versionNumber) Deprecated.Set flag to invoke the service with highest version number.
-
Constructor Details
-
ServiceInvoker
public ServiceInvoker()Create a service invoker object. -
ServiceInvoker
Create a service invoker object.- Parameters:
svcDef
- the service definition to invoke (required)
-
-
Method Details
-
setSvcDef
Set the service definition to invoke.- Parameters:
svcDef
- the service definition- Returns:
- the service invoker
-
setServiceName
Set the service definition name to invoke.- Parameters:
serviceName
- the service definition name to invoke- Returns:
- the service invoker
-
setVersionNumber
Deprecated.Set the service definition version number to invoke. If not specified, then the current one will be used- Parameters:
versionNumber
- service definition version number to invoke- Returns:
- the service invoker
-
setVersion
Set the service definition version to invoke. If not specified, then the current one will be used- Parameters:
version
- service definition version number to invoke (required)- Returns:
- the service invoker
- Since:
- 17.10.0
-
setClientCode
Set the service definition organization client code to invoke.- Parameters:
clientCode
- service definition client code to invoke- Returns:
- the service invoker
-
setLogger
Set the service logger.- Parameters:
logger
- the service logger- Returns:
- the service invoker
- Since:
- 17.10.0
-
withHighestVersion
Set flag to invoke the service with highest version number.- Returns:
- the service invoker
-
invoke
Invoke the service specified by the service definition name, version and client code, with the given params and return the resulting object.- Parameters:
params
- the map of parameter to invoke the groovy service with- Returns:
- invoke the service and return the resulting object
-
invoke
Invoke the service specified by the service definition name, version and client code and return the resulting object. This invoke method will create a singleton map with the paramName and paramValue key/value pair.- Parameters:
paramName
- the singleton map parameter name (required)paramValue
- the singleton map parameter value (require)- Returns:
- invoke the service and return the resulting object
- Since:
- 17.10.0
-
invoke
Invoke the service specified by the service definition name, version and client code and return the resulting object.- Returns:
- invoke the service and return the resulting object
-