Previous Topic

Next Topic

Book Contents

Book Index

Event Admin JSON-RPC API

A description of the Methods and Objects exported by the JSON-RPC Event Admin Remote Handler.

Methods

The Event Admin JSON-RPC API have the following methods:

Method

Return Value

Parameters

Parameter Description

RE/subscribe

String. The id of the new subscription

  • eventTopic: String
  • filter: string
  • eventTopic: String – Topic to subscribe for.
  • filter: string – Can't be null.Additional event filter; can be null

RE/subscribe

String. The id of the new subscription

  • eventTopics: String[]
  • filter: string
  • eventTopics: String[] – A list of topics to subscribe for.
  • filter: string – Can't be null.Additional event filter; can be null

RE/subscribe

String. The id of the new subscription

  • params: SubscriptionParams[]
  • params: SubscriptionParams[] – A list of topic&filter pairs

RE/unsubscribe

none

  • subscriptionId : String
  • subscriptionId : String – The id of the subscription to cancel.

RE/poll

Event[]. List of available events

  • subscriptionId : String
  • subscriptionId : String – The id of the subscription to poll.

RE/longPoll

Event[]. List of available events

  • subscriptionId : String
  • timeoutSeconds: int
  • subscriptionId : String – The id of the subscription to poll.
  • timeoutSeconds: int – The number of seconds to wait for atleast one event to become available.

The following Event Admin JSON-RPC API methods are deprecated.

Method

Return Value

Parameters

Parameter Description

EA/subscribe

String for a tracking_id. An error will occur if the filter or properties are not valid.

  • topics: string[]
  • filter: string
  • props: object
  • topics: string[] – Topics as defined in the OSGi Event Admin specification.
  • filter: string – Only events matching this filter will be provided. Can be null.
  • props: object – Additional properties to subscribe with in the Event Admin in the form of a key-value JavaScript object. The keys should be based on the OSGi Event Admin specification.

EA/unsubscribe

Boolean, which can be true if there are discarded events and false otherwise

  • tracking_id: string
  • tracking_id: string – The tracking ID to unsubscribe. If null passed, then all events will be unsubscribed. In any case existing events will be discarded from the queue and will no longer be returned.

EA/poll

object[]. The keys are not predefined as they depend on the concrete type of events being communicated.

  • tracking_id: string
  • discard_read: boolean
  • tracking_id: string – The tracking ID to poll.
  • discard_read: boolean – If true, the read events will be discarded from the queue and will no longer be returned.

Common Object Definitions

Object

Field

Field Description

Supported JSON Types

No specific value

  • string
  • object
  • array
  • true
  • false
  • null.

SubscriptionParams

  • topic : String
  • filter : String
  • Event topic
  • Optional event filter

Event

  • topic : String
  • properties : Object
  • Event topic
  • Event properties