Package org.kaaproject.kaa.client.event.registration

Provides implementation of endpoint/user registration.

See: Description

Package org.kaaproject.kaa.client.event.registration Description

Provides implementation of endpoint/user registration.

In order to have ability to send and (or) receive events an application must be attached to the user entity in Kaa ecosystem. User registration module gives API to manage endpoint-to-user attachments.

In scope of this java endpoint sdk provides next functionality:

  • Attach current endpoint to user entity;
  • Attach other endpoint to user entity;
  • Detach endpoint from user entity.

  • If endpoint is assumed to be attached or detached by another application it is possible to set up callback for notifications when this endpoint becomes attached or detached.

    All operations being described on this page are run in asynchronous mode. Thus, in order to retrieve result for each operation an appropriate callback should be registered.

    Usage

    Attaching current endpoint to user:

      EndpointRegistrationManager registrationManager = kaaClient.getEndpointRegistrationManager();
          registrationManager.attachUser("userExternalId", "userAccessToken", new UserAuthResultListener() { ... });
      
      
    To check if this endpoint is attached to user call EndpointRegistrationManager.isAttachedToUser().

    Attaching any endpoint to user by its access token:
      EndpointRegistrationManager registrationManager = kaaClient.getEndpointRegistrationManager();
     registrationManager.attachEndpoint(new EndpointAccessToken("accessToken"), new EndpointOperationResultListener() {...});
     
     
    Detaching endpoint from user by its EndpointKeyHash:
     EndpointRegistrationManager registrationManager = kaaClient.getEndpointRegistrationManager();
     registrationManager.detachEndpoint((new EndpointKeyHash("keyHash"), new EndpointOperationResultListener() {...});
     
     
    EndpointKeyHash for endpoint can be received with AttachEndpoint operation provided from Operations server. See org.kaaproject.kaa.client.event.registration.EndpointOperationCallback.

    If current endpoint is assumed to be attached or detached by another endpoint, specific AttachEndpointToUserCallback and DetachEndpointFromUserCallback may be specified to receive notification about such event.

    Copyright © 2015. All rights reserved.