client-cpp  0.10.0
kaa::EndpointRegistrationManager Class Reference

#include <EndpointRegistrationManager.hpp>

+ Inheritance diagram for kaa::EndpointRegistrationManager:
+ Collaboration diagram for kaa::EndpointRegistrationManager:

Public Member Functions

 EndpointRegistrationManager (IKaaClientContext &context)
 
virtual void attachEndpoint (const std::string &endpointAccessToken, IAttachEndpointCallbackPtr listener=IAttachEndpointCallbackPtr())
 Attaches the specified endpoint to the user to which the current endpoint is attached. More...
 
virtual void detachEndpoint (const std::string &endpointKeyHash, IDetachEndpointCallbackPtr listener=IDetachEndpointCallbackPtr())
 Detaches the specified endpoint from the user to which the current endpoint is attached. More...
 
virtual void attachUser (const std::string &userExternalId, const std::string &userAccessToken, IUserAttachCallbackPtr listener=IUserAttachCallbackPtr())
 Attaches the current endpoint to the specifier user. The user verification is carried out by the default verifier. More...
 
virtual void attachUser (const std::string &userExternalId, const std::string &userAccessToken, const std::string &userVerifierToken, IUserAttachCallbackPtr listener=IUserAttachCallbackPtr())
 Attaches the endpoint to a user entity. The user verification will be carried out by the specified verifier. More...
 
virtual bool isAttachedToUser ()
 Checks if the current endpoint is already attached to some user. More...
 
virtual void setAttachStatusListener (IAttachStatusListenerPtr listener)
 Sets listener to notify of the current endpoint is attached/detached by another one. More...
 
virtual UserAttachRequestPtr getUserAttachRequest ()
 
virtual std::unordered_map
< std::int32_t, std::string > 
getEndpointsToAttach ()
 
virtual std::unordered_map
< std::int32_t, std::string > 
getEndpointsToDetach ()
 
virtual void onUserAttach (const UserAttachResponse &response)
 
virtual void onEndpointsAttach (const std::vector< EndpointAttachResponse > &endpoints)
 
virtual void onEndpointsDetach (const std::vector< EndpointDetachResponse > &endpoints)
 
virtual void onCurrentEndpointAttach (const UserAttachNotification &response)
 
virtual void onCurrentEndpointDetach (const UserDetachNotification &response)
 
void setTransport (UserTransport *transport)
 
- Public Member Functions inherited from kaa::IEndpointRegistrationManager
virtual ~IEndpointRegistrationManager ()
 
- Public Member Functions inherited from kaa::IRegistrationProcessor
virtual ~IRegistrationProcessor ()
 

Detailed Description

Definition at line 44 of file EndpointRegistrationManager.hpp.

Constructor & Destructor Documentation

kaa::EndpointRegistrationManager::EndpointRegistrationManager ( IKaaClientContext context)

Member Function Documentation

virtual void kaa::EndpointRegistrationManager::attachEndpoint ( const std::string &  endpointAccessToken,
IAttachEndpointCallbackPtr  listener = IAttachEndpointCallbackPtr() 
)
virtual

Attaches the specified endpoint to the user to which the current endpoint is attached.

Parameters
[in]endpointAccessTokenThe access token of the endpoint to be attached to the user.
[in]listenerThe optional listener to notify of the result.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implements kaa::IEndpointRegistrationManager.

virtual void kaa::EndpointRegistrationManager::attachUser ( const std::string &  userExternalId,
const std::string &  userAccessToken,
IUserAttachCallbackPtr  listener = IUserAttachCallbackPtr() 
)
virtual

Attaches the current endpoint to the specifier user. The user verification is carried out by the default verifier.

NOTE: If the default user verifier (DEFAULT_USER_VERIFIER_TOKEN) is not specified, the attach attempt fails with the KaaException exception.

Only endpoints associated with the same user can exchange events.

Parameters
[in]userExternalIdThe external user ID.
[in]userAccessTokenThe user access token.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implements kaa::IEndpointRegistrationManager.

virtual void kaa::EndpointRegistrationManager::attachUser ( const std::string &  userExternalId,
const std::string &  userAccessToken,
const std::string &  userVerifierToken,
IUserAttachCallbackPtr  listener = IUserAttachCallbackPtr() 
)
virtual

Attaches the endpoint to a user entity. The user verification will be carried out by the specified verifier.

Only endpoints associated with the same user can exchange events.

Parameters
[in]userExternalIdThe external user ID.
[in]userAccessTokenThe user access token.
[in]userVerifierTokenThe user verifier token.
[in]listenerThe optional listener to notify of the result.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implements kaa::IEndpointRegistrationManager.

virtual void kaa::EndpointRegistrationManager::detachEndpoint ( const std::string &  endpointKeyHash,
IDetachEndpointCallbackPtr  listener = IDetachEndpointCallbackPtr() 
)
virtual

Detaches the specified endpoint from the user to which the current endpoint is attached.

Parameters
[in]endpointKeyHashThe key hash of the endpoint to be detached from the user.
[in]listenerThe optional listener to notify of the result.
Exceptions
BadCredentialsThe endpoint access token is empty.
TransportNotFoundExceptionThe Kaa SDK isn't fully initialized.
KaaExceptionSome other failure has happened.

Implements kaa::IEndpointRegistrationManager.

virtual std::unordered_map<std::int32_t, std::string> kaa::EndpointRegistrationManager::getEndpointsToAttach ( )
virtual
virtual std::unordered_map<std::int32_t, std::string> kaa::EndpointRegistrationManager::getEndpointsToDetach ( )
virtual
virtual UserAttachRequestPtr kaa::EndpointRegistrationManager::getUserAttachRequest ( )
virtual
virtual bool kaa::EndpointRegistrationManager::isAttachedToUser ( )
inlinevirtual

Checks if the current endpoint is already attached to some user.

Returns
TRUE if the current endpoint is attached, FALSE otherwise.

Implements kaa::IEndpointRegistrationManager.

Definition at line 65 of file EndpointRegistrationManager.hpp.

virtual void kaa::EndpointRegistrationManager::onCurrentEndpointAttach ( const UserAttachNotification &  response)
virtual
virtual void kaa::EndpointRegistrationManager::onCurrentEndpointDetach ( const UserDetachNotification &  response)
virtual
virtual void kaa::EndpointRegistrationManager::onEndpointsAttach ( const std::vector< EndpointAttachResponse > &  endpoints)
virtual
virtual void kaa::EndpointRegistrationManager::onEndpointsDetach ( const std::vector< EndpointDetachResponse > &  endpoints)
virtual
virtual void kaa::EndpointRegistrationManager::onUserAttach ( const UserAttachResponse &  response)
virtual
virtual void kaa::EndpointRegistrationManager::setAttachStatusListener ( IAttachStatusListenerPtr  listener)
inlinevirtual

Sets listener to notify of the current endpoint is attached/detached by another one.

Parameters
[in]listenerListener to notify of the attach status is changed.

Implements kaa::IEndpointRegistrationManager.

Definition at line 67 of file EndpointRegistrationManager.hpp.

void kaa::EndpointRegistrationManager::setTransport ( UserTransport transport)
inline

Definition at line 82 of file EndpointRegistrationManager.hpp.


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