@Override
    public void removePublishedItem(PublishedItem item) {
        PublishedItem.UniqueIdentifier itemKey = item.getUniqueIdentifier();
        itemCache.remove(itemKey);
        synchronized (itemsPending)
        {
            itemsToDelete.addLast(item);
            PublishedItem itemToReplace = itemsPending.remove(itemKey);
            if (itemToReplace != null) {
                itemsToAdd.remove(itemToReplace); // remove duplicate from itemsToAdd linked list
            }
        }
    }
Persists any changes that have been applied to the caches by invoking the relevant methods of the delegate.

A flush can be performed either local (typically used to periodically persist data) or cluster-wide (useful to
ensure that a particular state is reached, cluster-wide).

@param sendToCluster set to 'true' to trigger a flush on all cluster nodes. If false, a flush will occur only on
                     the local node.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/CachingPubsubPersistenceProvider.java