org.apache.abdera.protocol.server.provider.basic
Class BasicAdapter

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.provider.basic.BasicAdapter
All Implemented Interfaces:
CollectionAdapter, CollectionInfo, MediaCollectionAdapter, Transactional
Direct Known Subclasses:
IBatisCollectionAdapter

public abstract class BasicAdapter
extends ManagedCollectionAdapter

The BasicAdapter provides a simplistic interface for working with Atompub collections with a restricted set of options/features. The idea of the basic adapter is to make it easy to provide a minimally capable Atompub server


Field Summary
static Logger logger
           
 
Fields inherited from class org.apache.abdera.protocol.server.provider.managed.ManagedCollectionAdapter
abdera, config
 
Constructor Summary
protected BasicAdapter(Abdera abdera, FeedConfiguration config)
           
 
Method Summary
protected  void addEditLinkToEntry(Entry entry)
           
abstract  Entry createEntry(Entry entry)
           
protected  String createEntryIdUri(String entryId)
           
protected  Feed createFeed()
           
abstract  boolean deleteEntry(Object entryId)
           
 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
abstract  Entry getEntry(Object entryId)
           
 ResponseContext getEntry(RequestContext request)
          Get an entry from the collection
abstract  Feed getFeed()
           
 ResponseContext getFeed(RequestContext request)
          Get the collections Atom feed document
 String getProperty(String key)
           
 ResponseContext postEntry(RequestContext request)
          Post a new entry to the collection
 ResponseContext putEntry(RequestContext request)
          Update an existing entry
protected  void setEntryIdIfNull(Entry entry)
           
abstract  Entry updateEntry(Object entryId, Entry 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
 

Field Detail

logger

public static Logger logger
Constructor Detail

BasicAdapter

protected BasicAdapter(Abdera abdera,
                       FeedConfiguration config)
Method Detail

getProperty

public String getProperty(String key)
                   throws Exception
Throws:
Exception

createFeed

protected Feed createFeed()
                   throws Exception
Throws:
Exception

addEditLinkToEntry

protected void addEditLinkToEntry(Entry entry)
                           throws Exception
Throws:
Exception

setEntryIdIfNull

protected void setEntryIdIfNull(Entry entry)
                         throws Exception
Throws:
Exception

createEntryIdUri

protected String createEntryIdUri(String entryId)
                           throws Exception
Throws:
Exception

postEntry

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


deleteEntry

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


putEntry

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


getEntry

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


getFeed

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


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

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

getFeed

public abstract Feed getFeed()
                      throws Exception
Throws:
Exception

getEntry

public abstract Entry getEntry(Object entryId)
                        throws Exception
Throws:
Exception

createEntry

public abstract Entry createEntry(Entry entry)
                           throws Exception
Throws:
Exception

updateEntry

public abstract Entry updateEntry(Object entryId,
                                  Entry entry)
                           throws Exception
Throws:
Exception

deleteEntry

public abstract boolean deleteEntry(Object entryId)
                             throws Exception
Throws:
Exception


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