Class ApiModuleClient
java.lang.Object
com.scaleoutsoftware.modules.client.ApiModuleClient
The MsgModuleClient is used to send messages to a client and access the underlying module cache.
-
Constructor Summary
ConstructorsConstructorDescriptionApiModuleClient(com.scaleout.client.GridConnection connection, String moduleName) Default constructor for a ApiModuleClient. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Sends a messages to a module with the default timeout of 5 seconds.byte[]Sends a messages to a module with a configurable timeout.
-
Constructor Details
-
ApiModuleClient
Default constructor for a ApiModuleClient.- Parameters:
connection- the GridConnection to a ScaleOut store.moduleName- the API module name.
-
-
Method Details
-
invoke
public byte[] invoke(String objectId, String operationId, byte[] operationParams) throws ApiModuleException Sends a messages to a module with the default timeout of 5 seconds.- Parameters:
objectId- the unique SOSS object id.operationId- the module name.operationParams- the serialized message.- Returns:
- The serialized return value of the invoked endpoint or if an exception occurs in message processing or the request times out, an exception is reported
- Throws:
ApiModuleException- if an exception occurs during the invoke operation. SeeApiModuleExceptionfor details on causes.
-
invoke
public byte[] invoke(String objectId, String operationId, byte[] operationParams, Duration timeout) throws ApiModuleException Sends a messages to a module with a configurable timeout.- Parameters:
objectId- the unique SOSS object id.operationId- the module name.operationParams- the serialized message.timeout- the duration of time in seconds before a timeout occurs.- Returns:
- The serialized return value of the invoked endpoint or if an exception occurs in message processing or the request times out, an exception is reported
- Throws:
ApiModuleException- if an exception occurs during the invoke operation. SeeApiModuleExceptionfor details on causes.
-