private ClientSync parseExtensions(ByteBuffer buf, int protocolVersion, int extensionsCount) throws PlatformEncDecException { ClientSync sync = new ClientSync(); for (short extPos = 0; extPos < extensionsCount; extPos++) { if (buf.remaining() < MIN_SIZE_OF_EXTENSION_HEADER) {
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())); } }
.setProfileHash(other.getClientSyncMetaData().getProfileHash()); LOG.debug("[{}] Updated request id and profile hash", channelUuid); ClientSync diff = new ClientSync(); diff.setRequestId(other.getRequestId()); diff.setClientSyncMetaData(other.getClientSyncMetaData());
/** * Converts Avro {@link SyncRequest} to {@link ClientSync}. * * @param source the avro structure * @return the client sync */ public static ClientSync convert(SyncRequest source) { ClientSync dest = new ClientSync(); dest.setRequestId(source.getRequestId()); dest.setClientSyncMetaData(convert(source.getSyncRequestMetaData())); dest.setBootstrapSync(convert(source.getBootstrapSyncRequest())); dest.setProfileSync(convert(source.getProfileSyncRequest())); dest.setConfigurationSync(convert(source.getConfigurationSyncRequest())); dest.setNotificationSync(convert(source.getNotificationSyncRequest())); dest.setEventSync(convert(source.getEventSyncRequest())); dest.setUserSync(convert(source.getUserSyncRequest())); dest.setLogSync(convert(source.getLogSyncRequest())); return dest; }