public class RegistryAdapter extends org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Constructor and Description |
---|
RegistryAdapter()
Default constructor
|
RegistryAdapter(RegistryResolver resolver,
EmbeddedRegistryService embeddedRegistryService)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected String |
addEntryDetails(org.apache.abdera.protocol.server.RequestContext request,
org.apache.abdera.model.Entry entry,
org.apache.abdera.i18n.iri.IRI feedIri,
Resource entryObj)
Method to add entry details.
|
protected void |
addFeedDetails(org.apache.abdera.model.Feed feed,
org.apache.abdera.protocol.server.RequestContext request)
Method to add feed details.
|
protected String |
addMediaContent(org.apache.abdera.i18n.iri.IRI feedIri,
org.apache.abdera.model.Entry entry,
Resource entryObj,
org.apache.abdera.protocol.server.RequestContext request)
Method to add media content.
|
protected org.apache.abdera.protocol.server.ResponseContext |
buildGetEntryResponse(org.apache.abdera.protocol.server.RequestContext request,
org.apache.abdera.model.Entry entry)
Method to build a get entry response.
|
protected org.apache.abdera.protocol.server.ResponseContext |
buildGetFeedResponse(org.apache.abdera.model.Feed feed)
Method to build a get feed response.
|
void |
deleteEntry(String resourceName,
org.apache.abdera.protocol.server.RequestContext request)
Method to delete an entry from the collection.
|
org.apache.abdera.protocol.server.ResponseContext |
extensionRequest(org.apache.abdera.protocol.server.RequestContext request)
Handle anything out of the ordinary Abdera-supported world.
|
String |
getAuthor(org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the primary author for an entry.
|
List<org.apache.abdera.model.Person> |
getAuthors(Resource entry,
org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the list of authors for an entry.
|
Object |
getContent(Resource entry,
org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the resource content.
|
String |
getContentType(Resource entry)
Method to obtain the content type of an entry.
|
Iterable<Resource> |
getEntries(org.apache.abdera.protocol.server.RequestContext request)
Method to get an iterator of entries.
|
Resource |
getEntry(String resourceName,
org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the resource from the request.
|
protected String |
getFeedIriForEntry(Resource entryObj,
org.apache.abdera.protocol.server.RequestContext request)
Generates the feed IRI for the given entry.
|
String |
getId(org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the identifier for an entry.
|
String |
getId(Resource entry)
Method to obtain the unique identifier of a resource.
|
protected String |
getLink(Resource entryObj,
org.apache.abdera.i18n.iri.IRI feedIri,
org.apache.abdera.protocol.server.RequestContext requestContext)
Method to obtain the entry IRI link.
|
String |
getMediaName(Resource entry)
Method to obtain the media name.
|
InputStream |
getMediaStream(Resource entry)
Method to obtain an input stream for the given resource.
|
String |
getName(Resource entry)
Method to obtain the name of a resource.
|
org.apache.abdera.model.Text |
getSummary(Resource entry,
org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the summary for an entry.
|
String |
getTitle(org.apache.abdera.protocol.server.RequestContext request)
Method to obtain the title for an entry.
|
String |
getTitle(Resource entry)
Method to obtain the title of a resource.
|
Date |
getUpdated(Resource entry)
Method to obtain the updated time of a resource.
|
boolean |
isMediaEntry(Resource entry)
Method to determine whether the given resource is a media entry.
|
static Map<String,String> |
parseQueryString(String query)
Utility function to parse query string TODO: Isn't there a standard way to do this?
|
org.apache.abdera.protocol.server.ResponseContext |
postEntry(org.apache.abdera.protocol.server.RequestContext request)
Method to post an entry.
|
Resource |
postEntry(String title,
org.apache.abdera.i18n.iri.IRI id,
String summary,
Date updated,
List<org.apache.abdera.model.Person> authors,
org.apache.abdera.model.Content content,
org.apache.abdera.protocol.server.RequestContext request)
Method to post an entry to the collection.
|
org.apache.abdera.protocol.server.ResponseContext |
postFeed(org.apache.abdera.protocol.server.RequestContext request)
Method to post a feed.
|
Resource |
postMedia(MimeType mimeType,
String slug,
InputStream inputStream,
org.apache.abdera.protocol.server.RequestContext request)
Posts a new media entry.
|
org.apache.abdera.protocol.server.ResponseContext |
putEntry(org.apache.abdera.protocol.server.RequestContext request)
Method to add an entry to the collection.
|
void |
putEntry(Resource entry,
String title,
Date updated,
List<org.apache.abdera.model.Person> authors,
String summary,
org.apache.abdera.model.Content content,
org.apache.abdera.protocol.server.RequestContext request)
Method to add an entry to the collection.
|
addContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, deleteMedia, deleteMedia, getEntry, getEntryFromCollectionProvider, getFeed, getLink, getLink, getLink, getMedia, getQueryParameters, headEntry, headMedia, postMedia, putMedia, putMedia
asCollectionElement, buildCreateEntryResponse, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, end, getAccepts, getCategories, getCategoriesInfo, getEntryFromRequest, getHref, getHref, getResourceName, optionsEntry, optionsMedia, setHref, start
@Deprecated public RegistryAdapter(RegistryResolver resolver, EmbeddedRegistryService embeddedRegistryService) throws RegistryException
RegistryException
public RegistryAdapter()
public org.apache.abdera.protocol.server.ResponseContext extensionRequest(org.apache.abdera.protocol.server.RequestContext request)
extensionRequest
in interface org.apache.abdera.protocol.server.CollectionAdapter
extensionRequest
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
request
- the RequestContext containing all the relevant infopublic static Map<String,String> parseQueryString(String query)
query
- query string to parseprotected org.apache.abdera.protocol.server.ResponseContext buildGetEntryResponse(org.apache.abdera.protocol.server.RequestContext request, org.apache.abdera.model.Entry entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
buildGetEntryResponse
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
request
- the request context.entry
- the entryorg.apache.abdera.protocol.server.context.ResponseContextException
protected org.apache.abdera.protocol.server.ResponseContext buildGetFeedResponse(org.apache.abdera.model.Feed feed)
buildGetFeedResponse
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
feed
- the feed.public org.apache.abdera.protocol.server.ResponseContext postEntry(org.apache.abdera.protocol.server.RequestContext request)
postEntry
in interface org.apache.abdera.protocol.server.CollectionAdapter
postEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
request
- the request context.public org.apache.abdera.protocol.server.ResponseContext postFeed(org.apache.abdera.protocol.server.RequestContext request)
request
- the request context.public Resource postEntry(String title, org.apache.abdera.i18n.iri.IRI id, String summary, Date updated, List<org.apache.abdera.model.Person> authors, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
postEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
title
- the title of the entry.updated
- the updated time.authors
- the list of authors.summary
- the summary text.content
- the resource content.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public void deleteEntry(String resourceName, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
deleteEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
resourceName
- the resource name.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public boolean isMediaEntry(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
isMediaEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public Object getContent(Resource entry, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getContent
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
protected String getLink(Resource entryObj, org.apache.abdera.i18n.iri.IRI feedIri, org.apache.abdera.protocol.server.RequestContext requestContext) throws org.apache.abdera.protocol.server.context.ResponseContextException
getLink
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entryObj
- the entry object.feedIri
- the feed IRIrequestContext
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.protected String addEntryDetails(org.apache.abdera.protocol.server.RequestContext request, org.apache.abdera.model.Entry entry, org.apache.abdera.i18n.iri.IRI feedIri, Resource entryObj) throws org.apache.abdera.protocol.server.context.ResponseContextException
addEntryDetails
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the entry.feedIri
- the IRI of the feed.entryObj
- the resource.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.protected void addFeedDetails(org.apache.abdera.model.Feed feed, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
addFeedDetails
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
feed
- the feed.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public Iterable<Resource> getEntries(org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getEntries
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public Resource getEntry(String resourceName, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
resourceName
- the resource name.request
- the request.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getId(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getId
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getName(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getName
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getTitle(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getTitle
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public Date getUpdated(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getUpdated
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public org.apache.abdera.protocol.server.ResponseContext putEntry(org.apache.abdera.protocol.server.RequestContext request)
putEntry
in interface org.apache.abdera.protocol.server.CollectionAdapter
putEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
request
- the request context.public void putEntry(Resource entry, String title, Date updated, List<org.apache.abdera.model.Person> authors, String summary, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
putEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource to add.title
- the title of the entry.updated
- the updated time.authors
- the list of authors.summary
- the summary text.content
- the resource content.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getAuthor(org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getAuthor
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
public List<org.apache.abdera.model.Person> getAuthors(Resource entry, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getAuthors
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource entry.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getId(org.apache.abdera.protocol.server.RequestContext request)
getId
in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
request
- the request context.public String getTitle(org.apache.abdera.protocol.server.RequestContext request)
request
- the request context.public org.apache.abdera.model.Text getSummary(Resource entry, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
getSummary
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource entry.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public Resource postMedia(MimeType mimeType, String slug, InputStream inputStream, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
postMedia
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
mimeType
- the MIME type of the content.slug
- the slug as a String.inputStream
- the content stream.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.public String getContentType(Resource entry)
getContentType
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the entry.public String getMediaName(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getMediaName
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource (media entry).org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.protected String addMediaContent(org.apache.abdera.i18n.iri.IRI feedIri, org.apache.abdera.model.Entry entry, Resource entryObj, org.apache.abdera.protocol.server.RequestContext request) throws org.apache.abdera.protocol.server.context.ResponseContextException
addMediaContent
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
feedIri
- the feed IRI.entry
- the entry.entryObj
- the resource object.request
- the request context.org.apache.abdera.protocol.server.context.ResponseContextException
public InputStream getMediaStream(Resource entry) throws org.apache.abdera.protocol.server.context.ResponseContextException
getMediaStream
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entry
- the resource entry.org.apache.abdera.protocol.server.context.ResponseContextException
- if the operation failed.protected String getFeedIriForEntry(Resource entryObj, org.apache.abdera.protocol.server.RequestContext request)
getFeedIriForEntry
in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
entryObj
- the entry object.request
- the request context.Copyright © 2016 WSO2 Inc. All Rights Reserved.