Package org.apache.jackrabbit.core.id

Examples of org.apache.jackrabbit.core.id.ItemId


            SessionContext context, Iterable<ItemState> items) {
        ItemManager itemMgr = context.getItemManager();
        SessionItemStateManager stateMgr = context.getItemStateManager();

        for (ItemState itemState : items) {
            ItemId id = itemState.getId();
            ItemImpl item;

            try {
                if (stateMgr.isItemStateInAttic(id)) {
                    // If an item has been removed and then again created, the
View Full Code Here


            for (int i = 0; i < slots.length; i++) {
                Map locks = slots[i];
                synchronized (locks) {
                    Iterator it = locks.keySet().iterator();
                    while (it.hasNext()) {
                        ItemId id = (ItemId) it.next();
                        if (FineGrainedISMLocking.hasDependency(changes, id)) {
                            return true;
                        }
                    }
                }
View Full Code Here

     * @throws ItemStateException
     */
    public NodeState createTransientNodeState(NodeState overlayedState, int initialStatus)
            throws ItemStateException {

        ItemId id = overlayedState.getNodeId();

        // check map; synchronized to ensure an entry is not created twice.
        synchronized (transientStore) {
            if (transientStore.containsKey(id)) {
                String msg = "there's already a node state instance with id " + id;
View Full Code Here

        /**
         * @see CompiledPermissions#canRead(Path, ItemId)
         */
        public boolean canRead(Path path, ItemId itemId) throws RepositoryException {
            ItemId id = (itemId == null) ? session.getHierarchyManager().resolvePath(path) : itemId;
            /* currently READ access cannot be denied to individual properties.
               if the parent node is readable the properties are as well.
               this simplifies the canRead test as well as the caching.
             */
            boolean existingNode = false;
            NodeId nodeId;
            if (id.denotesNode()) {
                nodeId = (NodeId) id;
                // since method may only be called for existing nodes the
                // flag be set to true if the id identifies a node.
                existingNode = true;
            } else {
View Full Code Here

        // but also verify that node.isNodeType("mix:versionable")==true;
        // this would have a negative impact on performance though...
        try {
            NodeState state = getNodeState();
            while (!state.hasPropertyName(JCR_ISCHECKEDOUT)) {
                ItemId parentId = state.getParentId();
                if (parentId == null) {
                    // root reached or out of hierarchy
                    return true;
                }
                state = (NodeState)
View Full Code Here

                    // we have enough access rights to see the event
                    continue;
                }

                // check read permission
                ItemId targetId = state.getTargetId();
                boolean granted = false;
                try {
                    granted = canRead(state);
                } catch (RepositoryException e) {
                    log.warn("Unable to check access rights for item: " + targetId);
View Full Code Here

            deletedIds.add(state.getId());
        }

        for (Iterator<EventState> it = events.iterator(); it.hasNext();) {
            EventState evState = it.next();
            ItemId targetId = evState.getTargetId();
            if (deletedIds.contains(targetId)) {
                // check read permission
                boolean granted = false;
                try {
                    granted = canRead(evState);
View Full Code Here

        for (Iterator<EventState> it = events.iterator(); it.hasNext() && session.isLive();) {
            EventState state = it.next();
            if (state.getType() == Event.NODE_ADDED
                    || state.getType() == Event.PROPERTY_ADDED
                    || state.getType() == Event.PROPERTY_CHANGED) {
                ItemId targetId = state.getTargetId();
                if (!canRead(state)) {
                    if (denied == null) {
                        denied = new HashSet<ItemId>();
                    }
                    denied.add(targetId);
View Full Code Here

        try {
            int n = in.readInt();   // number of entries
            while (n-- > 0) {
                byte type = in.readByte()// entry type
                ItemId id;
                if (type == NODE_ENTRY) {
                    // entry type: node
                    String s = in.readUTF();    // id
                    id = NodeId.valueOf(s);
                } else {
View Full Code Here

    public boolean itemExists(Path path) {
        try {
            // check sanity of session
            session.sanityCheck();

            ItemId id = hierMgr.resolvePath(path);
            return (id != null) && itemExists(id, path);
        } catch (RepositoryException re) {
            return false;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.id.ItemId

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.