/** * Get the NodeCache for the given workspace name. The result will either be the overridden value supplied in the constructor * or the workspace cache from the referenced RepositoryCache. * * @param workspaceName the name of the workspace * @return the node cache; never null * @throws WorkspaceNotFoundException if there is no workspace with the supplied name */ public NodeCache getNodeCache( String workspaceName ) throws WorkspaceNotFoundException { NodeCache cache = overriddenNodeCachesByWorkspaceName.get(workspaceName); if (cache == null) { cache = repositoryCache.getWorkspaceCache(workspaceName); } return cache; }
/** * Get the NodeCache for the given workspace name. The result will either be the overridden value supplied in the constructor * or the workspace cache from the referenced RepositoryCache. * * @param workspaceName the name of the workspace * @return the node cache; never null * @throws WorkspaceNotFoundException if there is no workspace with the supplied name */ public NodeCache getNodeCache( String workspaceName ) throws WorkspaceNotFoundException { NodeCache cache = overriddenNodeCachesByWorkspaceName.get(workspaceName); if (cache == null) { cache = repositoryCache.getWorkspaceCache(workspaceName); } return cache; }
protected final NodeCache workspaceCache( String workspaceName ) { return repositoryCache().getWorkspaceCache(workspaceName); }
protected final NodeCache workspaceCache( String workspaceName ) { return repositoryCache().getWorkspaceCache(workspaceName); }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
protected boolean reindexSystemContent( CachedNode nodeInSystemBranch, int depth, IndexWriter indexes ) { RepositoryCache repoCache = runningState.repositoryCache(); String workspaceName = repoCache.getSystemWorkspaceName(); NodeCache systemWorkspaceCache = repoCache.getWorkspaceCache(workspaceName); return reindexContent(workspaceName, systemWorkspaceCache, nodeInSystemBranch, depth, true, indexes); }
/** * Create a batch of nodes around the supplied iterator. Note that the supplied iterator is accessed lazily only when the * batch is {@link Batch#nextRow() used}. * * @param keys the iterator over the keys of the nodes to be returned; if null, an {@link #emptySequence empty instance} is * returned * @param nodeCount the number of nodes in the iterator; must be -1 if not known, 0 if known to be empty, or a positive number * if the number of nodes is known * @param score the score to return for all of the nodes * @param workspaceName the name of the workspace in which all of the nodes exist * @param repository the repository cache used to access the workspaces and cached nodes; may be null only if the key sequence * is null or empty * @return the batch of nodes; never null */ public static Batch batchOfKeys( final Iterator<NodeKey> keys, final long nodeCount, final float score, final String workspaceName, final RepositoryCache repository ) { assert nodeCount >= -1; if (keys == null) return emptyBatch(workspaceName, 1); final NodeCache cache = repository.getWorkspaceCache(workspaceName); return batchOfKeys(keys, nodeCount, score, workspaceName, cache); }
protected boolean reindexSystemContent( CachedNode nodeInSystemBranch, int depth, IndexWriter indexes ) { RepositoryCache repoCache = runningState.repositoryCache(); String workspaceName = repoCache.getSystemWorkspaceName(); NodeCache systemWorkspaceCache = repoCache.getWorkspaceCache(workspaceName); return reindexContent(workspaceName, systemWorkspaceCache, nodeInSystemBranch, depth, true, indexes); }
/** * Create a batch of nodes around the supplied iterator. Note that the supplied iterator is accessed lazily only when the * batch is {@link Batch#nextRow() used}. * * @param keys the iterator over the keys of the nodes to be returned; if null, an {@link #emptySequence empty instance} is * returned * @param nodeCount the number of nodes in the iterator; must be -1 if not known, 0 if known to be empty, or a positive number * if the number of nodes is known * @param score the score to return for all of the nodes * @param workspaceName the name of the workspace in which all of the nodes exist * @param repository the repository cache used to access the workspaces and cached nodes; may be null only if the key sequence * is null or empty * @return the batch of nodes; never null */ public static Batch batchOfKeys( final Iterator<NodeKey> keys, final long nodeCount, final float score, final String workspaceName, final RepositoryCache repository ) { assert nodeCount >= -1; if (keys == null) return emptyBatch(workspaceName, 1); final NodeCache cache = repository.getWorkspaceCache(workspaceName); return batchOfKeys(keys, nodeCount, score, workspaceName, cache); }
/** * Obtain a {@link NodeSequence} that returns the (queryable) node at the given path in the workspace, where the node is * assigned the given score. * * @param path the path of the node; may not be null * @param score the score for the node * @return the sequence of node(s); never null */ public NodeSequence singleNode( Path path, float score ) { String workspaceName = getWorkspaceName(path); // Get the node filter to use ... NodeFilter nodeFilter = nodeFilterForWorkspace(workspaceName); if (nodeFilter != null) { // Find the node by path ... NodeCache cache = repo.getWorkspaceCache(workspaceName); CachedNode node = getNodeAtPath(path, cache); if (node != null && nodeFilter.includeNode(node, cache)) { return NodeSequence.withNodes(Collections.singleton(node), score, workspaceName); } } return NodeSequence.emptySequence(1); }
/** * Obtain a {@link NodeSequence} that returns the (queryable) node at the given path in the workspace, where the node is * assigned the given score. * * @param path the path of the node; may not be null * @param score the score for the node * @return the sequence of node(s); never null */ public NodeSequence singleNode( Path path, float score ) { String workspaceName = getWorkspaceName(path); // Get the node filter to use ... NodeFilter nodeFilter = nodeFilterForWorkspace(workspaceName); if (nodeFilter != null) { // Find the node by path ... NodeCache cache = repo.getWorkspaceCache(workspaceName); CachedNode node = getNodeAtPath(path, cache); if (node != null && nodeFilter.includeNode(node, cache)) { return NodeSequence.withNodes(Collections.singleton(node), score, workspaceName); } } return NodeSequence.emptySequence(1); }
new Date(earliestTimestamp), repositoryCache.getName(), workspaceName); WorkspaceCache workspaceCache = repositoryCache.getWorkspaceCache(workspaceName); reindexSince(workspaceCache, writer, changedNodes);
protected void reindexSystemContent() { RepositoryCache repoCache = runningState.repositoryCache(); String workspaceName = repoCache.getSystemWorkspaceName(); NodeCache systemWorkspaceCache = repoCache.getWorkspaceCache(workspaceName); CachedNode systemNode = systemWorkspaceCache.getNode(repoCache.getSystemKey()); if (reindexContent(workspaceName, systemWorkspaceCache, systemNode, Integer.MAX_VALUE, true, getIndexWriter())) { commitChanges(workspaceName); } }
protected void reindexSystemContent() { RepositoryCache repoCache = runningState.repositoryCache(); String workspaceName = repoCache.getSystemWorkspaceName(); NodeCache systemWorkspaceCache = repoCache.getWorkspaceCache(workspaceName); CachedNode systemNode = systemWorkspaceCache.getNode(repoCache.getSystemKey()); if (reindexContent(workspaceName, systemWorkspaceCache, systemNode, Integer.MAX_VALUE, true, getIndexWriter())) { commitChanges(workspaceName); } }
protected void importInitialContent( String workspaceName ) throws RepositoryException { // check that there is something which should be imported if (!initialContentConfig.hasInitialContentFile(workspaceName)) { return; } RepositoryCache repositoryCache = repository.repositoryCache(); WorkspaceCache wsCache = repositoryCache.getWorkspaceCache(workspaceName); if (!wsCache.isEmpty()) { // the ws cache must be empty for initial content to be imported LOGGER.debug("Skipping import of initial content into workspace {0} as it is not empty", workspaceName); return; } InputStream stream = getInitialContentFileStream(workspaceName); if (stream == null) { return; } doImport(workspaceName, stream); }
protected void importInitialContent( String workspaceName ) throws RepositoryException { // check that there is something which should be imported if (!initialContentConfig.hasInitialContentFile(workspaceName)) { return; } RepositoryCache repositoryCache = repository.repositoryCache(); WorkspaceCache wsCache = repositoryCache.getWorkspaceCache(workspaceName); if (!wsCache.isEmpty()) { // the ws cache must be empty for initial content to be imported LOGGER.debug("Skipping import of initial content into workspace {0} as it is not empty", workspaceName); return; } InputStream stream = getInitialContentFileStream(workspaceName); if (stream == null) { return; } doImport(workspaceName, stream); }
NodeCache cache = repo.getWorkspaceCache(workspaceName); if (NodeKey.isValidFormat(identifier)) { NodeKey key = new NodeKey(identifier);
NodeCache cache = repo.getWorkspaceCache(workspaceName); NodeKey startingNode = null; if (path != null) {
NodeCache cache = repo.getWorkspaceCache(workspaceName); NodeKey startingNode = null; if (path != null) {