PrivMX DOCS
API Reference/PrivMX Endpoint Java Extra/Core

PrivmxEndpoint

Extends BasicPrivmxEndpoint with event callbacks dispatcher.

Constructors

PrivmxEndpoint

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

Params

enableModule

Set<Modules>

set of modules to initialize; should contain Modules#THREAD to enable Thread module or Modules#STORE to enable Store module

userPrivateKey

String

user private key used to authorize; generated from: CryptoApi#generatePrivateKey or CryptoApi#derivePrivateKey

solutionId

String

SolutionId of the current project

bridgeUrl

String

Bridge Server URL

verificationOptions

PKIVerificationOptions

PrivMX Bridge server instance verification options using a PKI server

public void PrivmxEndpoint(
Set<Modules> enableModule,
String userPrivateKey,
String solutionId,
String bridgeUrl,
PKIVerificationOptions verificationOptions
)

PrivmxEndpoint

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

Params

enableModule

Set<Modules>

set of modules to initialize; should contain Modules#THREAD to enable Thread module or Modules#STORE to enable Store module

userPrivateKey

String

user private key used to authorize; generated from: CryptoApi#generatePrivateKey or CryptoApi#derivePrivateKey

solutionId

String

SolutionId of the current project

bridgeUrl

String

Bridge Server URL

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

Methods

handleEvent

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

Params

event

Event<?>

event to handle

public void handleEvent(
Event<?> event
)

registerCallback

Register single callback for a specified event type. If you need to register multiple callbacks simultaneously, consider using the #registerManyCallbacks.

Params

callbackGroup

Object

An identifier used to group related callbacks

eventType

EventType<T>

The specific type of event to subscribe to

callback

EventCallback<T>

The block of code that will be executed when an event of the specified eventType is handled

public <T> RegistrationResult registerCallback(
Object callbackGroup,
EventType<T> eventType,
EventCallback<T> callback
)

Returns

RegistrationResult · registration result contains Throwable error if an exception occurs during registering.

registerManyCallbacks

Registers multiple callbacks in a batch. This method allows for the registration of several event listeners at once, which is more efficient than registering each callback individually, because the number of requests can be minimized.

Params

registrations

CallbackRegistration<?>[]

A list of CallbackRegistration objects. Each object encapsulates the details for a single event listener to be registered, including the event type, the callback to execute, and a callback group identifier.

public List<RegistrationResult> registerManyCallbacks(
CallbackRegistration<?>[] registrations
)

Returns

List<RegistrationResult> · A list of results, in an order matching the input registrations. Each result contains a Throwable error if an exception occurred during its corresponding registration.

unregisterAll

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

public void unregisterAll()

unregisterCallbacks

Unregisters all callbacks associated with the given group references.

Params

callbackGroups

Object[]

callback groups to unregister. Passing more groups allows optimize amount of request sending to server.

public void unregisterCallbacks(
Object[] callbackGroups
)

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.