Skip to main content

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 bridgeUrl
)

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
bridgeUrlStringBridge's Endpoint URL

Methods

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.