private static NotificationServerSync deepCopy(NotificationServerSync source) { if (source == null) { return null; } NotificationServerSync copy = new NotificationServerSync(); copy.setResponseStatus(source.getResponseStatus()); if (source.getNotifications() != null) { copy.setNotifications(new ArrayList<>(source.getNotifications())); } if (source.getAvailableTopics() != null) { copy.setAvailableTopics(new ArrayList<>(source.getAvailableTopics())); } return copy; }
private static NotificationSyncResponse convert(NotificationServerSync source) { if (source == null) { return null; } NotificationSyncResponse sync = new NotificationSyncResponse(); sync.setResponseStatus(convert(source.getResponseStatus())); if (source.getAvailableTopics() != null) { List<Topic> topics = new ArrayList<>(source.getAvailableTopics().size()); for (org.kaaproject.kaa.server.sync.Topic topic : source.getAvailableTopics()) { topics.add(new Topic( topic.getIdAsLong(), topic.getName(), convert(topic.getSubscriptionType()))); } sync.setAvailableTopics(topics); } if (source.getNotifications() != null) { List<Notification> notifications = new ArrayList<>(source.getNotifications().size()); for (org.kaaproject.kaa.server.sync.Notification notification : source.getNotifications()) { notifications.add(new Notification( notification.getTopicIdAsLong(), convert(notification.getType()), notification.getUid(), notification.getSeqNumber(), notification.getBody())); } sync.setNotifications(notifications); } return sync; }
&& response.getNotificationSync().getResponseStatus() != SyncResponseStatus.NO_DELTA) { return true;
final int extPosition = buf.position(); SyncResponseStatus status = notificationSync.getResponseStatus(); switch (status) { case NO_DELTA: