Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.ItemId


     * @inheritDoc
     */
    public PropertyId getPropertyId(String uri, SessionInfo sessionInfo) throws RepositoryException {
        IdURICache cache = getCache(sessionInfo.getWorkspaceName());
        if (cache.containsUri(uri)) {
            ItemId id = cache.getItemId(uri);
            if (!id.denotesNode()) {
                return (PropertyId) id;
            }
        }

        // separate parent uri and property JCRName
View Full Code Here


                            Iterator itemIds)
        throws ItemNotFoundException, RepositoryException {
        this.itemMgr = itemMgr;
        List entries = new ArrayList();
        while (itemIds.hasNext()) {
            ItemId id = (ItemId) itemIds.next();
            HierarchyEntry entry;
            if (id.denotesNode()) {
                entry = hierarchyMgr.getNodeEntry((NodeId) id);
            } else {
                entry = hierarchyMgr.getPropertyEntry((PropertyId) id);
            }
            entries.add(entry);
View Full Code Here

                Session session = sessionInfo.getSession();
                javax.jcr.observation.Event e = events.nextEvent();
                Path p = resolver.getQPath(e.getPath());
                Path parent = p.getAncestor(1);
                NodeId parentId = idFactory.createNodeId((String) null, parent);
                ItemId itemId = null;
                Node node = null;
                switch (e.getType()) {
                    case Event.NODE_ADDED:
                        node = session.getItem(e.getPath()).getParent();
                    case Event.NODE_REMOVED:
View Full Code Here

        // build itemId from the given state and the relative path without
        // making an attempt to retrieve the proper id of the item possibly
        // identified by the resulting id.
        // the server must be able to deal with paths and with proper ids anyway.
        // TODO: 'createNodeId' is basically wrong since isGranted is unspecific for any item.
        ItemId id = idFactory.createNodeId((NodeId) parentState.getWorkspaceId(), relPath);
        return service.isGranted(sessionInfo, id, actions);
    }
View Full Code Here

    /**
     * @see NodeEntry#refresh(Event)
     */
    public void refresh(Event childEvent) {
        ItemId eventId = childEvent.getItemId();
        Path eventPath = childEvent.getPath();
        Name eventName = eventPath.getNameElement().getName();
        HierarchyEntry child = lookupEntry(eventId, eventPath);

        switch (childEvent.getType()) {
            case Event.NODE_ADDED:
            case Event.PROPERTY_ADDED:
                if (child == null || child.getStatus() == Status.REMOVED) {
                    // no such child or a colliding new child existed but got
                    // removed already -> add the new entry.
                    if (childEvent.getType() ==  Event.NODE_ADDED) {
                        String uniqueChildID = (eventId.getPath() == null) ? eventId.getUniqueID() : null;
                        int index = eventPath.getNameElement().getNormalizedIndex();
                        internalAddNodeEntry(eventName, uniqueChildID, index);
                    } else {
                        internalAddPropertyEntry(eventName, true);
                    }
View Full Code Here

        // build itemId from the given state and the relative path without
        // making an attempt to retrieve the proper id of the item possibly
        // identified by the resulting id.
        // the server must be able to deal with paths and with proper ids anyway.
        // TODO: 'createNodeId' is basically wrong since isGranted is unspecific for any item.
        ItemId id = idFactory.createNodeId((NodeId) parentState.getWorkspaceId(), relPath);
        return service.isGranted(sessionInfo, id, actions);
    }
View Full Code Here

    /**
     * @see NodeEntry#refresh(Event)
     */
    public void refresh(Event childEvent) {
        ItemId eventId = childEvent.getItemId();
        Path eventPath = childEvent.getPath();
        Name eventName = eventPath.getNameElement().getName();
        HierarchyEntry child = lookupEntry(eventId, eventPath);

        switch (childEvent.getType()) {
            case Event.NODE_ADDED:
            case Event.PROPERTY_ADDED:
                if (child == null || child.getStatus() == Status.REMOVED) {
                    // no such child or a colliding new child existed but got
                    // removed already -> add the new entry.
                    if (childEvent.getType() ==  Event.NODE_ADDED) {
                        String uniqueChildID = (eventId.getPath() == null) ? eventId.getUniqueID() : null;
                        int index = eventPath.getNameElement().getNormalizedIndex();
                        internalAddNodeEntry(eventName, uniqueChildID, index);
                    } else {
                        internalAddPropertyEntry(eventName, true);
                    }
View Full Code Here

        ObjectOutputStream oos = new ObjectOutputStream(out);
        oos.writeObject(id);
        oos.close();
        ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
        ObjectInputStream ois = new ObjectInputStream(in);
        ItemId clone = (ItemId) ois.readObject();
        assertEquals("Deserialized ItemId not equal to original", id, clone);
    }
View Full Code Here

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof ItemId) {
                ItemId other = (ItemId) obj;
                return equals(other);
            }
            return false;
        }
View Full Code Here

                // should not occur
                log.error("Internal error while building Event", e.getMessage());
                continue;
            }

            ItemId eventId = null;
            try {
                if (type == Event.NODE_ADDED || type == Event.NODE_REMOVED) {
                    eventId = uriResolver.getNodeId(href, sessionInfo);
                } else {
                    eventId = uriResolver.getPropertyId(href, sessionInfo);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.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.