public void readSizeForAllUsers() {
        // See if the size is cached.
        sizeCache.clear();

        int size = 0;
        String username = null;
        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(SELECT_SIZE_OFFLINE_ALL_USERS);

            rs = pstmt.executeQuery();
            while (rs.next()) {
                size = rs.getInt(1);
                username = rs.getString(2);
                // Add the value to cache.
                sizeCache.put(username, size);
            }
        }
        catch (Exception e) {
            Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
        }
        finally {
            DbConnectionManager.closeConnection(rs, pstmt, con);
        }
    }
Decide whether a message should be stored offline according to XEP-0160 and XEP-0334.

@param message The message to evaluate. Cannot be null.
@return <code>true</code> if the message should be stored offline, <code>false</code> otherwise.
xmppserver/src/main/java/org/jivesoftware/openfire/OfflineMessageStore.java