Search in sources :

Example 1 with LazyItemIterator

use of org.apache.jackrabbit.jcr2spi.LazyItemIterator in project jackrabbit by apache.

the class VersionHistoryImpl method getAllVersions.

/**
     * @see VersionHistory#getAllVersions()
     */
public VersionIterator getAllVersions() throws RepositoryException {
    checkStatus();
    refreshEntry(vhEntry);
    Iterator<NodeEntry> childIter = vhEntry.getNodeEntries();
    List<NodeEntry> versionEntries = new ArrayList<NodeEntry>();
    // all child-nodes except from jcr:versionLabels point to Versions.
    while (childIter.hasNext()) {
        NodeEntry entry = childIter.next();
        if (!NameConstants.JCR_VERSIONLABELS.equals(entry.getName())) {
            versionEntries.add(entry);
        }
    }
    return new LazyItemIterator(getItemManager(), new RangeIteratorAdapter(versionEntries));
}
Also used : NodeEntry(org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry) ArrayList(java.util.ArrayList) LazyItemIterator(org.apache.jackrabbit.jcr2spi.LazyItemIterator) RangeIteratorAdapter(org.apache.jackrabbit.commons.iterator.RangeIteratorAdapter)

Aggregations

ArrayList (java.util.ArrayList)1 RangeIteratorAdapter (org.apache.jackrabbit.commons.iterator.RangeIteratorAdapter)1 LazyItemIterator (org.apache.jackrabbit.jcr2spi.LazyItemIterator)1 NodeEntry (org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry)1