PrivMX DOCS
API Reference/PrivMX Endpoint Java/Event

EventApi

Manages PrivMX Bridge custom events.

Constructors

EventApi

Initialize Event module on passed active connection.

Params

connection

Connection

active connection to PrivMX Bridge

public void EventApi(
Connection connection
)

Methods

buildSubscriptionQuery

Generate subscription Query for the custom events.

Params

channelName

String

name of the Channel

selectorType

CustomEventSelectorType

selector of scope on which you listen for events

selectorId

String

ID of the selector

public String buildSubscriptionQuery(
String channelName,
CustomEventSelectorType selectorType,
String selectorId
)

Returns

String · Query for subscribing event

close

Frees memory.

public void close()

emitEvent

Emits the custom event on the given Context and channel.

Params

contextId

String

ID of the Context

users

List<UserWithPubKey>

list of UserWithPubKey objects which defines the recipients of the event

channelName

String

name of the Channel

eventData

byte[]

event's data

public void emitEvent(
String contextId,
List<UserWithPubKey> users,
String channelName,
byte[] eventData
)

subscribeFor

Subscribe for the custom events on the given subscription query.

Params

subscriptionQueries

List<String>

list of queries

public List<String> subscribeFor(
List<String> subscriptionQueries
)

Returns

List<String> · list of subscriptionIds in matching order to subscriptionQueries

unsubscribeFrom

Unsubscribe from events for the given subscriptionId.

Params

subscriptionIds

List<String>

list of subscriptionId

public void unsubscribeFrom(
List<String> subscriptionIds
)

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.

PrivMX Endpoint Java v2.6

This package is not up to date with the core documentation. Some of the features you've seen described in other parts of the documentation might not be mentioned here. Those changes do not influence compatibility, however
EventApi | PrivMX Docs