PrivMX Endpoint v2.7.0
Loading...
Searching...
No Matches
privmx::endpoint::core::Connection Class Reference

#include <privmx/endpoint/core/Connection.hpp>

Inheritance diagram for privmx::endpoint::core::Connection:
Collaboration diagram for privmx::endpoint::core::Connection:

Public Member Functions

 Connection ()
 Connection (const Connection &obj)
Connectionoperator= (const Connection &obj)
 Connection (Connection &&obj)
int64_t getConnectionId ()
PagingList< ContextlistContexts (const PagingQuery &pagingQuery)
PagingList< UserInfolistContextUsers (const std::string &contextId, const PagingQuery &pagingQuery)
std::vector< std::string > subscribeFor (const std::vector< std::string > &subscriptionQueries)
void unsubscribeFrom (const std::vector< std::string > &subscriptionIds)
std::string buildSubscriptionQuery (EventType eventType, EventSelectorType selectorType, const std::string &selectorId)
void disconnect ()
void setUserVerifier (std::shared_ptr< UserVerifierInterface > verifier)
Public Member Functions inherited from privmx::endpoint::core::ExtendedPointer< ConnectionImpl >
ExtendedPointer & operator= (const ExtendedPointer &obj)
std::shared_ptr< ConnectionImpl > getImpl () const

Static Public Member Functions

static Connection connect (const std::string &userPrivKey, const std::string &solutionId, const std::string &bridgeUrl, const PKIVerificationOptions &verificationOptions=PKIVerificationOptions())
static Connection connectPublic (const std::string &solutionId, const std::string &bridgeUrl, const PKIVerificationOptions &verificationOptions=PKIVerificationOptions())

Additional Inherited Members

Protected Member Functions inherited from privmx::endpoint::core::ExtendedPointer< ConnectionImpl >
void attachToPtrIfPossible ()
void detachFromPtrIfPossible ()
Protected Attributes inherited from privmx::endpoint::core::ExtendedPointer< ConnectionImpl >
std::weak_ptr< ConnectionImpl > _ptr

Detailed Description

'Connection' represents and manages the current connection between the Endpoint and the Bridge server.

Constructor & Destructor Documentation

◆ Connection()

privmx::endpoint::core::Connection::Connection ( )

//doc-gen:ignore

Member Function Documentation

◆ buildSubscriptionQuery()

std::string privmx::endpoint::core::Connection::buildSubscriptionQuery ( EventType eventType,
EventSelectorType selectorType,
const std::string & selectorId )

Generate subscription Query for the Context events.

Parameters
eventTypetype of event which you listen for
selectorTypescope on which you listen for events
selectorIdID of the selector

◆ connect()

Connection privmx::endpoint::core::Connection::connect ( const std::string & userPrivKey,
const std::string & solutionId,
const std::string & bridgeUrl,
const PKIVerificationOptions & verificationOptions = PKIVerificationOptions() )
static

Connects to the PrivMX Bridge server.

Parameters
userPrivKeyuser's private key
solutionIdID of the Solution
bridgeUrlBridge Server URL
verificationOptionsPrivMX Bridge server instance verification options using a PKI server
Returns
Connection object

◆ connectPublic()

Connection privmx::endpoint::core::Connection::connectPublic ( const std::string & solutionId,
const std::string & bridgeUrl,
const PKIVerificationOptions & verificationOptions = PKIVerificationOptions() )
static

Connects to the PrivMX Bridge Server as a guest user.

Parameters
solutionIdID of the Solution
bridgeUrlBridge Server URL
verificationOptionsPrivMX Bridge server instance verification options using a PKI server
Returns
Connection object

◆ disconnect()

void privmx::endpoint::core::Connection::disconnect ( )

Disconnects from the PrivMX Bridge server.

◆ getConnectionId()

int64_t privmx::endpoint::core::Connection::getConnectionId ( )

Gets the ID of the current connection.

Returns
ID of the connection

◆ listContexts()

PagingList< Context > privmx::endpoint::core::Connection::listContexts ( const PagingQuery & pagingQuery)

Gets a list of Contexts available for the user.

Parameters
pagingQuerystruct with list query parameters
Returns
struct containing a list of Contexts

◆ listContextUsers()

PagingList< UserInfo > privmx::endpoint::core::Connection::listContextUsers ( const std::string & contextId,
const PagingQuery & pagingQuery )

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

Parameters
contextIdID of the Context
Returns
List of users with their status and the last status change

◆ setUserVerifier()

void privmx::endpoint::core::Connection::setUserVerifier ( std::shared_ptr< UserVerifierInterface > verifier)

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.

Parameters
verifieran implementation of the UserVerifierInterface

◆ subscribeFor()

std::vector< std::string > privmx::endpoint::core::Connection::subscribeFor ( const std::vector< std::string > & subscriptionQueries)

Subscribe for the Context events on the given subscription query.

Parameters
subscriptionQueriesList of queries
Returns
List of subscriptionIds in matching order to subscriptionQueries

◆ unsubscribeFrom()

void privmx::endpoint::core::Connection::unsubscribeFrom ( const std::vector< std::string > & subscriptionIds)

Unsubscribe from events for the given subscriptionId.

Parameters
subscriptionIdsList of subscriptionId

The documentation for this class was generated from the following file: