/** * Obtain a new version of this cache with the specified node types removed from the new cache. * * @param removedNodeTypes the node types that are to be removed from the resulting cache; may not be null but may be empty * @return the resulting cache that contains all of the node types within this cache but without the supplied node types; * never null */ protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) { if (removedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); nodeTypes.removeAll(removedNodeTypes); return new NodeTypes(this.context, nodeTypes, getVersion() + 1); }
/** * Obtain a new version of this cache with the specified node types removed from the new cache. * * @param removedNodeTypes the node types that are to be removed from the resulting cache; may not be null but may be empty * @return the resulting cache that contains all of the node types within this cache but without the supplied node types; * never null */ protected NodeTypes without( Collection<JcrNodeType> removedNodeTypes ) { if (removedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); nodeTypes.removeAll(removedNodeTypes); return new NodeTypes(this.context, nodeTypes, getVersion() + 1); }
/** * Obtain a new version of this cache with the specified node types added to the new cache. * * @param addedNodeTypes the node types that are to be added to the resulting cache; may not be null but may be empty * @return the resulting cache that contains all of the node types within this cache and the supplied node types; never null */ protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) { if (addedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); // if there are updated node types, remove them first (hashcode is based on name alone), // else addAll() will ignore the changes. nodeTypes.removeAll(addedNodeTypes); nodeTypes.addAll(addedNodeTypes); return new NodeTypes(this.context, nodeTypes, getVersion() + 1); }
/** * Obtain a new version of this cache with the specified node types added to the new cache. * * @param addedNodeTypes the node types that are to be added to the resulting cache; may not be null but may be empty * @return the resulting cache that contains all of the node types within this cache and the supplied node types; never null */ protected NodeTypes with( Collection<JcrNodeType> addedNodeTypes ) { if (addedNodeTypes.isEmpty()) return this; Collection<JcrNodeType> nodeTypes = new HashSet<JcrNodeType>(this.nodeTypes.values()); // if there are updated node types, remove them first (hashcode is based on name alone), // else addAll() will ignore the changes. nodeTypes.removeAll(addedNodeTypes); nodeTypes.addAll(addedNodeTypes); return new NodeTypes(this.context, nodeTypes, getVersion() + 1); }
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(); }
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(); }