Interface: Router

olympe.dc. Router

The router is the gateway for all messages sent to external sources of the datacloud (orchestrator and other OVM).

Methods


<abstract> offMessage(type, id)

Unregister the message handler with the specified id previously registered for the specified type.

Parameters:
Name Type Description
type olympe.dc.Message.MessageType
id string

<abstract> offSourceEvent(id)

Unregisters the callback associated to the specified id.

Parameters:
Name Type Description
id string

The ID of the registered callback.


<abstract> onMessage(type, handler, contentType [, id])

Register a handler for the specified type of message incoming from any source registered in the router.

Parameters:
Name Type Argument Description
type olympe.dc.Message.MessageType
handler olympe.dc.Message.MessageHandler.<T>
contentType function
id string <optional>

the handler id

Returns:

The final id d used to register the handler

Type
string

<abstract> onSourceEvent(callback [, id])

Registers a callback to be called when an event is raised by a source.

Parameters:
Name Type Argument Description
callback olympe.dr.Source.EventHandler

The function to callback.

id string <optional>

The id of the callback, if omitted one will be generated.

Returns:

The id of the callback.

Type
string

<abstract> send(message)

Send the specified message from the local datacloud to the global datacloud.

Parameters:
Name Type Description
message olympe.dc.Message

The message to send.