Package nl.tue.id.oocsi.client.protocol

# Class Handler

java.lang.Object
nl.tue.id.oocsi.client.protocol.Handler

Direct Known Subclasses:
  `DataHandler`, `EventHandler`, `MultiHandler`, `Responder`

    public abstract class Handler
    extends java.lang.Object

event handler for events with structured data

Author:
  matsfunk

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `Handler()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static java.util.Map<java.lang.String,​java.lang.Object>` | `parseData​(java.lang.String data)` | parse the given "data" String into a Map
  `static long` | `parseTimestamp​(java.lang.String timestamp)` | parse the given "timestamp" String into a long value
  `abstract void` | `receive​(java.lang.String sender, java.util.Map<java.lang.String,​java.lang.Object> data, long timestamp, java.lang.String channel, java.lang.String recipient)` | abstract method to be implemented in anonymous classes that are instantiated by subscribing and registering for events
  `void` | `send​(java.lang.String sender, java.lang.String data, java.lang.String timestamp, java.lang.String channel, java.lang.String recipient)` | raw data wrapper; will parse the incoming data and forward the event to the actual handler

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

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

- ## Constructor Details

  - ### Handler

    public Handler()

- ## Method Details

  - ### send

    public void send​(java.lang.String sender, java.lang.String data, java.lang.String timestamp, java.lang.String channel, java.lang.String recipient)
    raw data wrapper; will parse the incoming data and forward the event to the actual handler
    Parameters:
      `sender` -
      `data` -
      `timestamp` -
      `channel` -
      `recipient` -

  - ### receive

    public abstract void receive​(java.lang.String sender, java.util.Map<java.lang.String,​java.lang.Object> data, long timestamp, java.lang.String channel, java.lang.String recipient)
    abstract method to be implemented in anonymous classes that are instantiated by subscribing and registering for events
    Parameters:
      `sender` -
      `data` -
      `timestamp` -
      `channel` -
      `recipient` -

  - ### parseData

    public static java.util.Map<java.lang.String,​java.lang.Object> parseData​(java.lang.String data) throws java.io.IOException, java.lang.ClassNotFoundException
    parse the given "data" String into a Map
    Parameters:
      `data` -
    Returns:
    Throws:
      `java.io.IOException`
      `java.lang.ClassNotFoundException`

  - ### parseTimestamp

    public static long parseTimestamp​(java.lang.String timestamp)
    parse the given "timestamp" String into a long value
    Parameters:
      `timestamp` -
    Returns: