@Override protected Validator getRootValidator(NodeState before, NodeState after, CommitInfo info) { if (!enabled) { return null; } if (info == null || !info.getInfo().containsKey(CommitContext.NAME)) { // then we cannot do change-collecting, as we can't store // it in the info return null; } return ChangeCollector.newRootCollector(info, maxItems, maxPathDepth); }
EventFactory(NamePathMapper mapper, CommitInfo commitInfo) { this.mapper = mapper; if (!commitInfo.isExternal()) { this.userID = commitInfo.getUserId(); Object userData = commitInfo.getInfo().get(USER_DATA); this.userData = userData instanceof String ? (String) userData : null; this.date = commitInfo.getDate(); this.external = false; } else { this.userID = commitInfo.getUserId(); this.userData = null; this.date = commitInfo.getDate(); // rough estimate this.external = true; } }
private static CommitInfo createCommitInfo() { Map<String, Object> info = ImmutableMap.<String, Object>of(CommitContext.NAME, new SimpleCommitContext()); return new CommitInfo(CommitInfo.OAK_UNKNOWN, CommitInfo.OAK_UNKNOWN, info); } }
@Override public boolean excludes(@NotNull NodeState root, @NotNull CommitInfo info) { //Only interested in external changes if (!info.isExternal()) { return true; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); //Commit done internally i.e. one not using Root/Tree API if (commitContext == null) { return true; } IndexedPaths indexedPaths = (IndexedPaths) commitContext.get(LuceneDocumentHolder.NAME); //Nothing to be indexed if (indexedPaths == null) { log.debug("IndexPaths not found. Journal support missing"); return true; } if (indexedPaths.isEmpty()){ return true; } return false; }
private boolean isExternal(CommitInfo info) { return info.isExternal(); }
private boolean isLocal(String sessionId, CommitInfo info) { return info != null && Objects.equal(info.getSessionId(), sessionId); }
@Override @CheckForNull protected Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { String path = info.getPath(); if (PathUtils.denotesRoot(path)) { return null; // no need to check saves of the whole transient space } else { return new ItemSaveValidator(path); } }
@Override public boolean excludes(@NotNull NodeState root, @NotNull CommitInfo info) { //Only interested in external changes if (!info.isExternal()) { return true; } CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME); //Commit done internally i.e. one not using Root/Tree API if (commitContext == null) { return true; } IndexedPaths indexedPaths = (IndexedPaths) commitContext.get(LuceneDocumentHolder.NAME); //Nothing to be indexed if (indexedPaths == null) { log.debug("IndexPaths not found. Journal support missing"); return true; } if (indexedPaths.isEmpty()){ return true; } return false; }
private boolean isExternal(CommitInfo info) { return info.isExternal(); }
private boolean isLocal(String sessionId, CommitInfo info) { return info != null && Objects.equal(info.getSessionId(), sessionId); }
@Override @Nullable protected Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { String path = info.getPath(); if (PathUtils.denotesRoot(path)) { return null; // no need to check saves of the whole transient space } else { return new ItemSaveValidator(path); } }
@Override protected Validator getRootValidator(NodeState before, NodeState after, CommitInfo info) { if (!enabled) { return null; } if (info == null || !info.getInfo().containsKey(CommitContext.NAME)) { // then we cannot do change-collecting, as we can't store // it in the info return null; } return ChangeCollector.newRootCollector(info, maxItems, maxPathDepth); }
EventFactory(@NotNull NamePathMapper mapper, @NotNull BlobAccessProvider blobAccessProvider, @NotNull CommitInfo commitInfo) { this.mapper = mapper; this.valueFactory = new PartialValueFactory(mapper, blobAccessProvider); if (!commitInfo.isExternal()) { this.userID = commitInfo.getUserId(); Object userData = commitInfo.getInfo().get(USER_DATA); this.userData = userData instanceof String ? (String) userData : null; this.date = commitInfo.getDate(); this.external = false; } else { this.userID = commitInfo.getUserId(); this.userData = null; this.date = commitInfo.getDate(); // rough estimate this.external = true; } }
private static CommitInfo createCommitInfo() { Map<String, Object> info = ImmutableMap.<String, Object>of(CommitContext.NAME, new SimpleCommitContext()); return new CommitInfo(CommitInfo.OAK_UNKNOWN, CommitInfo.OAK_UNKNOWN, info); } }
@Override public void contentChanged(@NotNull NodeState root, @NotNull CommitInfo info) { if (info.isExternal()){ return; CommitContext commitContext = (CommitContext) info.getInfo().get(CommitContext.NAME);
private boolean isExternal(CommitInfo info) { return info.isExternal(); }
private boolean isLocal(String sessionId, CommitInfo info) { return info != null && Objects.equal(info.getSessionId(), sessionId); }
@Override @Nullable protected Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { String path = info.getPath(); if (PathUtils.denotesRoot(path)) { return null; // no need to check saves of the whole transient space } else { return new ItemSaveValidator(path); } }
@Override protected Validator getRootValidator(NodeState before, NodeState after, CommitInfo info) { if (!enabled) { return null; } if (info == null || !info.getInfo().containsKey(CommitContext.NAME)) { // then we cannot do change-collecting, as we can't store // it in the info return null; } return ChangeCollector.newRootCollector(info, maxItems, maxPathDepth); }
EventFactory(@NotNull NamePathMapper mapper, @NotNull BlobAccessProvider blobAccessProvider, @NotNull CommitInfo commitInfo) { this.mapper = mapper; this.valueFactory = new PartialValueFactory(mapper, blobAccessProvider); if (!commitInfo.isExternal()) { this.userID = commitInfo.getUserId(); Object userData = commitInfo.getInfo().get(USER_DATA); this.userData = userData instanceof String ? (String) userData : null; this.date = commitInfo.getDate(); this.external = false; } else { this.userID = commitInfo.getUserId(); this.userData = null; this.date = commitInfo.getDate(); // rough estimate this.external = true; } }