private final JcrSession session() { return workspace.getSession(); }
private final JcrSession session() { return workspace.getSession(); }
protected void reindexSince( JcrWorkspace workspace, long timestamp ) { ChangeJournal journal = runningState.journal(); assert journal != null; Iterator<NodeKey> changedNodes = journal.changedNodesSince(timestamp); if (!changedNodes.hasNext()) { // there are no nodes which have been changed since the given timestamp return; } reindexSince(workspace.getSession().cache().getWorkspace(), getIndexWriter(), changedNodes); }
protected void reindexSince( JcrWorkspace workspace, long timestamp ) { ChangeJournal journal = runningState.journal(); assert journal != null; Iterator<NodeKey> changedNodes = journal.changedNodesSince(timestamp); if (!changedNodes.hasNext()) { // there are no nodes which have been changed since the given timestamp return; } reindexSince(workspace.getSession().cache().getWorkspace(), getIndexWriter(), changedNodes); }
protected Future<Boolean> reindexSinceAsync( final JcrWorkspace workspace, final long timestamp ) { ChangeJournal journal = runningState.journal(); assert journal != null; Iterator<NodeKey> changedNodes = journal.changedNodesSince(timestamp); if (!changedNodes.hasNext()) { // there are no nodes which have been changed since the given timestamp return new ImmediateFuture<>(Boolean.FALSE); } return reindexSinceAsync(workspace.getSession().cache().getWorkspace(), getIndexWriter(), changedNodes); }
protected Future<Boolean> reindexSinceAsync( final JcrWorkspace workspace, final long timestamp ) { ChangeJournal journal = runningState.journal(); assert journal != null; Iterator<NodeKey> changedNodes = journal.changedNodesSince(timestamp); if (!changedNodes.hasNext()) { // there are no nodes which have been changed since the given timestamp return new ImmediateFuture<>(Boolean.FALSE); } return reindexSinceAsync(workspace.getSession().cache().getWorkspace(), getIndexWriter(), changedNodes); }
@Test public void shouldProvideSession() throws Exception { assertThat(workspace.getSession(), is(notNullValue())); }
@Override public ContentHandler getImportContentHandler( String parentAbsPath, int uuidBehavior ) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, AccessDeniedException, RepositoryException { CheckArg.isNotNull(parentAbsPath, "parentAbsPath"); session.checkLive(); // Create a new session, since we don't want to mess with the current session and because we'll save right // when finished reading the document ... JcrSession session = this.session.spawnSession(false); boolean saveWhenFinished = true; // Find the parent path ... AbstractJcrNode parent = session.getNode(parentAbsPath); if (!parent.isCheckedOut()) { throw new VersionException(JcrI18n.nodeIsCheckedIn.text(parent.getPath())); } Repository repo = getSession().getRepository(); boolean retainLifecycleInfo = repo.getDescriptorValue(Repository.OPTION_LIFECYCLE_SUPPORTED).getBoolean(); boolean retainRetentionInfo = repo.getDescriptorValue(Repository.OPTION_RETENTION_SUPPORTED).getBoolean(); return new JcrContentHandler(session, parent, uuidBehavior, saveWhenFinished, retainRetentionInfo, retainLifecycleInfo, null); }
@Override public ContentHandler getImportContentHandler( String parentAbsPath, int uuidBehavior ) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, AccessDeniedException, RepositoryException { CheckArg.isNotNull(parentAbsPath, "parentAbsPath"); session.checkLive(); // Create a new session, since we don't want to mess with the current session and because we'll save right // when finished reading the document ... JcrSession session = this.session.spawnSession(false); boolean saveWhenFinished = true; // Find the parent path ... AbstractJcrNode parent = session.getNode(parentAbsPath); if (!parent.isCheckedOut()) { throw new VersionException(JcrI18n.nodeIsCheckedIn.text(parent.getPath())); } Repository repo = getSession().getRepository(); boolean retainLifecycleInfo = repo.getDescriptorValue(Repository.OPTION_LIFECYCLE_SUPPORTED).getBoolean(); boolean retainRetentionInfo = repo.getDescriptorValue(Repository.OPTION_RETENTION_SUPPORTED).getBoolean(); return new JcrContentHandler(session, parent, uuidBehavior, saveWhenFinished, retainRetentionInfo, retainLifecycleInfo); }
JcrSession session = workspace.getSession(); NodeCache cache = session.cache().getWorkspace(); String workspaceName = workspace.getName();
JcrSession session = workspace.getSession(); NodeCache cache = session.cache().getWorkspace(); String workspaceName = workspace.getName();