org.apache.abdera.protocol.server.adapters.couchdb
Class CouchDbAdapter

java.lang.Object
  extended by org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
      extended by org.apache.abdera.protocol.server.provider.managed.ManagedCollectionAdapter
          extended by org.apache.abdera.protocol.server.adapters.couchdb.CouchDbAdapter
All Implemented Interfaces:
CollectionAdapter, CollectionInfo, MediaCollectionAdapter, Transactional

public class CouchDbAdapter
extends ManagedCollectionAdapter

The CouchDB Adapter uses a CouchDB database as the backend storage for an Atompub Collection. As an extension of the ManagedCollectionAdapter class, the Adapter is intended to be used with implementations of the ManagedProvider and are configured using /abdera/adapter/*.properties files. By default, the CouchDbAdapter assumes that CouchDB is running on localhost on port 5984. The host name and port can be changed by setting the couchdb.host and couchdb.port values in the Adapter instance *.properties file. The Adapter uses the Abdera Atom-to-JSON converter to store Collection entries as JSON documents in a CouchDB database.


Field Summary
 
Fields inherited from class org.apache.abdera.protocol.server.provider.managed.ManagedCollectionAdapter
abdera, config
 
Constructor Summary
CouchDbAdapter(Abdera abdera, FeedConfiguration config)
           
CouchDbAdapter(Abdera abdera, FeedConfiguration config, String host, int port)
           
 
Method Summary
 ResponseContext deleteEntry(RequestContext request)
          Delete an entry from the collection
 ResponseContext extensionRequest(RequestContext request)
          Any request that is not covered by the postEntry, deleteEntry, etc methods will be passed on to the extensionRequest method.
 ResponseContext getCategories(RequestContext request)
          Get an Atompub Categories document
 ResponseContext getEntry(RequestContext request)
          Get an entry from the collection
 ResponseContext getFeed(RequestContext request)
          Get the collections Atom feed document
 ResponseContext postEntry(RequestContext request)
          Post a new entry to the collection
 ResponseContext putEntry(RequestContext request)
          Update an existing entry
 
Methods inherited from class org.apache.abdera.protocol.server.provider.managed.ManagedCollectionAdapter
getAbdera, getAuthor, getConfiguration, getId, getTitle
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
asCollectionElement, buildCreateEntryResponse, buildGetEntryResponse, buildGetFeedResponse, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, deleteMedia, end, getAccepts, getCategoriesInfo, getEntryFromRequest, getHref, getHref, getMedia, getResourceName, headEntry, headMedia, optionsEntry, optionsMedia, postMedia, putMedia, setHref, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.protocol.server.CollectionAdapter
headEntry, optionsEntry
 

Constructor Detail

CouchDbAdapter

public CouchDbAdapter(Abdera abdera,
                      FeedConfiguration config)

CouchDbAdapter

public CouchDbAdapter(Abdera abdera,
                      FeedConfiguration config,
                      String host,
                      int port)
Method Detail

getFeed

public ResponseContext getFeed(RequestContext request)
Description copied from interface: CollectionAdapter
Get the collections Atom feed document


deleteEntry

public ResponseContext deleteEntry(RequestContext request)
Description copied from interface: CollectionAdapter
Delete an entry from the collection


postEntry

public ResponseContext postEntry(RequestContext request)
Description copied from interface: CollectionAdapter
Post a new entry to the collection


getEntry

public ResponseContext getEntry(RequestContext request)
Description copied from interface: CollectionAdapter
Get an entry from the collection


putEntry

public ResponseContext putEntry(RequestContext request)
Description copied from interface: CollectionAdapter
Update an existing entry


getCategories

public ResponseContext getCategories(RequestContext request)
Description copied from interface: CollectionAdapter
Get an Atompub Categories document

Specified by:
getCategories in interface CollectionAdapter
Overrides:
getCategories in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

extensionRequest

public ResponseContext extensionRequest(RequestContext request)
Description copied from interface: CollectionAdapter
Any request that is not covered by the postEntry, deleteEntry, etc methods will be passed on to the extensionRequest method. This provides an Adapter with the ability to support Atompub protocol extensions.

Specified by:
extensionRequest in interface CollectionAdapter
Overrides:
extensionRequest in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.