org.figure8.join.control
Class FeedServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.figure8.join.control.FeedServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FeedServlet
extends javax.servlet.http.HttpServlet

This a servlet endpoint for news feed generation and distribution. Each request may contain 2 parameters : type may specify the format of syndication feed wanted by client (rss_0.9, rss_1.0, rss_2.0 and atom_0.3 are currently supported), release may contain the name of release to filter news for.

Version:
$Revision: 1.1 $
Author:
Laurent Broudoux
See Also:
Serialized Form

Field Summary
static java.lang.String COULD_NOT_GENERATE_FEED_ERROR
          Constant for error message returned to client
static java.lang.String DEFAULT_TYPE
          Constant for the default feed type (RSS 2.0)
static java.lang.String FEED_TYPE_PARAM
          Constant denoting the request parameter specifying the type of feed to generate.
static java.lang.String RELEASE_PARAM
          Constant denoting the request parameter specifying the release for whom feed should be generated.
 
Constructor Summary
FeedServlet()
           
 
Method Summary
protected  com.sun.syndication.feed.synd.SyndFeed createFeed(java.util.List messages)
          Create a feed using a list of messages.
protected  com.sun.syndication.feed.synd.SyndEntry createFeedEntry(Message message)
          Create a feed entry from a message.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Generate and render a syndication feed depending on request parameters (type and release).
protected  void initializeManagers()
          Retrieve the integration process and reporting managers if they have not been initialized yet.
 
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, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEED_TYPE_PARAM

public static final java.lang.String FEED_TYPE_PARAM
Constant denoting the request parameter specifying the type of feed to generate.

See Also:
Constant Field Values

RELEASE_PARAM

public static final java.lang.String RELEASE_PARAM
Constant denoting the request parameter specifying the release for whom feed should be generated.

See Also:
Constant Field Values

DEFAULT_TYPE

public static final java.lang.String DEFAULT_TYPE
Constant for the default feed type (RSS 2.0)

See Also:
Constant Field Values

COULD_NOT_GENERATE_FEED_ERROR

public static final java.lang.String COULD_NOT_GENERATE_FEED_ERROR
Constant for error message returned to client

See Also:
Constant Field Values
Constructor Detail

FeedServlet

public FeedServlet()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException
Generate and render a syndication feed depending on request parameters (type and release). See this class Javadoc for more details.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The Http request wrapper
response - The Http response wrapper
Throws:
java.io.IOException - if something wrong occurs during writing of response stream

initializeManagers

protected void initializeManagers()
                           throws InvalidParameterException
Retrieve the integration process and reporting managers if they have not been initialized yet.

Throws:
InvalidParameterException - if they cannot be retrieved

createFeed

protected com.sun.syndication.feed.synd.SyndFeed createFeed(java.util.List messages)
                                                     throws com.sun.syndication.io.FeedException
Create a feed using a list of messages.

Parameters:
messages - A list of Messages
Returns:
A SyndicationFeed corresponding to messages.
Throws:
com.sun.syndication.io.FeedException

createFeedEntry

protected com.sun.syndication.feed.synd.SyndEntry createFeedEntry(Message message)
                                                           throws com.sun.syndication.io.FeedException
Create a feed entry from a message.

Parameters:
message - Message to use for creating entry
Returns:
A Syndication feed entry
Throws:
com.sun.syndication.io.FeedException


Copyright © 2005-2008 Join. All Rights Reserved.