/** * 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); } }
/** * 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; } }
if (other.getNotificationSync() != null) { NotificationClientSync mergedNotificationClientSync = hasProfileSync || other.isForceNotificationSync() ? other.getNotificationSync() : diff(request.getNotificationSync(), other.getNotificationSync()); diff.setNotificationSync(mergedNotificationClientSync); request.setNotificationSync(other.getNotificationSync()); LOG.debug("[{}] Updated notification request", channelUuid); } else { if (hasProfileSync) { diff.setNotificationSync(request.getNotificationSync());
private void syncChannels(ActorContext context, Set<ChannelMetaData> channels, boolean cfUpdate, boolean nfUpdate) { for (ChannelMetaData channel : channels) { ClientSync originalRequest = channel.getRequestMessage().getRequest(); ClientSync newRequest = new ClientSync(); newRequest.setRequestId(originalRequest.getRequestId()); newRequest.setClientSyncMetaData(originalRequest.getClientSyncMetaData()); newRequest.setUseConfigurationRawSchema(originalRequest.isUseConfigurationRawSchema()); if (cfUpdate && originalRequest.getConfigurationSync() != null) { newRequest.setForceConfigurationSync(true); newRequest.setConfigurationSync(originalRequest.getConfigurationSync()); } if (nfUpdate && originalRequest.getNotificationSync() != null) { newRequest.setForceNotificationSync(true); newRequest.setNotificationSync(originalRequest.getNotificationSync()); } LOG.debug("[{}][{}] Processing request {}", endpointKey, actorKey, newRequest); sync(context, new SyncRequestMessage(channel.getRequestMessage().getSession(), newRequest, channel.getRequestMessage().getCommand(), channel.getRequestMessage().getOriginator())); } }
context = operationsService.syncNotification(context, request.getNotificationSync());