org.apache.abdera.examples.appserver.employee
Class EmployeeCollectionAdapter

java.lang.Object
  extended by org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
      extended by org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
          extended by org.apache.abdera.examples.appserver.employee.EmployeeCollectionAdapter
All Implemented Interfaces:
CollectionAdapter, CollectionInfo, MediaCollectionAdapter, Transactional

public class EmployeeCollectionAdapter
extends org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>


Constructor Summary
EmployeeCollectionAdapter()
           
 
Method Summary
 void deleteEntry(String resourceName, RequestContext request)
          Delete an entry
 String getAuthor(RequestContext request)
          The author of this collection.
 List<Person> getAuthors(Employee entry, RequestContext request)
          Get the authors for an entry.
 Object getContent(Employee entry, RequestContext request)
          Get the content for the entry.
 Iterable<Employee> getEntries(RequestContext request)
          Get the listing of entries requested
 Employee getEntry(String resourceName, RequestContext request)
          Get a specific entry
 String getId(Employee entry)
          Gets the UUID for the specified entry.
 String getId(RequestContext request)
          A unique ID for this feed.
 String getName(Employee entry)
          Get the name of the entry resource (used to construct links)
 String getTitle(Employee entry)
          Get the title fo the entry
 String getTitle(RequestContext request)
          The title of our collection.
 Date getUpdated(Employee entry)
          Get the value to use in the atom:updated element
 Employee postEntry(String title, IRI id, String summary, Date updated, List<Person> authors, Content content, RequestContext request)
          Create a new entry
 void putEntry(Employee employee, String title, Date updated, List<Person> authors, String summary, Content content, RequestContext request)
          Update an entry.
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
addContent, addEntryDetails, addFeedDetails, addMediaContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, deleteMedia, deleteMedia, getContentType, getEntry, getEntryFromCollectionProvider, getFeed, getFeedIriForEntry, getLink, getLink, getLink, getLink, getMedia, getMediaName, getMediaStream, getQueryParameters, getSummary, headEntry, headMedia, isMediaEntry, postEntry, postMedia, postMedia, putEntry, putMedia, putMedia
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
asCollectionElement, buildCreateEntryResponse, buildGetEntryResponse, buildGetFeedResponse, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, end, extensionRequest, getAccepts, getCategories, getCategoriesInfo, getEntryFromRequest, getHref, getHref, getResourceName, optionsEntry, optionsMedia, setHref, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmployeeCollectionAdapter

public EmployeeCollectionAdapter()
Method Detail

getId

public String getId(RequestContext request)
A unique ID for this feed.

Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

getTitle

public String getTitle(RequestContext request)
The title of our collection.


getAuthor

public String getAuthor(RequestContext request)
The author of this collection.

Specified by:
getAuthor in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

getEntries

public Iterable<Employee> getEntries(RequestContext request)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the listing of entries requested

Specified by:
getEntries in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>

getEntry

public Employee getEntry(String resourceName,
                         RequestContext request)
                  throws ResponseContextException
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get a specific entry

Specified by:
getEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Parameters:
resourceName - The entry to get
request - The request context
Throws:
ResponseContextException

getName

public String getName(Employee entry)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the name of the entry resource (used to construct links)

Specified by:
getName in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>

getId

public String getId(Employee entry)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Gets the UUID for the specified entry.

Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Returns:

getTitle

public String getTitle(Employee entry)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the title fo the entry

Specified by:
getTitle in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>

getUpdated

public Date getUpdated(Employee entry)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the value to use in the atom:updated element

Specified by:
getUpdated in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>

getAuthors

public List<Person> getAuthors(Employee entry,
                               RequestContext request)
                        throws ResponseContextException
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the authors for an entry. By default this returns null. Implementations must override in order to providing a listing of authors for an entry

Overrides:
getAuthors in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Throws:
ResponseContextException

getContent

public Object getContent(Employee entry,
                         RequestContext request)
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Get the content for the entry.

Specified by:
getContent in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>

postEntry

public Employee postEntry(String title,
                          IRI id,
                          String summary,
                          Date updated,
                          List<Person> authors,
                          Content content,
                          RequestContext request)
                   throws ResponseContextException
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Create a new entry

Specified by:
postEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Parameters:
title - The title of the entry (assumes that type="text")
id - The value of the atom:id element
summary - The summary of the entry
updated - The value of the atom:updated element
authors - Listing of atom:author elements
request - The request context
Throws:
ResponseContextException

putEntry

public void putEntry(Employee employee,
                     String title,
                     Date updated,
                     List<Person> authors,
                     String summary,
                     Content content,
                     RequestContext request)
              throws ResponseContextException
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Update an entry.

Specified by:
putEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Parameters:
employee - The entry to update
title - The new title of the entry
updated - The new value of atom:updated
authors - To new listing of authors
summary - The new summary
content - The new content
request - The request context
Throws:
ResponseContextException

deleteEntry

public void deleteEntry(String resourceName,
                        RequestContext request)
                 throws ResponseContextException
Description copied from class: org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
Delete an entry

Specified by:
deleteEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Employee>
Parameters:
resourceName - The entry to delete
request - The request context
Throws:
ResponseContextException


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