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); } }
private void loadStoredProjections( boolean validate ) { assert !started(); SessionCache systemSession = repository.createSystemSession(repository.context(), false); CachedNode systemNode = getSystemNode(systemSession); ChildReference federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION); if (federationNodeRef != null) { Collection<Projection> newProjections = loadStoredProjections(systemSession, federationNodeRef, validate); Snapshot current = this.snapshot.get(); Snapshot updated = current.withProjections(newProjections); this.snapshot.compareAndSet(current, updated); } }
private final Name name( String name ) { return repository.runningState().context().getValueFactories().getNameFactory().create(name); }
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(); }
protected final DateTime firstDate( Property property ) { if (property == null) return null; return repository.context().getValueFactories().getDateFactory().create(property.getFirstValue()); }
protected final boolean firstBoolean( Property property ) { if (property == null) return false; return repository.context().getValueFactories().getBooleanFactory().create(property.getFirstValue()); }
protected final DateTime firstDate( Property property ) { if (property == null) return null; return repository.context().getValueFactories().getDateFactory().create(property.getFirstValue()); }
protected final boolean firstBoolean( Property property ) { if (property == null) return false; return repository.context().getValueFactories().getBooleanFactory().create(property.getFirstValue()); }
protected final String firstString( Property property ) { if (property == null) return null; return repository.context().getValueFactories().getStringFactory().create(property.getFirstValue()); }
protected final String firstString( Property property ) { if (property == null) return null; return repository.context().getValueFactories().getStringFactory().create(property.getFirstValue()); }
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); }
protected TextExtractors( JcrRepository.RunningState repository, RepositoryConfiguration.TextExtraction extracting ) { this(repository.context().getCachedTreadPool(extracting.getThreadPoolName(), extracting.getMaxPoolSize()), getConfiguredExtractors(repository, extracting)); }
protected TextExtractors( JcrRepository.RunningState repository, RepositoryConfiguration.TextExtraction extracting ) { this(repository.context().getCachedTreadPool(extracting.getThreadPoolName(), extracting.getMaxPoolSize()), getConfiguredExtractors(repository, extracting)); }
private void loadStoredProjections( boolean validate ) { assert !started(); SessionCache systemSession = repository.createSystemSession(repository.context(), false); CachedNode systemNode = getSystemNode(systemSession); ChildReference federationNodeRef = systemNode.getChildReferences(systemSession).getChild(ModeShapeLexicon.FEDERATION); if (federationNodeRef != null) { Collection<Projection> newProjections = loadStoredProjections(systemSession, federationNodeRef, validate); Snapshot current = this.snapshot.get(); Snapshot updated = current.withProjections(newProjections); this.snapshot.compareAndSet(current, updated); } }
private ConnectorChangeSetFactory createConnectorChangedSetFactory( final Connector c ) { return () -> { PathMappings mappings = getPathMappings(c); RunningState repository1 = repository(); final ExecutionContext context = repository1.context(); return new ConnectorChangeSetImpl(Connectors.this, mappings, context.getId(), context.getProcessId(), repository1.repositoryKey(), repository1.changeBus(), context.getValueFactories().getDateFactory(), repository().journalId()); }; }
@Before public void beforeEach() throws Exception { config = new RepositoryConfiguration("repoName").with(new TestingEnvironment()); repository = new JcrRepository(config); repository.start(); SessionCache systemCache = repository.createSystemSession(repository.runningState().context(), false); system = new SystemContent(systemCache); }
private ConnectorChangeSetFactory createConnectorChangedSetFactory( final Connector c ) { return () -> { PathMappings mappings = getPathMappings(c); RunningState repository1 = repository(); final ExecutionContext context = repository1.context(); return new ConnectorChangeSetImpl(Connectors.this, mappings, context.getId(), context.getProcessId(), repository1.repositoryKey(), repository1.changeBus(), context.getValueFactories().getDateFactory(), repository().journalId()); }; }
@Before public void beforeEach() throws Exception { config = new RepositoryConfiguration("repoName").with(new TestingEnvironment()); repository = new JcrRepository(config); repository.start(); context = repository.runningState().context(); repoTypeManager = repository.nodeTypeManager(); session = repository.login(); }
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); }