@Override
    public PEPService loadPEPServiceFromDB(JID jid)
    {
        final PubSubService.UniqueIdentifier id = new PubSubService.UniqueIdentifier( jid.toString() );
        final Lock lock = serviceIdToNodesCache.getLock( id );
        lock.lock();
        try {
            if ( serviceIdToNodesCache.containsKey( id ) ) {
                final PEPService pepService = new PEPService( XMPPServer.getInstance(), jid );
                pepService.initialize();

                // The JDBC variant stores subscriptions in the database. The in-memory variant cannot rely on this.
                // Subscriptions have to be repopulated from the roster instead.
                XMPPServer.getInstance().getIQPEPHandler().addSubscriptionForRosterItems( pepService );

                return pepService;
            } else {
                return null;
            }
        } finally {
            lock.unlock();
        }
    }
Cache that holds all published items (mapped by node ID).
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/InMemoryPubSubPersistenceProvider.java