class BlogPostServlet extends HttpServlet {

    public static final SystemProperty<Boolean> ENABLED = SystemProperty.Builder.ofType(Boolean.class)
        .setKey("rss.enabled")
        .setDynamic(true)
        .setDefaultValue(true)
        .addListener((b) -> lastRSSFetch = Instant.EPOCH)
        .build();

    public static final SystemProperty<String> URL = SystemProperty.Builder.ofType(String.class)
        .setKey("rss.url")
        .setDynamic(true)
        .setDefaultValue("https://discourse.igniterealtime.org/c/blogs/ignite-realtime-blogs.rss")
        .addListener((b) -> lastRSSFetch = Instant.EPOCH)
        .build();

    public static final SystemProperty<Duration> REFRESH = SystemProperty.Builder.ofType(Duration.class)
        .setKey("rss.refresh")
        .setDynamic(true)
        .setDefaultValue(Duration.ofHours(6))
        .setChronoUnit(ChronoUnit.MINUTES)
        .addListener((b) -> lastRSSFetch = Instant.EPOCH)
        .build();

    private static final Logger Log = LoggerFactory.getLogger(BlogPostServlet.class);
    private static Instant lastRSSFetch = Instant.EPOCH;
    private JSONArray lastItems = null;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        synchronized (this) {
            if (lastItems == null || Duration.between(lastRSSFetch, Instant.now()).compareTo(REFRESH.getDefaultValue()) > 0) {
                Log.debug("Trying to obtain latest blog posts from IgniteRealtime.org");

                final String proxyHost = UpdateManager.PROXY_HOST.getValue();
                final int proxyPort = UpdateManager.PROXY_PORT.getValue();

                final HttpRoutePlanner routePlanner;
                if (proxyHost != null && !proxyHost.isEmpty() && proxyPort > 0) {
                    routePlanner = new DefaultProxyRoutePlanner(new HttpHost(proxyHost, proxyPort, "http"));
                } else {
                    routePlanner = new DefaultRoutePlanner(null);
                }
                final HttpGet httpGet = new HttpGet(URL.getValue());

                try (final CloseableHttpClient client = HttpClients.custom().setRoutePlanner(routePlanner).build();
                     final CloseableHttpResponse httpResponse = client.execute(httpGet);
                     final InputStream stream = httpResponse.getEntity().getContent()) {

                    lastItems = parseFirstEntries(stream, 7);
                    lastRSSFetch = Instant.now();
                } catch (final Throwable throwable) {
                    Log.warn("Unable to download blogposts from igniterealtime.org", throwable);
                }
            }
        }

        final JSONObject result = new JSONObject();
        result.put("items", lastItems);

        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        response.getWriter().write(result.toString(2));
    }

    /**
     * Parses the input stream, expected to contain RSS data, into the proprietary format used by the admin console.
     *
     * @param inputStream An input stream of RSS data
     * @param count The maximum number of items to return.
     * @return A collection or RSS items.
     */
    static JSONArray parseFirstEntries(final InputStream inputStream, final int count) throws ExecutionException, InterruptedException
    {<FILL_FUNCTION_BODY>}
}

        final SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.ENGLISH);

        final JSONArray result = new JSONArray();

        final Document document = SAXReaderUtil.readDocument(inputStream);
        final List<Node> nodes = document.selectNodes("/rss/channel/item");
        for (final Node node : nodes) {
            if (!(node instanceof Element)) {
                continue;
            }

            try {
                final Element item = (Element) node;

                final JSONObject o = new JSONObject();
                o.put("link", item.elementText("link"));
                o.put("title", item.elementText("title"));
                o.put("date", JiveGlobals.formatDate(dateFormat.parse(item.elementText("pubDate"))));
                result.put(o);
            } catch (Exception e) {
                Log.debug("Unable to parse element as RSS data: {}", node.asXML(), e);
            }

            if (result.length() >= count) {
                break;
            }
        }
        return result;
    
<no_super_class>