Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.ItemId


                            Iterator<? extends ItemId> itemIds)
        throws ItemNotFoundException, RepositoryException {
        this.itemMgr = itemMgr;
        List<HierarchyEntry> entries = new ArrayList<HierarchyEntry>();
        while (itemIds.hasNext()) {
            ItemId id = 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


    public void removeActivity(Node activityNode) throws UnsupportedRepositoryOperationException, RepositoryException {
        session.checkIsAlive();
        NodeImpl activity = getValidActivity(activityNode, "remove");

        NodeState nState = (NodeState) activity.getItemState();
        ItemId removeId = nState.getId();
        vMgr.removeActivity(nState);

        // if the removal succeeded, make sure there is no current activity
        // setting on this session, that points to the removed activity.
        if (activityId != null && activityId.equals(removeId)) {
View Full Code Here

    /**
     * @see NodeEntry#refresh(Event)
     */
    public void refresh(Event childEvent) {
        ItemId eventId = childEvent.getItemId();
        Path eventPath = childEvent.getPath();
        Name eventName = eventPath.getName();
        HierarchyEntry child = eventId == null ? null : 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.getNormalizedIndex();
                        internalAddNodeEntry(eventName, uniqueChildID, index);
                    } else {
                        internalAddPropertyEntry(eventName, true);
                    }
View Full Code Here

                            Iterator<? extends ItemId> itemIds)
        throws ItemNotFoundException, RepositoryException {
        this.itemMgr = itemMgr;
        List<HierarchyEntry> entries = new ArrayList<HierarchyEntry>();
        while (itemIds.hasNext()) {
            ItemId id = 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

        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

    /**
     * This implementation cached the item by its id and if the id
     * is uuid based but has no path, also by its path.
     */
    public void put(ItemInfo info, long generation) {
        ItemId id = info.getId();
        Entry<? extends ItemInfo> entry = info.denotesNode()
            ? new Entry<NodeInfo>((NodeInfo) info, generation)
            : new Entry<PropertyInfo>((PropertyInfo) info, generation);

        put(id, entry);
        if (id.getUniqueID() != null && id.getPath() == null) {
            put(info.getPath(), entry);
        }
    }
View Full Code Here

        log.debug("Added: ItemId = " + itemId + " URI = " + cleanUri);
    }

    public void remove(String uri) {
        String cleanUri = getCleanUri(uri);
        ItemId itemId = uriToIdCache.remove(cleanUri);
        if (itemId != null) {
            idToUriCache.remove(itemId);
        }
        log.debug("Removed: ItemId = " + itemId + " URI = " + cleanUri);
    }
View Full Code Here

            Path path = itemId.getPath();
            String uniqueID = itemId.getUniqueID();

            // resolver uuid part
            if (uniqueID != null) {
                ItemId uuidId = (path == null) ? itemId : service.getIdFactory().createNodeId(uniqueID);
                if (path != null && cache.containsItemId(uuidId)) {
                    // append uri of parent node, that is already cached
                    uriBuffer.append(cache.getUri(uuidId));
                } else {
                    // try to request locate-by-uuid report to build the uri
View Full Code Here

    PropertyId buildPropertyId(NodeId parentId, MultiStatusResponse response,
                               String workspaceName, NamePathResolver resolver) throws RepositoryException {
        IdURICache cache = getCache(workspaceName);
        if (cache.containsUri(response.getHref())) {
            ItemId id = cache.getItemId(response.getHref());
            if (!id.denotesNode()) {
                return (PropertyId) id;
            }
        }

        try {
View Full Code Here

    private NodeId getNodeId(String uri, SessionInfo sessionInfo, boolean nodeIsGone) throws RepositoryException {

        IdURICache cache = getCache(sessionInfo.getWorkspaceName());
        if (cache.containsUri(uri)) {
            // id has been accessed before and is cached
            ItemId id = cache.getItemId(uri);
            if (id.denotesNode()) {
                return (NodeId) id;
            }
        }

        if (nodeIsGone) {
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.