@Override
    public List<PublishedItem> getPublishedItems( LeafNode node )
    {
        log.debug( "Getting published items for node {}", node.getUniqueIdentifier() );
        Set<PublishedItem> publishedItems;
        final Lock lock = itemsCache.getLock( node.getUniqueIdentifier() );
        lock.lock();
        try {
            final Set<PublishedItem> items = itemsCache.get( node.getUniqueIdentifier() );
            publishedItems = items != null ? items : new HashSet<>();
        } finally {
            lock.unlock();
        }

        return publishedItems.stream()
            .sorted(Comparator.comparing(PublishedItem::getCreationDate))
            .collect(Collectors.toList());
    }
Cache that holds all published items (mapped by node ID).
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/InMemoryPubSubPersistenceProvider.java