protected final Map<String, String> workspaceNamesByKey() { // Get the map of workspace names by their key (since projections do not contain the workspace names) ... final Map<String, String> workspaceNamesByKey = new HashMap<>(); for (String workspaceName : repository.repositoryCache().getWorkspaceNames()) { workspaceNamesByKey.put(NodeKey.keyForWorkspaceName(workspaceName), workspaceName); } return workspaceNamesByKey; }
protected final Map<String, String> workspaceNamesByKey() { // Get the map of workspace names by their key (since projections do not contain the workspace names) ... final Map<String, String> workspaceNamesByKey = new HashMap<>(); for (String workspaceName : repository.repositoryCache().getWorkspaceNames()) { workspaceNamesByKey.put(NodeKey.keyForWorkspaceName(workspaceName), workspaceName); } return workspaceNamesByKey; }
private void createExternalWorkspaces() { Snapshot current = this.snapshot.get(); Collection<String> workspaces = current.externalSources(); for (String workspaceName : workspaces) { repository.repositoryCache().createExternalWorkspace(workspaceName, this); } }
RepositoryNodeTypeManager with( JcrRepository.RunningState repository, boolean includeColumnsForInheritedProperties, boolean includePseudoColumnsInSelectStar ) { assert this.systemWorkspaceName.equals(repository.repositoryCache().getSystemWorkspaceName()); PathFactory pathFactory = repository.context().getValueFactories().getPathFactory(); Path nodeTypesPath = pathFactory.createAbsolutePath(JcrLexicon.SYSTEM, JcrLexicon.NODE_TYPES); assert this.nodeTypesPath.equals(nodeTypesPath); RepositoryNodeTypeManager result = new RepositoryNodeTypeManager(repository, includeColumnsForInheritedProperties, includePseudoColumnsInSelectStar); // Now copy the node types from this cache into the new manager's cache ... // (If we didn't do this, we'd have to refresh from the system storage) result.nodeTypesCache = result.nodeTypesCache.with(this.nodeTypesCache.getAllNodeTypes()); // Do not copy the listeners return result; }
/** * Returns the repository's document translator. * * @return a {@link DocumentTranslator} instance. */ public DocumentTranslator getDocumentTranslator() { if (translator == null) { // We don't want the connectors to use a translator that converts large strings to binary values that are // managed within ModeShape's binary store. Instead, all of the connector-created string property values // should be kept as strings ... translator = repository.repositoryCache().getDocumentTranslator().withLargeStringSize(Long.MAX_VALUE); } return translator; }
protected final RepositoryCache repositoryCache() { return runningState().repositoryCache(); }
RepositoryNodeTypeManager( JcrRepository.RunningState repository, boolean includeColumnsForInheritedProperties, boolean includePseudoColumnsInSelectStar ) { this.repository = repository; this.context = repository.context(); this.nameFactory = this.context.getValueFactories().getNameFactory(); this.systemWorkspaceName = this.repository.repositoryCache().getSystemWorkspaceName(); PathFactory pathFactory = this.context.getValueFactories().getPathFactory(); this.nodeTypesPath = pathFactory.createAbsolutePath(JcrLexicon.SYSTEM, JcrLexicon.NODE_TYPES); this.nodeTypesCache = new NodeTypes(this.context); this.includeColumnsForInheritedProperties = includeColumnsForInheritedProperties; this.includePseudoColumnsInSelectStar = includePseudoColumnsInSelectStar; queryParser = new BasicSqlQueryParser(); }
private void createExternalWorkspaces() { Snapshot current = this.snapshot.get(); Collection<String> workspaces = current.externalSources(); for (String workspaceName : workspaces) { repository.repositoryCache().createExternalWorkspace(workspaceName, this); } }
protected BackupService( RunningState runningState ) { this.runningState = runningState; // backup restore should not care about federation, hence only the local store should be used documentStore = this.runningState.documentStore().localStore(); binaryStore = this.runningState.binaryStore(); repositoryCache = this.runningState.repositoryCache(); }
protected void refreshWorkspaces() { RunningState running = runningState(); if (running != null) { Set<String> workspaceNames = running.repositoryCache().getWorkspaceNames(); ValueFactories factories = running.context().getValueFactories(); JcrValue[] values = new JcrValue[workspaceNames.size()]; int i = 0; for (String workspaceName : workspaceNames) { values[i++] = valueFor(factories, workspaceName); } descriptors.put(Repository.REPOSITORY_WORKSPACES, values); } }
protected void refreshWorkspaces() { RunningState running = runningState(); if (running != null) { Set<String> workspaceNames = running.repositoryCache().getWorkspaceNames(); ValueFactories factories = running.context().getValueFactories(); JcrValue[] values = new JcrValue[workspaceNames.size()]; int i = 0; for (String workspaceName : workspaceNames) { values[i++] = valueFor(factories, workspaceName); } descriptors.put(Repository.REPOSITORY_WORKSPACES, values); } }
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 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); }
RepositoryLockManager with( JcrRepository.RunningState repository, RepositoryConfiguration.GarbageCollection gcConfig ) { assert this.systemWorkspaceName == repository.repositoryCache().getSystemWorkspaceName(); assert this.processId == repository.context().getProcessId(); PathFactory pathFactory = repository.context().getValueFactories().getPathFactory(); Path locksPath = pathFactory.create(pathFactory.createRootPath(), JcrLexicon.SYSTEM, ModeShapeLexicon.LOCKS); assert this.locksPath.equals(locksPath); return new RepositoryLockManager(repository, gcConfig); }
@Override protected void doRun( JcrRepository repository ) { repository.runningState().repositoryCache().optimizeChildren(targetCount, tolerance); } }
protected BackupService( RunningState runningState ) { this.runningState = runningState; // backup restore should not care about federation, hence only the local store should be used documentStore = this.runningState.documentStore().localStore(); binaryStore = this.runningState.binaryStore(); repositoryCache = this.runningState.repositoryCache(); }
RepositoryLockManager with( JcrRepository.RunningState repository, RepositoryConfiguration.GarbageCollection gcConfig ) { assert this.systemWorkspaceName == repository.repositoryCache().getSystemWorkspaceName(); assert this.processId == repository.context().getProcessId(); PathFactory pathFactory = repository.context().getValueFactories().getPathFactory(); Path locksPath = pathFactory.create(pathFactory.createRootPath(), JcrLexicon.SYSTEM, ModeShapeLexicon.LOCKS); assert this.locksPath.equals(locksPath); return new RepositoryLockManager(repository, gcConfig); }
@Override protected void doRun( JcrRepository repository ) { repository.runningState().repositoryCache().optimizeChildren(targetCount, tolerance); } }
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); }