public class DefaultEndpointRegistrationManager extends Object implements EndpointRegistrationManager, EndpointRegistrationProcessor
EndpointRegistrationManager
implementation.Constructor and Description |
---|
DefaultEndpointRegistrationManager(KaaClientState state,
ExecutorContext executorContext,
UserTransport userTransport,
ProfileTransport profileTransport) |
Modifier and Type | Method and Description |
---|---|
void |
attachEndpoint(EndpointAccessToken endpointAccessToken,
OnAttachEndpointOperationCallback resultListener)
Updates with new endpoint attach request
OnAttachEndpointOperationCallback is populated with EndpointKeyHash of an
attached endpoint. |
void |
attachUser(String userVerifierToken,
String userExternalId,
String userAccessToken,
UserAttachCallback callback)
Creates user attach request using specified verifier.
|
void |
attachUser(String userExternalId,
String userAccessToken,
UserAttachCallback callback)
Creates user attach request using default verifier.
|
void |
detachEndpoint(EndpointKeyHash endpointKeyHash,
OnDetachEndpointOperationCallback resultListener)
Updates with new endpoint detach request
|
Map<EndpointAccessToken,EndpointKeyHash> |
getAttachedEndpointList() |
Map<Integer,EndpointAccessToken> |
getAttachEndpointRequests()
Retrieves current attach requests.
|
Map<Integer,EndpointKeyHash> |
getDetachEndpointRequests()
Retrieves current detach requests.
|
org.kaaproject.kaa.common.endpoint.gen.UserAttachRequest |
getUserAttachRequest()
Retrieves the user attach request.
|
boolean |
isAttachedToUser()
Checks if current endpoint is attached to user.
|
void |
onUpdate(List<org.kaaproject.kaa.common.endpoint.gen.EndpointAttachResponse> attachResponses,
List<org.kaaproject.kaa.common.endpoint.gen.EndpointDetachResponse> detachResponses,
org.kaaproject.kaa.common.endpoint.gen.UserAttachResponse userResponse,
org.kaaproject.kaa.common.endpoint.gen.UserAttachNotification userAttachNotification,
org.kaaproject.kaa.common.endpoint.gen.UserDetachNotification userDetachNotification)
Updates the manager's state.
|
String |
refreshEndpointAccessToken() |
void |
setAttachedCallback(AttachEndpointToUserCallback listener)
Sets callback for notifications when current endpoint is attached to user
|
void |
setDetachedCallback(DetachEndpointFromUserCallback listener)
Sets callback for notifications when current endpoint is detached from user
|
void |
updateEndpointAccessToken(String token) |
public DefaultEndpointRegistrationManager(KaaClientState state, ExecutorContext executorContext, UserTransport userTransport, ProfileTransport profileTransport)
public void updateEndpointAccessToken(String token)
public String refreshEndpointAccessToken()
public void attachEndpoint(EndpointAccessToken endpointAccessToken, OnAttachEndpointOperationCallback resultListener)
EndpointRegistrationManager
OnAttachEndpointOperationCallback
is populated with EndpointKeyHash
of an
attached endpoint.attachEndpoint
in interface EndpointRegistrationManager
endpointAccessToken
- Access token of the attaching endpointresultListener
- Listener to notify about result of the endpoint attachingEndpointAccessToken
,
OnAttachEndpointOperationCallback
public void detachEndpoint(EndpointKeyHash endpointKeyHash, OnDetachEndpointOperationCallback resultListener)
EndpointRegistrationManager
detachEndpoint
in interface EndpointRegistrationManager
endpointKeyHash
- Key hash of the detaching endpointresultListener
- Listener to notify about result of the enpoint attachingEndpointKeyHash
,
OnDetachEndpointOperationCallback
public void attachUser(String userExternalId, String userAccessToken, UserAttachCallback callback)
EndpointRegistrationManager
attachUser
in interface EndpointRegistrationManager
userExternalId
- the user external iduserAccessToken
- the user access tokencallback
- called when authentication result receivedUserAttachCallback
public void attachUser(String userVerifierToken, String userExternalId, String userAccessToken, UserAttachCallback callback)
EndpointRegistrationManager
attachUser
in interface EndpointRegistrationManager
userVerifierToken
- the user verifier tokenuserExternalId
- the user external iduserAccessToken
- the user access tokencallback
- called when authentication result receivedUserAttachCallback
public Map<EndpointAccessToken,EndpointKeyHash> getAttachedEndpointList()
public void onUpdate(List<org.kaaproject.kaa.common.endpoint.gen.EndpointAttachResponse> attachResponses, List<org.kaaproject.kaa.common.endpoint.gen.EndpointDetachResponse> detachResponses, org.kaaproject.kaa.common.endpoint.gen.UserAttachResponse userResponse, org.kaaproject.kaa.common.endpoint.gen.UserAttachNotification userAttachNotification, org.kaaproject.kaa.common.endpoint.gen.UserDetachNotification userDetachNotification) throws IOException
EndpointRegistrationProcessor
onUpdate
in interface EndpointRegistrationProcessor
attachResponses
- the list of attach responses.detachResponses
- the list of detach responses.userResponse
- the user attach response.userAttachNotification
- the user attach notificationuserDetachNotification
- the user detach notificationIOException
- the io exceptionEndpointAttachResponse
,
EndpointDetachResponse
,
UserAttachResponse
public Map<Integer,EndpointAccessToken> getAttachEndpointRequests()
EndpointRegistrationProcessor
getAttachEndpointRequests
in interface EndpointRegistrationProcessor
EndpointAccessToken
public Map<Integer,EndpointKeyHash> getDetachEndpointRequests()
EndpointRegistrationProcessor
getDetachEndpointRequests
in interface EndpointRegistrationProcessor
EndpointKeyHash
public org.kaaproject.kaa.common.endpoint.gen.UserAttachRequest getUserAttachRequest()
EndpointRegistrationProcessor
getUserAttachRequest
in interface EndpointRegistrationProcessor
UserAttachRequest
public boolean isAttachedToUser()
EndpointRegistrationManager
isAttachedToUser
in interface EndpointRegistrationManager
public void setAttachedCallback(AttachEndpointToUserCallback listener)
EndpointRegistrationManager
setAttachedCallback
in interface EndpointRegistrationManager
listener
- the callbackAttachEndpointToUserCallback
public void setDetachedCallback(DetachEndpointFromUserCallback listener)
EndpointRegistrationManager
setDetachedCallback
in interface EndpointRegistrationManager
listener
- the callbackDetachEndpointFromUserCallback
Copyright © 2016. All rights reserved.