Skip to main content
reference

PrivmxEndpoint

Extends BasicPrivmxEndpoint with event callbacks dispatcher.

Constructors

PrivmxEndpoint

Calls BasicPrivmxEndpoint#BasicPrivmxEndpoint(Set, String, String, String).

public void PrivmxEndpoint(
Set<Modules> enableModule,
String userPrivateKey,
String solutionId,
String platformUrl
)

NameTypeDescription
enableModuleSet<Modules>set of modules to initialize; should contain Modules#THREAD to enable Thread module or Modules#STORE to enable Store module
userPrivateKeyStringuser private key used to authorize; generated from: CryptoApi#generatePrivateKey or CryptoApi#derivePrivateKey
solutionIdString`SolutionId` of the current project
platformUrlStringPlatform's Endpoint URL

Methods

close

Disconnects from PrivMX Bridge and frees memory.

public void close()

handleEvent

Handles event and invokes all related callbacks. It should only be called by event loops.

public void handleEvent(
Event<?> event
)

NameTypeDescription
eventEvent<?>event to handle

registerCallback

Registers callbacks with the specified type.

public final <T> void registerCallback(
Object context,
EventType<T> eventType,
EventCallback<T> callback
)

NameTypeDescription
contextObjectan object that identifies callbacks in the list
eventTypeEventType<T>type of event to listen to
callbackEventCallback<T>a block of code to execute when event was handled

unregisterAll

Unregisters all callbacks registered by #registerCallback(Object, EventType, EventCallback).

public void unregisterAll()

unregisterCallbacks

Unregisters all callbacks registered by #registerCallback(Object, EventType, EventCallback) and identified with given Context.

public void unregisterCallbacks(
Object context
)

NameTypeDescription
contextObjectan object that identifies callbacks in the list.