Package org.apache.jackrabbit.core

Examples of org.apache.jackrabbit.core.NodeImpl


                // allow provider to update
                virtProvider.onNodeTypeAdded(ntName);
            }
            if (systemSession != null) {
                // generate observation events
                NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(rootNodeId);
                NodeImpl child = root.getNode(ntName);
                List events = new ArrayList();
                recursiveAdd(events, root, child);
                obsDispatcher.dispatch(events, systemSession, NODE_TYPES_PATH);
            }
        } catch (RepositoryException e) {
View Full Code Here


     */
    public void nodeTypeUnregistered(QName ntName) {
        try {
            if (systemSession != null) {
                // generated observation events
                NodeImpl root = (NodeImpl) systemSession.getItemManager().getItem(rootNodeId);
                NodeImpl child = root.getNode(ntName);
                List events = new ArrayList();
                recursiveRemove(events, root, child);
                obsDispatcher.dispatch(events, systemSession, NODE_TYPES_PATH);
            }
            if (virtProvider != null) {
View Full Code Here

                    node.getSession()
            ));
        }
        NodeIterator niter = node.getNodes();
        while (niter.hasNext()) {
            NodeImpl n = (NodeImpl) niter.nextNode();
            recursiveAdd(events, node, n);
        }
    }
View Full Code Here

                parent.getMixinTypeNames(),
                node.getSession()
        ));
        NodeIterator niter = node.getNodes();
        while (niter.hasNext()) {
            NodeImpl n = (NodeImpl) niter.nextNode();
            recursiveRemove(events, node, n);
        }
    }
View Full Code Here

        public NodeImpl nextNodeImpl() {
            initialize();
            if (next == null) {
                throw new NoSuchElementException();
            }
            NodeImpl n = next;
            fetchNext();
            return n;
        }
View Full Code Here

    /**
     * @see UserManager#getAuthorizable(Principal)
     */
    public Authorizable getAuthorizable(Principal principal) throws RepositoryException {
        NodeImpl n = null;
        // shortcuts that avoids executing a query.
        if (principal instanceof AuthorizableImpl.NodeBasedPrincipal) {
            NodeId nodeId = ((AuthorizableImpl.NodeBasedPrincipal) principal).getNodeId();
            try {
                n = session.getNodeById(nodeId);
View Full Code Here

            throw new IllegalArgumentException("Cannot create user: null password.");
        }
        // NOTE: principal validation during setPrincipal call.

        try {
            NodeImpl userNode = (NodeImpl) nodeCreator.createUserNode(userID, intermediatePath);
            setPrincipal(userNode, principal);
            setProperty(userNode, P_PASSWORD, getValue(UserImpl.buildPasswordValue(password)), true);

            User user = createUser(userNode);
            onCreate(user);
            if (isAutoSave()) {
                session.save();
            }

            log.debug("User created: " + userID + "; " + userNode.getPath());
            return user;
        } catch (RepositoryException e) {
            // something went wrong -> revert changes and re-throw
            session.refresh(false);
            log.debug("Failed to create new User, reverting changes.");
View Full Code Here

     */
    public Group createGroup(String groupID, Principal principal, String intermediatePath) throws AuthorizableExistsException, RepositoryException {
        checkValidID(groupID);
        // NOTE: principal validation during setPrincipal call.
        try {
            NodeImpl groupNode = (NodeImpl) nodeCreator.createGroupNode(groupID, intermediatePath);
           
            if (principal != null) {
              setPrincipal(groupNode, principal);
            }

            Group group = createGroup(groupNode);
            onCreate(group);
            if (isAutoSave()) {
                session.save();
            }

            log.debug("Group created: " + groupID + "; " + groupNode.getPath());
            return group;
        } catch (RepositoryException e) {
            session.refresh(false);
            log.debug("newInstance new Group failed, revert changes on parent");
            throw e;
View Full Code Here

            parent.save();
        }
    }

    NodeImpl addProtectedNode(NodeImpl parent, Name name, Name ntName) throws RepositoryException {
        NodeImpl n = addNode(parent, name, ntName);
        if (isAutoSave()) {
            parent.save();
        }
        return n;
    }
View Full Code Here

     * @return The authorizable with the given <code>id</code> or <code>null</code>.
     * @throws RepositoryException If an error occurs.
     */
    private Authorizable internalGetAuthorizable(String id) throws RepositoryException {
        NodeId nodeId = buildNodeId(id);
        NodeImpl n = null;
        try {
            n = session.getNodeById(nodeId);
        } catch (ItemNotFoundException e) {
            if (compatibleJR16) {
                // backwards-compatibility with JR < 2.0 user/group structure that doesn't
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.NodeImpl

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.