|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
public abstract class AbstractCollectionAdapter
Base CollectionAdapter implementation that provides a number of helper utility methods for adapter implementations.
| Constructor Summary | |
|---|---|
AbstractCollectionAdapter()
|
|
| Method Summary | |
|---|---|
Collection |
asCollectionElement(RequestContext request)
Converts this to an instance of the FOM Collection interface |
protected ResponseContext |
buildCreateEntryResponse(String link,
Entry entry)
Creates the ResponseContext for a newly created entry. |
protected ResponseContext |
buildGetEntryResponse(RequestContext request,
Entry entry)
Creates the ResponseContext for a GET entry request. |
protected ResponseContext |
buildGetFeedResponse(Feed feed)
Creates the ResponseContext for a GET feed request. |
protected ResponseContext |
buildHeadEntryResponse(RequestContext request,
String id,
Date updated)
Creates the ResponseContext for a HEAD entry request. |
protected ResponseContext |
buildPostMediaEntryResponse(String link,
Entry entry)
Creates the ResponseContext for a newly created entry. |
void |
compensate(RequestContext request,
Throwable t)
Called by the provider when a processing error occurs |
protected ResponseContext |
createErrorResponse(ResponseContextException e)
Create a ResponseContext (or take it from the Exception) for an exception that occurred in the application. |
protected Feed |
createFeedBase(RequestContext request)
Create the base feed for the requested collection. |
ResponseContext |
deleteMedia(RequestContext request)
Delete a media resource from the collection |
void |
end(RequestContext request,
ResponseContext response)
Called by the provider after dispatching the request to the adapter |
ResponseContext |
extensionRequest(RequestContext request)
Any request that is not covered by the postEntry, deleteEntry, etc methods will be passed on to the extensionRequest method. |
String[] |
getAccepts(RequestContext request)
Returns an array of MIME media types for the app:collection element's app:accept elements. |
abstract String |
getAuthor(RequestContext request)
|
ResponseContext |
getCategories(RequestContext request)
Get an Atompub Categories document |
CategoriesInfo[] |
getCategoriesInfo(RequestContext request)
Return the collection of CategoriesInfo objects for the app:collection element's app:categories elements. |
protected Entry |
getEntryFromRequest(RequestContext request)
Retrieves the FOM Entry object from the request payload. |
String |
getHref()
|
String |
getHref(RequestContext request)
Get the value of the app:collection element's href attribute. |
abstract String |
getId(RequestContext request)
|
ResponseContext |
getMedia(RequestContext request)
Get a media resource |
protected String |
getResourceName(RequestContext request)
Get's the name of the specific resource requested |
ResponseContext |
headEntry(RequestContext request)
Get metadata for an entry from the collection |
ResponseContext |
headMedia(RequestContext request)
Get metdata for a media resource |
ResponseContext |
optionsEntry(RequestContext request)
Get options for an entry from the collection |
ResponseContext |
optionsMedia(RequestContext request)
Get a media resource's options. |
ResponseContext |
postMedia(RequestContext request)
Add a new media resource to the collection, resulting in the creation of a new Media Link Entry. |
ResponseContext |
putMedia(RequestContext request)
Update a media resource |
void |
setHref(String href)
|
void |
start(RequestContext request)
Called by the provider before dispatching the request to the adapter |
| 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 |
|---|
deleteEntry, getEntry, getFeed, postEntry, putEntry |
| Methods inherited from interface org.apache.abdera.protocol.server.CollectionInfo |
|---|
getTitle |
| Constructor Detail |
|---|
public AbstractCollectionAdapter()
| Method Detail |
|---|
public String getHref()
public void setHref(String href)
public String getHref(RequestContext request)
CollectionInfo
getHref in interface CollectionInfo
public void compensate(RequestContext request,
Throwable t)
Transactional
compensate in interface Transactional
public void end(RequestContext request,
ResponseContext response)
Transactional
end in interface Transactional
public void start(RequestContext request)
throws ResponseContextException
Transactional
start in interface TransactionalResponseContextExceptionpublic String[] getAccepts(RequestContext request)
CollectionInfo
getAccepts in interface CollectionInfopublic CategoriesInfo[] getCategoriesInfo(RequestContext request)
CollectionInfo
getCategoriesInfo in interface CollectionInfopublic ResponseContext getCategories(RequestContext request)
CollectionAdapter
getCategories in interface CollectionAdapterpublic ResponseContext deleteMedia(RequestContext request)
MediaCollectionAdapter
deleteMedia in interface MediaCollectionAdapterpublic ResponseContext getMedia(RequestContext request)
MediaCollectionAdapter
getMedia in interface MediaCollectionAdapterpublic ResponseContext headMedia(RequestContext request)
MediaCollectionAdapter
headMedia in interface MediaCollectionAdapterpublic ResponseContext optionsMedia(RequestContext request)
MediaCollectionAdapter
optionsMedia in interface MediaCollectionAdapterpublic ResponseContext putMedia(RequestContext request)
MediaCollectionAdapter
putMedia in interface MediaCollectionAdapterpublic ResponseContext postMedia(RequestContext request)
MediaCollectionAdapter
postMedia in interface MediaCollectionAdapterpublic ResponseContext headEntry(RequestContext request)
CollectionAdapter
headEntry in interface CollectionAdapterpublic ResponseContext optionsEntry(RequestContext request)
CollectionAdapter
optionsEntry in interface CollectionAdapter
public abstract String getAuthor(RequestContext request)
throws ResponseContextException
ResponseContextExceptionpublic abstract String getId(RequestContext request)
protected ResponseContext buildCreateEntryResponse(String link,
Entry entry)
protected ResponseContext buildPostMediaEntryResponse(String link,
Entry entry)
protected ResponseContext buildGetEntryResponse(RequestContext request,
Entry entry)
throws ResponseContextException
ResponseContextException
protected ResponseContext buildHeadEntryResponse(RequestContext request,
String id,
Date updated)
throws ResponseContextException
ResponseContextExceptionprotected ResponseContext buildGetFeedResponse(Feed feed)
protected ResponseContext createErrorResponse(ResponseContextException e)
e -
protected Feed createFeedBase(RequestContext request)
throws ResponseContextException
ResponseContextException
protected Entry getEntryFromRequest(RequestContext request)
throws ResponseContextException
ResponseContextExceptionprotected String getResourceName(RequestContext request)
public ResponseContext extensionRequest(RequestContext request)
CollectionAdapter
extensionRequest in interface CollectionAdapterpublic Collection asCollectionElement(RequestContext request)
CollectionInfo
asCollectionElement in interface CollectionInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||