SystemContent { public void store( Iterable<JcrNodeType> nodeTypes, boolean updateExisting ) { MutableCachedNode nodeTypesNode = mutableNodeTypesNode(); Set<Name> names = new HashSet<Name>(); Set<NodeKey> keys = new HashSet<NodeKey>(); for (JcrNodeType nodeType : nodeTypes) { if (!names.add(nodeType.getInternalName())) { Logger.getLogger(getClass()).debug("Found duplicate node type: " + nodeType); } if (!keys.add(nodeType.key())) { Logger.getLogger(getClass()).debug("Found duplicate key: " + nodeType); } } for (JcrNodeType nodeType : nodeTypes) { store(nodeType, nodeTypesNode, updateExisting); } } SystemContent( SessionCache systemCache ); void save(); final SessionCache cache(); NodeKey systemKey(); NodeKey nodeTypesKey(); NodeKey indexesKey(); NodeKey namespacesKey(); NodeKey locksKey(); NodeKey versionStorageKey(); CachedNode systemNode(); CachedNode nodeTypesNode(); CachedNode namespacesNode(); CachedNode indexesNode(); CachedNode locksNode(); CachedNode versionStorageNode(); MutableCachedNode mutableNodeTypesNode(); MutableCachedNode mutableNamespacesNode(); MutableCachedNode mutableIndexesNode(); MutableCachedNode mutableLocksNode(); MutableCachedNode mutableVersionStorageNode(); MutableCachedNode mutableSystemNode(); void store( Iterable<JcrNodeType> nodeTypes,
                       boolean updateExisting ); void store( JcrNodeType nodeType,
                       boolean updateExisting ); IndexDefinition readIndexDefinition( CachedNode indexDefn,
                                                Name providerName ); IndexColumnDefinition readIndexColumnDefinition( CachedNode indexColumnDefn ); List<IndexDefinition> readAllIndexDefinitions(Set<String> providerNames); void remove( IndexDefinition indexDefn ); List<NodeTypeDefinition> readNodeTypes( Set<Name> nodeTypesToRefresh ); List<NodeTypeDefinition> readAllNodeTypes(); @SuppressWarnings( "unchecked" ) NodeTypeDefinition readNodeTypeDefinition( CachedNode nodeType ); Collection<Namespace> readAllNamespaces(); Set<String> registerNamespaces( Map<String, String> newUrisByPrefix ); String readNamespacePrefix( String namespaceUri,
                                       boolean generateIfMissing ); NodeKey versionHistoryNodeKeyFor( NodeKey versionableNodeKey ); boolean hasVersionHistory( NodeKey versionableNodeKey ); MutableCachedNode recordNewVersion( CachedNode versionableNode,
                                               SessionCache cacheForVersionableNode,
                                               Path versionHistoryPath,
                                               NodeKey originalVersionKey,
                                               Collection<Property> versionableProperties,
                                               DateTime now,
                                               AtomicReference<MutableCachedNode> frozenNodeOutput ); static final String GENERATED_PREFIX; }
@Test public void shouldStoreNodeTypeDefinitionsInSystemCatalog() { Collection<JcrNodeType> nodeTypes = repository.nodeTypeManager().getNodeTypes().getAllNodeTypes(); for (int i = 0; i != 3; ++i) { system.store(nodeTypes, true); assertThat(repository.nodeTypeManager().refreshFromSystem(), is(true)); } }