My favorites | Sign in
Google
                
Search
for
Updated Mar 10, 2009 by HContent
SourceCodeWalkthrough  
Introduction to the Google Feed Server source code

Source Code Walkthrough

Provides information about Google Feed Server components, how to build an adapter, Feed Server packages, and the request flow.


Contents


Overview

Google Feed Server:

  • Builds a server based on Apache's Abdera framework to handle the Atom Protocol.
  • Builds an extensible mechanism to convert data from any data source into an Atom feed without having to write code to handle the Atom Protocol details.
  • Separates the two concerns; Builds a server without dependencies between Atom Protocol handling and the mechanism for getting data into or out of the data sources.
  • Makes it easy and quick to add adapters for new data sources.

Google Feed Server Components


Building an Adapter

To build an adapter:

  1. Implement the Adapter Interface (Adapter.java). SampleAdapter.java is a reference adapter implementation that you can view while you write the adapter for your particular data source.
  2. Create an adapter properties file in the conf/feedserver/adapter/ folder. For example, this directory should contain the adapter properties files for JdbcAdapter and SampleAdapter.
  3. Make sure your adapter class is in the CLASSPATH, so that it can be loaded at runtime by the classloader.
  4. AbstractAdapter.java contains many of the common methods used by the adapters. This is still an evolving class. Put methods in this class that you find useful for other adapter writers.

Code Structure and a Mini Code Walkthrough

The sections that follow list important Feed Server packages, the parent folder, and the package contents.

Server Package

The com.google.feedserver.server package, which is under src/java/, contains:

Adapter Package

The com.google.feedserver.adapter package, which is under src/java/, contains all the code required to define adapter interfaces and common methods, to build new adapters AND two sample adapters. This package handles all data aspects of the Feed Server. This package is the most useful for server developers who write adapters for new data sources:

Jetty Package

The com.google.feedserver.Jetty package, which is under src/java/, contains the runtime main class to start the application on the Jetty server.

SQL Map Type Package

The com.google.sqlmap.type package, which is under src/java/, is used by the iBATIS mapping.


Request Flow

Incoming Request:

---» To the Abdera servlet.
---» To com.google.feedserver.server.FeedServerProvider.
----» Calls the corresponding adapter in com.google.feedserver.adapter to get and put data.


Sign in to add a comment