private void processUserAttachRequest(ActorContext context, ClientSync syncRequest, SyncContext responseHolder) { UserClientSync request = syncRequest.getUserSync(); if (request != null && request.getUserAttachRequest() != null) { UserAttachRequest attachRequest = request.getUserAttachRequest(); context.parent().tell(new UserVerificationRequestMessage( context.self(), attachRequest.getUserVerifierId(), attachRequest.getUserExternalId(), attachRequest.getUserAccessToken()), context.self()); LOG.debug("[{}][{}] received and forwarded user attach request {}", endpointKey, actorKey, request.getUserAttachRequest()); if (userAttachResponseMap.size() > 0) { Entry<UUID, UserVerificationResponseMessage> entryToSend = userAttachResponseMap.entrySet() .iterator() .next(); updateResponseWithUserAttachResults(responseHolder.getResponse(), entryToSend.getValue()); userAttachResponseMap.remove(entryToSend.getKey()); } } }
/** * Returns whether a transport a type is valid. * @param type transport type * @return true if type is valid otherwise false */ public boolean isValid(TransportType type) { switch (type) { case EVENT: return request.getEventSync() != null; case NOTIFICATION: return request.getNotificationSync() != null; case CONFIGURATION: return request.getConfigurationSync() != null; case USER: return request.getUserSync() != null; case PROFILE: return request.getProfileSync() != null; case LOGGING: return request.getLogSync() != null; default: return false; } }
/** * Updates a request. */ public void updateRequest(ServerSync response) { UUID channelUuid = getChannelUuid(); LOG.debug("[{}] Cleanup profile request", channelUuid); request.setProfileSync(null); if (request.getUserSync() != null) { LOG.debug("[{}] Cleanup user request", channelUuid); request.setUserSync(new UserClientSync()); } if (request.getEventSync() != null) { LOG.debug("[{}] Cleanup event request", channelUuid); request.setEventSync(new EventClientSync()); } if (request.getLogSync() != null) { LOG.debug("[{}] Cleanup log request", channelUuid); request.getLogSync().setLogEntries(null); } if (request.getNotificationSync() != null) { LOG.debug("[{}] Cleanup/update notification request", channelUuid); request.getNotificationSync().setSubscriptionCommands(null); request.getNotificationSync().setAcceptedUnicastNotifications(null); } }
List<EndpointDetachRequest> detachRequests = request.getUserSync() == null ? null : request.getUserSync().getEndpointDetachRequests(); if (detachRequests != null && !detachRequests.isEmpty()) { state.resetEventSeqNumber();
if (other.getUserSync() != null) { diff.setUserSync(other.getUserSync()); request.setUserSync(other.getUserSync()); LOG.debug("[{}] Updated user request", channelUuid);
context, request.getUserSync()); context = operationsService.processEventListenerRequests(context, request.getEventSync());