private void processEvents(ActorContext context, ClientSync request, SyncContext responseHolder) { if (request.getEventSync() != null) { EventClientSync eventRequest = request.getEventSync(); processSeqNumber(eventRequest, responseHolder); if (state.isValidForEvents()) { sendEventsIfPresent(context, eventRequest); } else { LOG.debug( "[{}][{}] Endpoint profile is not valid for send/receive events. " + "Either no assigned user or no event families in sdk", endpointKey, actorKey); } } }
/** * 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); } }
LOG.debug("[{}] Updated user request", channelUuid); if (other.getEventSync() != null) { diff.setEventSync(other.getEventSync()); request.setEventSync(other.getEventSync()); LOG.debug("[{}] Updated event request", channelUuid);
context = operationsService.processEventListenerRequests(context, request.getEventSync());