Class ApiModuleClient

java.lang.Object
com.scaleoutsoftware.modules.client.ApiModuleClient

public class ApiModuleClient extends Object
The MsgModuleClient is used to send messages to a client and access the underlying module cache.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ApiModuleClient(com.scaleout.client.GridConnection connection, String moduleName)
    Default constructor for a ApiModuleClient.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    invoke(String objectId, String operationId, byte[] operationParams)
    Sends a messages to a module with the default timeout of 5 seconds.
    byte[]
    invoke(String objectId, String operationId, byte[] operationParams, Duration timeout)
    Sends a messages to a module with a configurable timeout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ApiModuleClient

      public ApiModuleClient(com.scaleout.client.GridConnection connection, String moduleName)
      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. See ApiModuleException for 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. See ApiModuleException for details on causes.