@Override public ClientSync decode(byte[] data) throws PlatformEncDecException { ClientSync sync = super.decode(data); sync.setUseConfigurationRawSchema(true); return sync; } }
@Override public ClientSync decode(byte[] data) throws PlatformEncDecException { ClientSync sync = super.decode(data); sync.setUseConfigurationRawSchema(true); return sync; } }
@Override public ClientSync decode(byte[] data) throws PlatformEncDecException { try { if (LOG.isTraceEnabled()) { LOG.trace("Decoding avro data {}", Arrays.toString(data)); } SyncRequest source = clientSyncConverter.fromByteArray(data); LOG.trace("Decoding client sync {}", source); if (source == null) { return null; } ClientSync sync = convert(source); sync.setUseConfigurationRawSchema(false); LOG.trace("Decoded client sync {}", sync); return sync; } catch (IOException exception) { throw new PlatformEncDecException(exception); } }
@Override public ClientSync decode(byte[] data) throws PlatformEncDecException { if (LOG.isTraceEnabled()) { LOG.trace("Decoding binary data {}", Arrays.toString(data)); } ByteBuffer buf = ByteBuffer.wrap(data); if (buf.remaining() < MIN_SIZE_OF_MESSAGE_HEADER) { throw new PlatformEncDecException( MessageFormat.format("Message header is to small {0} to be kaa binary message!", buf.capacity())); } int protocolId = buf.getInt(); if (protocolId != getId()) { throw new PlatformEncDecException( MessageFormat.format("Unknown protocol id {0}!", protocolId)); } int protocolVersion = getIntFromUnsignedShort(buf); if (protocolVersion < MIN_SUPPORTED_VERSION || protocolVersion > MAX_SUPPORTED_VERSION) { throw new PlatformEncDecException( MessageFormat.format("Can't decode data using protocol version {0}!", protocolVersion)); } int extensionsCount = getIntFromUnsignedShort(buf); LOG.trace("received data for protocol id {} and version {} that contain {} extensions", protocolId, protocolVersion, extensionsCount); ClientSync sync = parseExtensions(buf, protocolVersion, extensionsCount); sync.setUseConfigurationRawSchema(false); LOG.trace("Decoded binary data {}", sync); return sync; }
diff.setRequestId(other.getRequestId()); diff.setClientSyncMetaData(other.getClientSyncMetaData()); diff.setUseConfigurationRawSchema(other.isUseConfigurationRawSchema()); if (request.getClientSyncMetaData().getApplicationToken() != null) { LOG.debug("Setting application token, as it was null: {}",
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())); } }