ServerToClientDiffConverter(EntityResolver resolver) { this.resolver = resolver; this.clientDiff = new CompoundDiff(); }
public void nodeIdChanged(Object nodeId, Object newId) { clientDiff.add(new NodeIdChangeOperation(nodeId, newId)); }
/** * Converts diffs organized by ObjectId in a collection of diffs sorted by * diffId (same as creation order). */ private void resolveDiff() { // refresh the diff on first access or if the underlying ObjectStore has // changed the the last time we cached the changes. if (resolvedDiff == null || lastSeenDiffId < objectStore.currentDiffId) { CompoundDiff diff = new CompoundDiff(); Map<Object, ObjectDiff> changes = getChangesByObjectId(); if (!changes.isEmpty()) { List<NodeDiff> allChanges = new ArrayList<>(changes.size() * 2); for (final ObjectDiff objectDiff : changes.values()) { objectDiff.appendDiffs(allChanges); } Collections.sort(allChanges); diff.addAll(allChanges); } this.lastSeenDiffId = objectStore.currentDiffId; this.resolvedDiff = diff; } }
CompoundDiff diff = new CompoundDiff(); diff.addAll(objectStore.getLifecycleEventInducedChanges()); if (parentChanges != null) { diff.add(parentChanges); if (!diff.isNoop()) { fireDataChannelCommitted(getChannel(), diff);
CompoundDiff notification = new CompoundDiff(); notification.add(changes); notification.add(replyDiff);
public void add(GraphDiff diff) { nonNullDiffs().add(diff); }
CompoundDiff notification = new CompoundDiff(); notification.add(childDiff); notification.add(returnClientDiff);
public void addAll(Collection<? extends GraphDiff> diffs) { nonNullDiffs().addAll(diffs); }
GraphDiff filter(GraphDiff in) { diffs = new ArrayList<>(); in.apply(this); return new CompoundDiff(diffs); }
/** * Converts diffs organized by ObjectId in a collection of diffs sorted by diffId * (same as creation order). */ private void resolveDiff() { if (resolvedDiff == null) { CompoundDiff diff = new CompoundDiff(); Map changes = getChangesByObjectId(); if (!changes.isEmpty()) { List allChanges = new ArrayList(changes.size() * 2); Iterator it = changes.values().iterator(); while (it.hasNext()) { ((ObjectDiff) it.next()).appendDiffs(allChanges); } Collections.sort(allChanges); diff.addAll(allChanges); } this.resolvedDiff = diff; } }
public void add(GraphDiff diff) { nonNullDiffs().add(diff); }
result.add(new NodeIdChangeOperation(id, replacementId));
/** * Returns a combined GraphDiff for all recorded operations. */ GraphDiff getDiffs() { return new CompoundDiff(immutableList(0, diffs.size())); }
public void addAll(Collection diffs) { nonNullDiffs().addAll(diffs); }
result.add(new NodeIdChangeOperation(id, replacementId));
/** * Processes internal objects after the parent DataContext was committed. Changes * object persistence state and handles snapshot updates. * * @since 1.1 * @deprecated since 1.2 unused. */ public synchronized void objectsCommitted() { postprocessAfterCommit(new CompoundDiff()); }
/** * Returns a combined GraphDiff for all recorded operations. */ GraphDiff getDiffs() { return new CompoundDiff(immutableList(0, diffs.size())); }
GraphDiff getDiffsAfterMarker(String markerTag) { Integer pos = markers.get(markerTag); int marker = (pos == null) ? -1 : pos.intValue(); if (marker < 0) { throw new IllegalStateException("No marked position for tag '" + markerTag + "'"); } return new CompoundDiff(immutableList(marker, diffs.size())); }
GraphDiff getDiffsAfterMarker(String markerTag) { Integer pos = (Integer) markers.get(markerTag); int marker = (pos == null) ? -1 : pos.intValue(); if (marker < 0) { throw new IllegalStateException("No marked position for tag '" + markerTag + "'"); } return new CompoundDiff(immutableList(marker, diffs.size())); }
GraphDiff onContextRollback(ObjectContext originatingContext) { rollbackChanges(); return new CompoundDiff(); }