Examples of ItemInfo


Examples of org.apache.jackrabbit.spi.ItemInfo

    private void checkHierarchy() throws PathNotFoundException, RepositoryException, ItemNotFoundException,
            AccessDeniedException {

        for (Iterator<ItemInfo> itemInfos = itemInfoStore.getItemInfos(); itemInfos.hasNext();) {
            ItemInfo itemInfo = itemInfos.next();
            String jcrPath = toJCRPath(itemInfo.getPath());
            Item item = session.getItem(jcrPath);
            assertEquals(jcrPath, item.getPath());

            if (item.getDepth() > 0) {
                Node parent = item.getParent();
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

     * @param id
     * @return
     * @throws ItemNotFoundException  if no such item exists
     */
    public ItemInfo getItemInfo(ItemId id) throws ItemNotFoundException {
        ItemInfo itemInfo = infos.get(id);

        return itemInfo == null
            ? ItemInfoStore.<ItemInfo>notFound(id)
            : itemInfo;
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

     * @param id
     * @return
     * @throws ItemNotFoundException  if no such node exists
     */
    public NodeInfo getNodeInfo(NodeId id) throws ItemNotFoundException {
        ItemInfo itemInfo = getItemInfo(id);

        return itemInfo.denotesNode()
            ? (NodeInfo) itemInfo
            : ItemInfoStore.<NodeInfo>notFound(id);
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

     * @param id
     * @return
     * @throws ItemNotFoundException  if no such property exists
     */
    public PropertyInfo getPropertyInfo(PropertyId id) throws ItemNotFoundException {
        ItemInfo itemInfo = getItemInfo(id);

        return itemInfo.denotesNode()
            ? ItemInfoStore.<PropertyInfo>notFound(id)
            : (PropertyInfo) itemInfo;
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

    public NodeState createNodeState(NodeId nodeId, NodeEntry entry) throws ItemNotFoundException,
            RepositoryException {

        try {
            Entry<NodeInfo> cached = cache.getNodeInfo(nodeId);
            ItemInfo info;
            if (isUpToDate(cached, entry)) {
                info = cached.info;
            } else {
                // otherwise retrieve item info from service and cache the whole batch
                Iterator<? extends ItemInfo> infos = service.getItemInfos(sessionInfo, nodeId);
                info = first(infos, cache, entry.getGeneration());
                if (info == null || !info.denotesNode()) {
                    throw new ItemNotFoundException("NodeId: " + nodeId);
                }
            }

            assertMatchingPath(info, entry);
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

        try {
            // Get item info from cache
            Iterator<? extends ItemInfo> infos = null;
            Entry<NodeInfo> cached = cache.getNodeInfo(nodeId);
            ItemInfo info;
            if (cached == null) {
                // or from service if not in cache
                infos = service.getItemInfos(sessionInfo, nodeId);
                info = first(infos, null, 0);
                if (info == null || !info.denotesNode()) {
                    throw new ItemNotFoundException("NodeId: " + nodeId);
                }
            } else {
                info = cached.info;
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

            throws ItemNotFoundException, RepositoryException {

        try {
            // Get item info from cache and use it if up to date
            Entry<PropertyInfo> cached = cache.getPropertyInfo(propertyId);
            ItemInfo info;
            if (isUpToDate(cached, entry)) {
                info = cached.info;
            } else {
                // otherwise retrieve item info from service and cache the whole batch
                Iterator<? extends ItemInfo> infos = service.getItemInfos(sessionInfo, propertyId);
                info = first(infos, cache, entry.getGeneration());
                if (info == null || info.denotesNode()) {
                    throw new ItemNotFoundException("PropertyId: " + propertyId);
                }
            }

            assertMatchingPath(info, entry);
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

        try {
            // Get item info from cache
            Iterator<? extends ItemInfo> infos = null;
            Entry<PropertyInfo> cached = cache.getPropertyInfo(propertyId);
            ItemInfo info;
            if (cached == null) {
                // or from service if not in cache
                infos = service.getItemInfos(sessionInfo, propertyId);
                info = first(infos, null, 0);
                if (info == null || info.denotesNode()) {
                    throw new ItemNotFoundException("PropertyId: " + propertyId);
                }
            } else {
                info = cached.info;
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

     * Returns the first item in the iterator if it exists. Otherwise returns <code>null</code>.
     * If <code>cache</code> is not <code>null</code>, caches all items by the given
     * <code>generation</code>.
     */
    private static ItemInfo first(Iterator<? extends ItemInfo> infos, ItemInfoCache cache, long generation) {
        ItemInfo first = null;
        if (infos.hasNext()) {
            first = infos.next();
            if (cache != null) {
                cache.put(first, generation);
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.ItemInfo

    @Override
    public Iterator<? extends ItemInfo> getItemInfos(SessionInfo sessionInfo, ItemId itemId)
            throws ItemNotFoundException, RepositoryException {

        roundTripCount++;
        ItemInfo itemInfo = itemInfoStore.getItemInfo(itemId);
        return iteratorChain(singleton(itemInfo), getBatch());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.