private void parseNotificationClientSync(ClientSync sync, ByteBuffer buf, int options, int payloadLength) { int payloadLimitPosition = buf.position() + payloadLength; NotificationClientSync nfSync = new NotificationClientSync(); nfSync.setTopicListHash(buf.getInt()); while (buf.position() < payloadLimitPosition) { byte fieldId = buf.get(); // reading unused reserved field buf.get(); switch (fieldId) { case NF_TOPIC_STATES_FIELD_ID: nfSync.setTopicStates(parseTopicStates(buf)); break; case NF_UNICAST_LIST_FIELD_ID: nfSync.setAcceptedUnicastNotifications(parseUnicastIds(buf)); break; case NF_SUBSCRIPTION_ADD_FIELD_ID: parseSubscriptionCommands(nfSync, buf, true); break; case NF_SUBSCRIPTION_REMOVE_FIELD_ID: parseSubscriptionCommands(nfSync, buf, false); break; default: break; } } sync.setNotificationSync(nfSync); }
/** * 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); } }
sync.setTopicListHash(source.getTopicListHash()); if (source.getAcceptedUnicastNotifications() != null) { sync.setAcceptedUnicastNotifications(new ArrayList<>( source.getAcceptedUnicastNotifications()));