Package nl.tue.id.oocsi

# Class OOCSICommunicator

java.lang.Object
nl.tue.id.oocsi.client.OOCSIClient
nl.tue.id.oocsi.OOCSICommunicator

    public class OOCSICommunicator
    extends OOCSIClient

communication interface for OOCSI client

Author:
  matsfunk

- ## Field Summary

  ### Fields inherited from class nl.tue.id.oocsi.client.OOCSIClient

  `channels, name, sc, services, VERSION`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `OOCSICommunicator​(java.lang.Object parent, java.lang.String name)` | constructor

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `OOCSICall` | `call​(java.lang.String callName)` | create a call for service method "callName"
  `OOCSICall` | `call​(java.lang.String callName, int timeoutMS)` | create a call for service method "callName" with a specific timeout
  `OOCSICall` | `call​(java.lang.String callName, int timeoutMS, int maxResponses)` | create a call for service method "callName" with a specific timeout
  `OOCSICall` | `call​(java.lang.String channelName, java.lang.String callName)` | create a call for service method "callName" on channel "channelName"
  `OOCSICall` | `call​(java.lang.String channelName, java.lang.String callName, int timeoutMS)` | create a call for service method "callName" with a specific timeout on channel "channelName"
  `OOCSICall` | `call​(java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)` | create a call for service method "callName" with a specific timeout on channel "channelName"
  `OOCSIMessage` | `channel​(java.lang.String channelName)` | send data through a channel given by the channelName
  `boolean` | `connect()` | connect to OOCSI network without a concrete server given, i.e., wait for multi-cast messages broadcasting a server to connect to
  `boolean` | `connect​(java.lang.String hostname, int port)` | connect to OOCSI network
  `Handler` | `createSimpleCallerHandler​(java.lang.String handlerName)` | create a simple handler that calls the method with the given handlerName in the parent object (without parameters)
  `boolean` | `register​(java.lang.String responderName)` | subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
  `boolean` | `register​(java.lang.String responderName, java.lang.String handlerName)` | register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
  `boolean` | `registerChannel​(java.lang.String channelName, java.lang.String responderName)` | subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
  `boolean` | `registerChannel​(java.lang.String channelName, java.lang.String responderName, java.lang.String handlerName)` | register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
  `boolean` | `subscribe​(java.lang.String channelName)` | subscribe to channel "channelName" for handler method "channelName" in the parent class; the handler method will be called with an OOCSIEvent object upon occurrence of an event; will try 'handleOOCSIEvent' as a fall-back in case no matching handler method is found for "channelName"
  `boolean` | `subscribe​(java.lang.String channelName, java.lang.String handlerName)` | subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
  `boolean` | `subscribe​(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds)` | subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
  `boolean` | `subscribe​(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender)` | subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event

  ### Methods inherited from class nl.tue.id.oocsi.client.OOCSIClient

  `channels, channels, clients, disconnect, getName, heyOOCSI, heyOOCSI, isConnected, isReconnect, kill, log, reconnect, register, register, register, send, send, setReconnect, subscribe, subscribe, unregister, unregister, unsubscribe`

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

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

- ## Constructor Details

  - ### OOCSICommunicator

    public OOCSICommunicator​(java.lang.Object parent, java.lang.String name)
    constructor
    Parameters:
      `parent` -
      `name` -

- ## Method Details

  - ### connect

    public boolean connect()
    Description copied from class: `OOCSIClient`
    connect to OOCSI network without a concrete server given, i.e., wait for multi-cast messages broadcasting a server to connect to
    Overrides:
      `connect` in class `OOCSIClient`
    Returns:

  - ### connect

    public boolean connect​(java.lang.String hostname, int port)
    Description copied from class: `OOCSIClient`
    connect to OOCSI network
    Overrides:
      `connect` in class `OOCSIClient`
    Returns:

  - ### channel

    public OOCSIMessage channel​(java.lang.String channelName)
    send data through a channel given by the channelName
    Parameters:
      `channelName` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String callName)
    create a call for service method "callName"
    Parameters:
      `callName` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String channelName, java.lang.String callName)
    create a call for service method "callName" on channel "channelName"
    Parameters:
      `channelName` -
      `callName` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String callName, int timeoutMS)
    create a call for service method "callName" with a specific timeout
    Parameters:
      `callName` -
      `timeoutMS` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String channelName, java.lang.String callName, int timeoutMS)
    create a call for service method "callName" with a specific timeout on channel "channelName"
    Parameters:
      `channelName` -
      `callName` -
      `timeoutMS` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String callName, int timeoutMS, int maxResponses)
    create a call for service method "callName" with a specific timeout
    Parameters:
      `callName` -
      `timeoutMS` -
      `maxResponses` -
    Returns:

  - ### call

    public OOCSICall call​(java.lang.String channelName, java.lang.String callName, int timeoutMS, int maxResponses)
    create a call for service method "callName" with a specific timeout on channel "channelName"
    Parameters:
      `channelName` -
      `callName` -
      `timeoutMS` -
      `maxResponses` -
    Returns:

  - ### subscribe

    public boolean subscribe​(java.lang.String channelName)
    subscribe to channel "channelName" for handler method "channelName" in the parent class; the handler method will be called with an OOCSIEvent object upon occurrence of an event; will try 'handleOOCSIEvent' as a fall-back in case no matching handler method is found for "channelName"
    Parameters:
      `channelName` -
    Returns:

  - ### subscribe

    public boolean subscribe​(java.lang.String channelName, java.lang.String handlerName)
    subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
    Parameters:
      `channelName` -
      `handlerName` -
    Returns:

  - ### subscribe

    public boolean subscribe​(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds)
    subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
    Parameters:
      `channelName` -
      `handlerName` -
      `rate` -
      `seconds` -
    Returns:

  - ### subscribe

    public boolean subscribe​(java.lang.String channelName, java.lang.String handlerName, int rate, int seconds, boolean ratePerSender)
    subscribe to channel "channelName" for handler method in the parent class with the given name "handlerName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
    Parameters:
      `channelName` -
      `handlerName` -
      `rate` -
      `seconds` -
      `ratePerSender` -
    Returns:

  - ### createSimpleCallerHandler

    public Handler createSimpleCallerHandler​(java.lang.String handlerName)
    create a simple handler that calls the method with the given handlerName in the parent object (without parameters)
    Parameters:
      `handlerName` -
    Returns:

  - ### register

    public boolean register​(java.lang.String responderName)
    subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
    Parameters:
      `responderName` -
    Returns:

  - ### register

    public boolean register​(java.lang.String responderName, java.lang.String handlerName)
    register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
    Parameters:
      `responderName` -
      `handlerName` -
    Returns:

  - ### registerChannel

    public boolean registerChannel​(java.lang.String channelName, java.lang.String responderName)
    subscribe to channel "responderName" for handler method "responderName" in the parent class; the handler method will be called with an OOCSIEvent object and a response map object upon occurrence of an event; will try 'respondToOOCSIEvent' as a fall-back in case no matching handler method is found for "responderName"
    Parameters:
      `channelName` -
      `responderName` -
    Returns:

  - ### registerChannel

    public boolean registerChannel​(java.lang.String channelName, java.lang.String responderName, java.lang.String handlerName)
    register a handler method in the parent class with the given name "handlerName" for the channel "channelName"; the handler method will be called with an OOCSIEvent object upon occurrence of an event
    Parameters:
      `channelName` -
      `responderName` -
      `handlerName` -
    Returns: