    protected void getRssDocument(final String uri)
            throws Exception {
        if (log.isDebugEnabled())
            log.debug("Starting getRssDocument()");
        RssCacheDao dao = new RssCacheDao();
        RssCacheTo rss;
        InputStreamReader ir;
        StringBuffer sbx = new StringBuffer();
        BufferedReader buff;
        final java.util.GregorianCalendar calendarg = new java.util.GregorianCalendar();
        rss = dao.view(uri);
        if (rss != null && rss.getUri() != null && rss.getUri().length() > 10) {
            if (log.isDebugEnabled())
                log.debug("Record found with uri: " + uri);
            DateTimeBean dt = rss.getLastUpdated();
            if (dt.getDay() != calendarg.get(java.util.Calendar.DATE)) {
                if (log.isDebugEnabled())
                    log.debug("getRssDocument() Day doesn't match: " + uri);
                u = new URL(uri);
                ir = new InputStreamReader(u.openStream(), "UTF-8");
                buff = new BufferedReader(ir);
                String input;
                while ((input = buff.readLine()) != null) {
                    sbx.append(StringUtil.replace(input, '\'', "\\\'"));
                }
                buff.close();
                rss.setContent(sbx.toString());
                dao.update(rss);
            } else {
                if (log.isDebugEnabled())
                    log.debug("Hit end.. no date change.");
            }
        } else {
            if (log.isDebugEnabled())
                log.debug("Fetch uri: " + uri);
            rss = new RssCacheTo();
            u = new URL(uri);
            ir = new InputStreamReader(u.openStream(), "UTF-8");
            buff = new BufferedReader(ir);
            String input;
            while ((input = buff.readLine()) != null) {
                sbx.append(StringUtil.replace(input, '\'', "\\\'"));
            }
            buff.close();
            log.debug(sbx.toString());
            try {
                rss.setUri(uri);
                rss.setInterval(24);
                rss.setContent(sbx.toString());
                dao.add(rss);
            } catch (java.lang.NullPointerException n) {
                if (log.isDebugEnabled())
                    log.debug("Null pointer exception creating/adding rss cache object to db.");
            }
        }
        if (log.isDebugEnabled())
            log.debug("getRssDocument() Retrieved uri from database: " + uri);
        log.debug(sbx.toString());
        StringReader sr = new StringReader(rss.getContent());
        org.xml.sax.InputSource saxy = new org.xml.sax.InputSource(sr);
        builder = factory.newDocumentBuilder();
        document = builder.parse(saxy);
        if (log.isDebugEnabled())
            log.debug("Hit end of getRssDocument() for " + uri);
    }

    protected void getRssDocument(final String uri)
            throws Exception {
        if (log.isDebugEnabled())
            log.debug("Starting getRssDocument()");
        RssCacheDao dao = new RssCacheDao();
        RssCacheTo rss;
        InputStreamReader ir;
        StringBuffer sbx = new StringBuffer();
        BufferedReader buff;
        final java.util.GregorianCalendar calendarg = new java.util.GregorianCalendar();
        rss = dao.view(uri);
        if (rss != null && rss.getUri() != null && rss.getUri().length() > 10) {
            if (log.isDebugEnabled())
                log.debug("Record found with uri: " + uri);
            DateTimeBean dt = rss.getLastUpdated();
            if (dt.getDay() != calendarg.get(java.util.Calendar.DATE)) {
                if (log.isDebugEnabled())
                    log.debug("getRssDocument() Day doesn't match: " + uri);
                u = new URL(uri);
                ir = new InputStreamReader(u.openStream(), "UTF-8");
                buff = new BufferedReader(ir);
                String input;
                while ((input = buff.readLine()) != null) {
                    sbx.append(StringUtil.replace(input, '\'', "\\\'"));
                }
                buff.close();
                rss.setContent(sbx.toString().trim());
                if (rss.getContent().startsWith("<rss"))
                    rss.setContent("<?xml version=\"1.0\"?>\n");
                dao.update(rss);
            } else {
                if (log.isDebugEnabled())
                    log.debug("Hit end.. no date change.");
            }
        } else {
            if (log.isDebugEnabled())
                log.debug("Fetch uri: " + uri);
            rss = new RssCacheTo();
            u = new URL(uri);
            ir = new InputStreamReader(u.openStream(), "UTF-8");
            buff = new BufferedReader(ir);
            String input;
            while ((input = buff.readLine()) != null) {
                sbx.append(StringUtil.replace(input, '\'', "\\\'"));
            }
            buff.close();
            log.debug(sbx.toString());
            try {
                rss.setUri(uri);
                rss.setInterval(24);
                rss.setContent(sbx.toString().trim());
                if (rss.getContent().startsWith("<rss"))
                    rss.setContent("<?xml version=\"1.0\"?>\n");
                dao.add(rss);
            } catch (java.lang.NullPointerException n) {
                if (log.isDebugEnabled())
                    log.debug("Null pointer exception creating/adding rss cache object to db.");
            }
        }
        if (log.isDebugEnabled())
            log.debug("getRssDocument() Retrieved uri from database: " + uri);
        log.debug(sbx.toString());
        StringReader sr = new StringReader(rss.getContent());
        org.xml.sax.InputSource saxy = new org.xml.sax.InputSource(sr);
        builder = factory.newDocumentBuilder();
        document = builder.parse(saxy);
        if (log.isDebugEnabled())
            log.debug("Hit end of getRssDocument() for " + uri);
    }
