Class RssNewsFeed
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- net.sf.basedb.clients.web.servlet.RssNewsFeed
-
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
public class RssNewsFeed extends HttpServlet
A servlet that generates a RSS feed from the public news on the BASE server.- Since:
- 2.17
- Author:
- nicklas
- See Also:
- Serialized Form
- Last modified
- $Date $
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
cachedRssNews
private String
contextPath
private static boolean
enabled
private String
host
private static Date
lastReset
private static long
lastUpdate
private SessionControl
sc
private static long
serialVersionUID
private Charset
utf8
-
Constructor Summary
Constructors Constructor Description RssNewsFeed()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(HttpServletRequest request, HttpServletResponse response)
private String
getNewsFeed(String rootUrl, boolean debug)
Generate the XML string for the news feed.void
init()
static boolean
isEnabled()
Check if the rss servlet has been enabled or not.static void
reset()
Reset the feed and force it to regenerate it's content.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
lastUpdate
private static long lastUpdate
-
lastReset
private static Date lastReset
-
enabled
private static boolean enabled
-
host
private String host
-
contextPath
private String contextPath
-
utf8
private Charset utf8
-
sc
private SessionControl sc
-
cachedRssNews
private byte[] cachedRssNews
-
-
Method Detail
-
reset
public static void reset()
Reset the feed and force it to regenerate it's content. It is recommended that this method is called whenever a news items is added or modified. If not, the cache will expire sooner or later in any case.
-
isEnabled
public static boolean isEnabled()
Check if the rss servlet has been enabled or not.
-
init
public void init() throws ServletException
- Overrides:
init
in classGenericServlet
- Throws:
ServletException
-
doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doGet
in classHttpServlet
- Throws:
ServletException
IOException
-
-