Package nl.tue.id.oocsi.client.services

# Class OOCSICall

java.lang.Object
nl.tue.id.oocsi.OOCSIEvent
nl.tue.id.oocsi.client.protocol.OOCSIMessage
nl.tue.id.oocsi.client.services.OOCSICall

All Implemented Interfaces:
  `OOCSIData`

    public class OOCSICall
    extends OOCSIMessage

call helper class for constructing, sending and receiving (function) calls over OOCSI

Author:
  matsfunk

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `static java.lang.String` | `MESSAGE_HANDLE` |
  `static java.lang.String` | `MESSAGE_ID` |

  ### Fields inherited from class nl.tue.id.oocsi.client.protocol.OOCSIMessage

  `oocsi`

  ### Fields inherited from class nl.tue.id.oocsi.OOCSIEvent

  `channelName, data, sender, timestamp`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `OOCSICall​(OOCSIClient oocsi, java.lang.String callName, int timeoutMS, int maxResponses)` | create a new message to the channel "channelName"
  `OOCSICall​(OOCSIClient oocsi, java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)` | create a new message to the channel "channelName"

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `boolean` | `canSend()` | check whether all values have been filled in for sending the call
  `OOCSICall` | `data​(java.lang.String key, boolean value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, double value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, float value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, int value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, long value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, java.lang.Object value)` | store data in message
  `OOCSICall` | `data​(java.lang.String key, java.lang.String value)` | store data in message
  `OOCSICall` | `data​(java.util.Map<java.lang.String,​? extends java.lang.Object> bulkData)` | store bulk data in message
  `OOCSIEvent` | `getFirstResponse()` | retrieve the first response to this call as an OOCSIEvent
  `java.lang.String` | `getId()` | return unique id of this OOCSI call
  `boolean` | `hasResponse()` | check whether this call has gotten a response
  `boolean` | `isValid()` | check whether this call is still not expired or has gotten a response
  `void` | `respond​(java.util.Map<java.lang.String,​java.lang.Object> data)` | add a response to this open call
  `void` | `send()` | send message
  `OOCSICall` | `sendAndWait()` | send message and then wait until either the timeout has passed or at least one response has been recorded
  `OOCSICall` | `sendAndWait​(int ms)` | send message and then wait until either the timeout given by `ms` has passed or at least one response has been recorded
  `OOCSICall` | `waitForResponse()` | wait until either the timeout has passed or at least one response has been recorded

  ### Methods inherited from class nl.tue.id.oocsi.client.protocol.OOCSIMessage

  `data, internal`

  ### Methods inherited from class nl.tue.id.oocsi.OOCSIEvent

  `getArray, getBoolean, getBooleanArray, getChannel, getDouble, getDoubleArray, getFloat, getFloatArray, getInt, getIntArray, getLong, getLongArray, getObject, getRecipient, getSender, getString, getString, getStringArray, getTime, getTimestamp, has, keys, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### MESSAGE_HANDLE

    public static final java.lang.String MESSAGE_HANDLE
    See Also:
      Constant Field Values

  - ### MESSAGE_ID

    public static final java.lang.String MESSAGE_ID
    See Also:
      Constant Field Values

- ## Constructor Details

  - ### OOCSICall

    public OOCSICall​(OOCSIClient oocsi, java.lang.String callName, int timeoutMS, int maxResponses)
    create a new message to the channel "channelName"
    Parameters:
      `oocsi` -
      `callName` -
      `timeoutMS` -
      `maxResponses` -

  - ### OOCSICall

    public OOCSICall​(OOCSIClient oocsi, java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)
    create a new message to the channel "channelName"
    Parameters:
      `oocsi` -
      `channelName` -
      `callName` -
      `timeoutMS` -
      `maxResponses` -

- ## Method Details

  - ### getId

    public java.lang.String getId()
    return unique id of this OOCSI call
    Returns:

  - ### respond

    public void respond​(java.util.Map<java.lang.String,​java.lang.Object> data)
    add a response to this open call
    Parameters:
      `data` -

  - ### canSend

    public boolean canSend()
    check whether all values have been filled in for sending the call
    Returns:

  - ### isValid

    public boolean isValid()
    check whether this call is still not expired or has gotten a response
    Returns:

  - ### hasResponse

    public boolean hasResponse()
    check whether this call has gotten a response
    Returns:

  - ### getFirstResponse

    public OOCSIEvent getFirstResponse()
    retrieve the first response to this call as an OOCSIEvent
    Returns:

  - ### send

    public void send()
    Description copied from class: `OOCSIMessage`
    send message
    Overrides:
      `send` in class `OOCSIMessage`

  - ### sendAndWait

    public OOCSICall sendAndWait()
    send message and then wait until either the timeout has passed or at least one response has been recorded
    Returns:

  - ### sendAndWait

    public OOCSICall sendAndWait​(int ms)
    send message and then wait until either the timeout given by `ms` has passed or at least one response has been recorded
    Parameters:
      `ms` - timeout
    Returns:

  - ### waitForResponse

    public OOCSICall waitForResponse()
    wait until either the timeout has passed or at least one response has been recorded
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, java.lang.String value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, boolean value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, int value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, float value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, double value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, long value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.lang.String key, java.lang.Object value)
    Description copied from class: `OOCSIMessage`
    store data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns:

  - ### data

    public OOCSICall data​(java.util.Map<java.lang.String,​? extends java.lang.Object> bulkData)
    Description copied from class: `OOCSIMessage`
    store bulk data in message
    Specified by:
      `data` in interface `OOCSIData`
    Overrides:
      `data` in class `OOCSIMessage`
    Returns: