PrivMX DOCS
API Reference/PrivMX Endpoint Java/Core

Connection

Manages a connection between the Endpoint and the Bridge server.

Static Methods

connect

Connects to PrivMX Bridge server.

Params

userPrivKey

String

user's private key

solutionId

String

ID of the Solution

bridgeUrl

String

Bridge Server URL

public static Connection connect(
String userPrivKey,
String solutionId,
String bridgeUrl
)

Returns

Connection · Connection object

connect

Connects to PrivMX Bridge server.

Params

userPrivKey

String

user's private key

solutionId

String

ID of the Solution

bridgeUrl

String

Bridge Server URL

verificationOptions

PKIVerificationOptions

PrivMX Bridge server instance verification options using a PKI server

public static Connection connect(
String userPrivKey,
String solutionId,
String bridgeUrl,
PKIVerificationOptions verificationOptions
)

Returns

Connection · Connection object

connectPublic

Connects to PrivMX Bridge server as a guest user.

Params

solutionId

String

ID of the Solution

bridgeUrl

String

Bridge Server URL

public static Connection connectPublic(
String solutionId,
String bridgeUrl
)

Returns

Connection · Connection object

connectPublic

Connects to PrivMX Bridge server as a guest user.

Params

solutionId

String

ID of the Solution

bridgeUrl

String

Bridge Server URL

verificationOptions

PKIVerificationOptions

PrivMX Bridge server instance verification options using a PKI server

public static Connection connectPublic(
String solutionId,
String bridgeUrl,
PKIVerificationOptions verificationOptions
)

Returns

Connection · Connection object

platformConnect

Connects to PrivMX Bridge server.

Params

userPrivKey

String

user's private key

solutionId

String

ID of the Solution

platformUrl

String

Platform's Endpoint URL

public static Connection platformConnect(
String userPrivKey,
String solutionId,
String platformUrl
)

Returns

Connection · Connection object

platformConnectPublic

Connects to PrivMX Bridge server as a guest user.

Params

solutionId

String

ID of the Solution

platformUrl

String

Platform's Endpoint URL

public static Connection platformConnectPublic(
String solutionId,
String platformUrl
)

Returns

Connection · Connection object

setCertsPath

Allows to set path to the SSL certificate file.

Params

certsPath

String

path to file

public static void setCertsPath(
String certsPath
)

Methods

buildSubscriptionQuery

Generate subscription Query for the Context events.

Params

eventType

CoreEventType

Type of event which you listen for

selectorType

CoreEventSelectorType

Scope on which you listen for events

selectorId

String

ID of the selector

public String buildSubscriptionQuery(
CoreEventType eventType,
CoreEventSelectorType selectorType,
String selectorId
)

Returns

String · Query for subscribing event

close

If there is an active connection then it disconnects from PrivMX Bridge and frees memory making this instance not reusable.

public void close()

disconnect

Disconnects from PrivMX Bridge server.

public void disconnect()

getConnectionId

Gets the ID of the current connection.

public Long getConnectionId()

Returns

Long · ID of the connection

listContextUsers

Gets a list of users with their status and the last status change.

Params

contextId

String

ID of the Context

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

public PagingList<UserInfo> listContextUsers(
String contextId,
long skip,
long limit,
String sortOrder
)

Returns

PagingList<UserInfo> · List of users with their status and the last status change

listContextUsers

Gets a list of users with their status and the last status change.

Params

contextId

String

ID of the Context

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

public PagingList<UserInfo> listContextUsers(
String contextId,
long skip,
long limit,
String sortOrder,
String lastId
)

Returns

PagingList<UserInfo> · List of users with their status and the last status change

listContextUsers

Gets a list of users with their status and the last status change.

Params

contextId

String

ID of the Context

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

queryAsJson

String

stringified JSON object with a custom field to filter result

public PagingList<UserInfo> listContextUsers(
String contextId,
long skip,
long limit,
String sortOrder,
String lastId,
String queryAsJson
)

Returns

PagingList<UserInfo> · List of users with their status and the last status change

listContextUsers

Gets a list of users with their status and the last status change.

Params

contextId

String

ID of the Context

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

queryAsJson

String

stringified JSON object with a custom field to filter result

sortBy

String

field name to sort elements by

public PagingList<UserInfo> listContextUsers(
String contextId,
long skip,
long limit,
String sortOrder,
String lastId,
String queryAsJson,
String sortBy
)

Returns

PagingList<UserInfo> · List of users with their status and the last status change

listContexts

Gets a list of Contexts available for the user.

Params

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

public PagingList<Context> listContexts(
long skip,
long limit,
String sortOrder
)

Returns

PagingList<Context> · list of Contexts

listContexts

Gets a list of Contexts available for the user.

Params

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

public PagingList<Context> listContexts(
long skip,
long limit,
String sortOrder,
String lastId
)

Returns

PagingList<Context> · list of Contexts

listContexts

Gets a list of Contexts available for the user.

Params

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

queryAsJson

String

stringified JSON object with a custom field to filter result

public PagingList<Context> listContexts(
long skip,
long limit,
String sortOrder,
String lastId,
String queryAsJson
)

Returns

PagingList<Context> · list of Contexts

listContexts

Gets a list of Contexts available for the user.

Params

skip

long

number of elements to skip from result

limit

long

limit of elements to return for query

sortOrder

String

order of elements in result ("asc" for ascending, "desc" for descending)

lastId

String

ID of the element from which query results should start

queryAsJson

String

stringified JSON object with a custom field to filter result

sortBy

String

field name to sort elements by

public PagingList<Context> listContexts(
long skip,
long limit,
String sortOrder,
String lastId,
String queryAsJson,
String sortBy
)

Returns

PagingList<Context> · list of Contexts

setUserVerifier

Sets user's custom verification callback.

The feature allows the developer to set up a callback for user verification. A developer can implement an interface and pass the implementation to the function. Each time data is read from the container, a callback will be triggered, allowing the developer to validate the sender in an external service, e.g. Developer's Application Server or PKI Server.

Params

userVerifier

UserVerifierInterface

an implementation of the UserVerifierInterface

public void setUserVerifier(
UserVerifierInterface userVerifier
)

subscribeFor

Subscribe for the Context 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 the proper functioning of the site and, if you agree, for purposes we set, such as analytics or marketing.