protected Snapshot(Source source, V data) { this.notification = new SourcedChangeNotification<>(ChangeNotification.Kind.Add, data, source); }
private static ChangeNotification<InstanceInfo> processNext(ChangeNotification<InstanceInfo> current, ChangeNotification<InstanceInfo> update) { switch (update.getKind()) { case Add: // Add flushes previous state return update; case Modify: // Re-write as add if (current == null) { logger.info("Invalid change notification sequence - " + "'Modify' ChangeNotification without proceeding 'Add' notification;" + "for client view consistency converted to 'Add': {}", update ); } if (update instanceof Sourced) { return new SourcedChangeNotification<>(Kind.Add, update.getData(), ((Sourced) update).getSource()); } else { return new ChangeNotification<>(Kind.Add, update.getData()); } } return null; } }
snapshot = null; ChangeNotification<InstanceInfo> deleteNotification = new SourcedChangeNotification<>(ChangeNotification.Kind.Delete, removed, source); pauseableSubject.onNext(deleteNotification); (snapshot.getSource().getOrigin() != Source.Origin.LOCAL)) { ChangeNotification<InstanceInfo> deleteNotification = new SourcedChangeNotification<>(ChangeNotification.Kind.Delete, removed, source); pauseableSubject.onNext(deleteNotification); = new SourcedChangeNotification<>(ChangeNotification.Kind.Add, snapshot.getData(), snapshot.getSource()); pauseableSubject.onNext(addNotification); } else {