Package org.apache.jackrabbit.oak.core

Examples of org.apache.jackrabbit.oak.core.RootImpl


            branch.merge();
        } catch (CommitFailedException e) {
            throw new RuntimeException(e); // TODO: shouldn't need the wrapper
        }

        BuiltInNodeTypes.register(new RootImpl(store));
    }
View Full Code Here


    @CheckForNull
    public Root getRoot() {
        if (nodeStore != null) {
            Subject subject = new Subject(true, Collections.singleton(SystemPrincipal.INSTANCE), Collections.<Object>emptySet(), Collections.<Object>emptySet());
            AccessControlConfiguration acConfiguration = new OpenAccessControlConfiguration();
            return new RootImpl(nodeStore, workspaceName, subject, acConfiguration, indexProvider);
        }
        return null;
    }
View Full Code Here

            } catch (CommitFailedException e) {
                log.error("Failed to initialize privilege content ", e);
                throw new RuntimeException(e);
            }

            PrivilegeDefinitionWriter writer = new PrivilegeDefinitionWriter(new RootImpl(store));
            try {
                writer.writeDefinitions(getBuiltInDefinitions());
            } catch (RepositoryException e) {
                log.error("Failed to register built-in privileges", e);
                throw new RuntimeException(e);
View Full Code Here

    }

    //----------------------------------------------< RepositoryInitializer >---
    @Override
    public void initialize(NodeStore store) {
        Root root = new RootImpl(store);

        UserConfiguration userConfiguration = securityProvider.getUserConfiguration();
        UserManager userManager = userConfiguration.getUserManager(root, NamePathMapper.DEFAULT);

        try {
            NodeUtil rootTree = new NodeUtil(root.getTree("/"));
            NodeUtil index = rootTree.getOrAddChild(IndexConstants.INDEX_DEFINITIONS_NAME, JcrConstants.NT_UNSTRUCTURED);
            IndexUtils.createIndexDefinition(index, "authorizableId", true, UserConstants.REP_AUTHORIZABLE_ID);
            // FIXME OAK-396: rep:principalName only needs to be unique if defined with user/group nodes -> add defining nt-info to uniqueness constraint otherwise ac-editing will fail.
            IndexUtils.createIndexDefinition(index, "principalName", true, UserConstants.REP_PRINCIPAL_NAME);
            IndexUtils.createIndexDefinition(index, "members", false, UserConstants.REP_MEMBERS);

            String adminId = userConfiguration.getConfigurationParameters().getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
            if (userManager.getAuthorizable(adminId) == null) {
                // TODO: init admin with null password and force application to set it.
                userManager.createUser(adminId, adminId);
            }
            String anonymousId = userConfiguration.getConfigurationParameters().getConfigValue(PARAM_ANONYMOUS_ID, DEFAULT_ANONYMOUS_ID);
            if (userManager.getAuthorizable(anonymousId) == null) {
                userManager.createUser(anonymousId, null);
            }
            if (root.hasPendingChanges()) {
                root.commit();
            }
        } catch (RepositoryException e) {
            log.error("Failed to initialize user content ", e);
            throw new RuntimeException(e);
        } catch (CommitFailedException e) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.core.RootImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.