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

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
)

subscribeForCustomEvents

Subscribe for the custom events on the given channel.

Params

contextId

String

ID of the Context

channelName

String

name of the Channel

public void subscribeForCustomEvents(
String contextId,
String channelName
)

unsubscribeFromCustomEvents

Unsubscribe from the custom events on the given channel.

Params

contextId

String

ID of the Context

channelName

String

name of the Channel

public void unsubscribeFromCustomEvents(
String contextId,
String channelName
)

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