Examples of HierarchyEntry


Examples of com.volantis.devrep.device.api.xml.hierarchy.HierarchyEntry

        indent(indent, buffer);
        buffer.append("Entry:" + entry.getDeviceName() + "\n");
        int childIndent = indent+1;
        Iterator children = entry.children();
        while (children.hasNext()) {
            HierarchyEntry child = (HierarchyEntry) children.next();
            dumpEntry(child, buffer, childIndent);
        }
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.hierarchy.HierarchyEntry

        DefaultDevice device = null;

        // First check in the hierarchy to see if the device exists.
        Hierarchy hierarchy = loadHierarchy();
        final HierarchyEntry entry = hierarchy.find(deviceName);
        if (entry != null) {
            // The device name exists in the hierarchy.

            // Create the device by reading in it's standard and custom
            // polices, and also any device patterns and device TACs.
            device = createDevice(deviceName);

            // We must explicitly add the fallback policy for backward
            // compatibility.
            final HierarchyEntry parent = entry.getParent();
            String fallbackDeviceName;
            if (parent != null) {
                fallbackDeviceName = parent.getDeviceName();
            } else {
                // for backwards compatibility with the old JDOM accessor,
                // we add a fallback of null for Master. Not sure if we
                // really should?
                fallbackDeviceName = null;
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.hierarchy.HierarchyEntry

            String deviceName)
            throws RepositoryException {

        Iterator children = null;
        Hierarchy hierarchy = loadHierarchy();
        HierarchyEntry entry = hierarchy.find(deviceName);
        if (entry != null) {
            children = entry.children();
        }
        return new IteratorRepositoryEnumeration(children) {

            public Object next() throws RepositoryException {
                HierarchyEntry child = (HierarchyEntry) super.next();
                return child.getDeviceName();
            }
        };
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.hierarchy.HierarchyEntry

        Hierarchy hierarchy = loadHierarchy();
        Iterator entries = hierarchy.entries();
        return new IteratorRepositoryEnumeration(entries) {
            public Object next() throws RepositoryException {
                HierarchyEntry entry = (HierarchyEntry) super.next();
                return entry.getDeviceName();
            }
        };
    }
View Full Code Here

Examples of com.volantis.devrep.device.api.xml.hierarchy.HierarchyEntry

        Collection deviceFallbacks = new ArrayList();
        Hierarchy hierarchy = loadHierarchy();
        Iterator entries = hierarchy.entries();
        while (entries.hasNext()) {
            HierarchyEntry entry = (HierarchyEntry) entries.next();
            HierarchyEntry parent = entry.getParent();
            if (parent != null) {
                deviceFallbacks.add(new String[] {
                    entry.getDeviceName(), parent.getDeviceName()});
            } else {
                // Add a special Master=null entry.
                // This is how the old JDOM accessor worked.
                deviceFallbacks.add(new String[] {
                    entry.getDeviceName(), null});
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

        assert status == STATUS_PENDING;
        status = STATUS_PERSISTED;

        // invalidate all references to the removed activity
        while (refs.hasNext()) {
            HierarchyEntry entry = hMgr.lookup(refs.next());
            if (entry != null) {
                entry.invalidate(false);
            }
        }

        // invalidate the activities parent
        parent.getNodeEntry().invalidate(false);
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

     *
     * @param state
     * @throws RepositoryException
     */
    private static void updateId(ItemState state) throws RepositoryException {
        HierarchyEntry he = state.getHierarchyEntry();
        while (he.getStatus() != Status.INVALIDATED) {
            he = he.getParent();
            if (he == null) {
                // root reached without intermediate invalidated entry
                return;
            }
        }
        // he is INVALIDATED -> force reloading in order to be aware of id changes
        he.getItemState();
    }
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

        if (version.getSession() == this) {
            nodeState = (NodeState) ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            Path parentPath = p.getAncestor(1);
            HierarchyEntry parentEntry = getHierarchyManager().lookup(parentPath);
            if (parentEntry != null) {
                // make sure the parent entry is up to date
                parentEntry.invalidate(false);
            }
            nodeState = getHierarchyManager().getNodeState(p);
        }
        return nodeState;
    }
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

            } else {
                info = cached.info;
            }

            // Build the hierarchy entry for the item info
            HierarchyEntry entry = createHierarchyEntries(info, anyParent);
            if (entry == null || !entry.denotesNode()) {
                throw new ItemNotFoundException(
                        "HierarchyEntry does not belong to any existing ItemInfo. No ItemState was created.");
            } else {
                // Now we can check wheter the item info from the cache is up to date
                long generation = entry.getGeneration();
                if (isOutdated(cached, entry)) {
                    // if not, retreive the item info from the service and put the whole batch into the cache
                    infos = service.getItemInfos(sessionInfo, nodeId);
                    info = first(infos, cache, generation);
                } else if (infos != null) {
View Full Code Here

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

            } else {
                info = cached.info;
            }

            // Build the hierarchy entry for the item info
            HierarchyEntry entry = createHierarchyEntries(info, anyParent);

            if (entry == null || entry.denotesNode()) {
                throw new ItemNotFoundException(
                        "HierarchyEntry does not belong to any existing ItemInfo. No ItemState was created.");
            } else {
                if (isOutdated(cached, entry)) {
                    // if not, retreive the item info from the service and put the whole batch into the cache
                    info = service.getPropertyInfo(sessionInfo, propertyId);
                    cache.put(info, entry.getGeneration());
                }

                assertMatchingPath(info, entry);
                return createPropertyState(info, (PropertyEntry) entry);
            }
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.