public interface EndpointRegistrationManager
attachUser(String, String, UserAuthResultListener)
EndpointRegistrationManager registrationManager = kaaClient.getEndpointRegistrationManager();
registrationManager.attachUser("userExternalId", "userAccessToken", new UserAuthResultListener() { ... });
To check if this endpoint is attached to user call isAttachedToUser()
.
Only attached endpoints can send/receive events.
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 EndpointOperationResultListener
. CurrentEndpointAttachListener
and CurrentEndpointDetachListener
may be specified to receive notification about such event.UserTransport
to communicate with Operations
server in scope of basic functionality and ProfileTransport
when its
access token is changed.Modifier and Type | Method and Description |
---|---|
void |
addAttachedEndpointListChangeListener(AttachedEndpointListChangedListener listener)
Updates with listener for attached endpoint list updates
|
void |
attachEndpoint(EndpointAccessToken endpointAccessToken,
EndpointOperationResultListener resultListener)
Updates with new endpoint attach request
EndpointOperationResultListener is populated with EndpointKeyHash of an
attached endpoint. |
void |
attachUser(String userExternalId,
String userAccessToken,
UserAuthResultListener callback)
Creates user attach request
|
void |
detachEndpoint(EndpointKeyHash endpointKeyHash,
EndpointOperationResultListener resultListener)
Updates with new endpoint detach request
|
Map<EndpointAccessToken,EndpointKeyHash> |
getAttachedEndpointList()
Retrieves list of attached endpoints
|
String |
getEndpointAccessToken()
Retrieve an access token for a current endpoint
|
boolean |
isAttachedToUser()
Checks if current endpoint is attached to user.
|
void |
regenerateEndpointAccessToken()
Generate new access token for a current endpoint
|
void |
removeAttachedEndpointListChangeListener(AttachedEndpointListChangedListener listener)
Removes listener of attached endpoint list changes
|
void |
setAttachedListener(CurrentEndpointAttachListener listener)
Sets callback for notifications when current endpoint is attached to user
|
void |
setDetachedListener(CurrentEndpointDetachListener listener)
Sets callback for notifications when current endpoint is detached from user
|
void |
setProfileTransport(ProfileTransport transport)
Sets the Profile transport for the current manager to communicate with remote server.
|
void |
setUserTransport(UserTransport transport)
Sets the User transport for the current manager to communicate with remote server.
|
void regenerateEndpointAccessToken()
String getEndpointAccessToken()
void attachEndpoint(EndpointAccessToken endpointAccessToken, EndpointOperationResultListener resultListener)
EndpointOperationResultListener
is populated with EndpointKeyHash
of an
attached endpoint.endpointAccessToken
- Access token of the attaching endpointresultListener
- Listener to notify about result of the endpoint attachingEndpointAccessToken
,
EndpointOperationResultListener
void detachEndpoint(EndpointKeyHash endpointKeyHash, EndpointOperationResultListener resultListener)
endpointKeyHash
- Key hash of the detaching endpointresultListener
- Listener to notify about result of the enpoint attachingEndpointKeyHash
,
EndpointOperationResultListener
void attachUser(String userExternalId, String userAccessToken, UserAuthResultListener callback)
userExternalId
- userAccessToken
- callback
- called when authentication result receivedUserAuthResultListener
Map<EndpointAccessToken,EndpointKeyHash> getAttachedEndpointList()
EndpointAccessToken
,
EndpointKeyHash
void addAttachedEndpointListChangeListener(AttachedEndpointListChangedListener listener)
listener
- Attached endpoints list change listenerAttachedEndpointListChangedListener
void removeAttachedEndpointListChangeListener(AttachedEndpointListChangedListener listener)
listener
- Attached endpoints list change listenerAttachedEndpointListChangedListener
void setUserTransport(UserTransport transport)
transport
- the User transport object which is going to be set.UserTransport
void setProfileTransport(ProfileTransport transport)
transport
- the Profile transport object which is going to be set.ProfileTransport
boolean isAttachedToUser()
void setAttachedListener(CurrentEndpointAttachListener listener)
listener
- CurrentEndpointAttachListener
void setDetachedListener(CurrentEndpointDetachListener listener)
listener
- CurrentEndpointDetachListener
Copyright © 2014. All rights reserved.