org.wso2.registry.app
Class RegistryAdapter

java.lang.Object
  extended by org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
      extended by org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
          extended by org.wso2.registry.app.RegistryAdapter
All Implemented Interfaces:
org.apache.abdera.protocol.server.CollectionAdapter, org.apache.abdera.protocol.server.CollectionInfo, org.apache.abdera.protocol.server.MediaCollectionAdapter, org.apache.abdera.protocol.server.Transactional

public class RegistryAdapter
extends org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>


Nested Class Summary
 class RegistryAdapter.Resourcerator
           
 
Constructor Summary
RegistryAdapter(RegistryResolver resolver, EmbeddedRegistry embeddedRegistry)
           
 
Method Summary
protected  java.lang.String addEntryDetails(org.apache.abdera.protocol.server.RequestContext request, org.apache.abdera.model.Entry e, org.apache.abdera.i18n.iri.IRI feedIri, Resource entryObj)
           
protected  void addFeedDetails(org.apache.abdera.model.Feed feed, org.apache.abdera.protocol.server.RequestContext request)
           
protected  java.lang.String addMediaContent(org.apache.abdera.i18n.iri.IRI feedIri, org.apache.abdera.model.Entry entry, Resource entryObj, org.apache.abdera.protocol.server.RequestContext request)
           
 void deleteEntry(java.lang.String resourceName, org.apache.abdera.protocol.server.RequestContext request)
           
 org.apache.abdera.protocol.server.ResponseContext extensionRequest(org.apache.abdera.protocol.server.RequestContext request)
          Handle anything out of the ordinary Abdera-supported world.
 java.lang.String getAuthor(org.apache.abdera.protocol.server.RequestContext request)
           
 java.util.List<org.apache.abdera.model.Person> getAuthors(Resource entry, org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.Object getContent(Resource entry, org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getContentType(Resource entry)
           
 java.lang.Iterable<Resource> getEntries(org.apache.abdera.protocol.server.RequestContext request)
           
 Resource getEntry(java.lang.String resourceName, org.apache.abdera.protocol.server.RequestContext request)
           
protected  java.lang.String getFeedIriForEntry(Resource entryObj, org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getId(org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getId(Resource entry)
           
protected  java.lang.String getLink(Resource entryObj, org.apache.abdera.i18n.iri.IRI feedIri, org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getMediaName(Resource entry)
           
 java.io.InputStream getMediaStream(Resource entry)
           
 java.lang.String getName(Resource entry)
           
 org.apache.abdera.model.Text getSummary(Resource entry, org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getTitle(org.apache.abdera.protocol.server.RequestContext request)
           
 java.lang.String getTitle(Resource entry)
           
 java.util.Date getUpdated(Resource entry)
           
 boolean isMediaEntry(Resource entry)
           
static java.util.Map<java.lang.String,java.lang.String> parseQueryString(java.lang.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)
           
 Resource postEntry(java.lang.String title, org.apache.abdera.i18n.iri.IRI id, java.lang.String summary, java.util.Date updated, java.util.List<org.apache.abdera.model.Person> authors, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request)
           
 org.apache.abdera.protocol.server.ResponseContext postFeed(org.apache.abdera.protocol.server.RequestContext request)
           
 Resource postMedia(javax.activation.MimeType mimeType, java.lang.String slug, java.io.InputStream inputStream, org.apache.abdera.protocol.server.RequestContext request)
           
 org.apache.abdera.protocol.server.ResponseContext putEntry(org.apache.abdera.protocol.server.RequestContext request)
           
 void putEntry(Resource entry, java.lang.String title, java.util.Date updated, java.util.List<org.apache.abdera.model.Person> authors, java.lang.String summary, org.apache.abdera.model.Content content, org.apache.abdera.protocol.server.RequestContext request)
           
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter
addContent, buildGetMediaResponse, createMediaEntry, createNonMediaEntry, deleteEntry, deleteMedia, deleteMedia, getEntry, getEntryFromCollectionProvider, getFeed, getLink, getMedia, getQueryParameters, headEntry, headMedia, postMedia, putMedia, putMedia
 
Methods inherited from class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
asCollectionElement, buildCreateEntryResponse, buildGetEntryResponse, buildGetFeedResponse, buildHeadEntryResponse, buildPostMediaEntryResponse, compensate, createErrorResponse, createFeedBase, end, 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

RegistryAdapter

public RegistryAdapter(RegistryResolver resolver,
                       EmbeddedRegistry embeddedRegistry)
                throws RegistryException
Throws:
RegistryException
Method Detail

extensionRequest

public org.apache.abdera.protocol.server.ResponseContext extensionRequest(org.apache.abdera.protocol.server.RequestContext request)
Handle anything out of the ordinary Abdera-supported world. This method basically acts as a clearing house for all of the Registry-specific URLs that result in special processing, like ...;tags or ...;comments, etc. The resolver will have already parsed the URL and matched it with a particular custom TargetType, so in here we switch control based on the TargetType to a metadata-processing routine.

Specified by:
extensionRequest in interface org.apache.abdera.protocol.server.CollectionAdapter
Overrides:
extensionRequest in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
Parameters:
request - the RequestContext containing all the relevant info
Returns:
a ResponseContext indicating the disposition of the request

parseQueryString

public static java.util.Map<java.lang.String,java.lang.String> parseQueryString(java.lang.String query)
Utility function to parse query string TODO: Isn't there a standard way to do this?

Parameters:
query - query string to parse
Returns:
a Map of name -> value for each parameter

postEntry

public org.apache.abdera.protocol.server.ResponseContext postEntry(org.apache.abdera.protocol.server.RequestContext request)
Specified by:
postEntry in interface org.apache.abdera.protocol.server.CollectionAdapter
Overrides:
postEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>

postFeed

public org.apache.abdera.protocol.server.ResponseContext postFeed(org.apache.abdera.protocol.server.RequestContext request)

postEntry

public Resource postEntry(java.lang.String title,
                          org.apache.abdera.i18n.iri.IRI id,
                          java.lang.String summary,
                          java.util.Date updated,
                          java.util.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
Specified by:
postEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

deleteEntry

public void deleteEntry(java.lang.String resourceName,
                        org.apache.abdera.protocol.server.RequestContext request)
                 throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
deleteEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

isMediaEntry

public boolean isMediaEntry(Resource entry)
                     throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
isMediaEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getContent

public java.lang.Object getContent(Resource entry,
                                   org.apache.abdera.protocol.server.RequestContext request)
                            throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getContent in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getLink

protected java.lang.String getLink(Resource entryObj,
                                   org.apache.abdera.i18n.iri.IRI feedIri,
                                   org.apache.abdera.protocol.server.RequestContext request)
                            throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
getLink in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

addEntryDetails

protected java.lang.String addEntryDetails(org.apache.abdera.protocol.server.RequestContext request,
                                           org.apache.abdera.model.Entry e,
                                           org.apache.abdera.i18n.iri.IRI feedIri,
                                           Resource entryObj)
                                    throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
addEntryDetails in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

addFeedDetails

protected void addFeedDetails(org.apache.abdera.model.Feed feed,
                              org.apache.abdera.protocol.server.RequestContext request)
                       throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
addFeedDetails in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getEntries

public java.lang.Iterable<Resource> getEntries(org.apache.abdera.protocol.server.RequestContext request)
                                        throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getEntries in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getEntry

public Resource getEntry(java.lang.String resourceName,
                         org.apache.abdera.protocol.server.RequestContext request)
                  throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getId

public java.lang.String getId(Resource entry)
                       throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getName

public java.lang.String getName(Resource entry)
                         throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getName in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getTitle

public java.lang.String getTitle(Resource entry)
                          throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getTitle in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getUpdated

public java.util.Date getUpdated(Resource entry)
                          throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getUpdated in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

putEntry

public org.apache.abdera.protocol.server.ResponseContext putEntry(org.apache.abdera.protocol.server.RequestContext request)
Specified by:
putEntry in interface org.apache.abdera.protocol.server.CollectionAdapter
Overrides:
putEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>

putEntry

public void putEntry(Resource entry,
                     java.lang.String title,
                     java.util.Date updated,
                     java.util.List<org.apache.abdera.model.Person> authors,
                     java.lang.String summary,
                     org.apache.abdera.model.Content content,
                     org.apache.abdera.protocol.server.RequestContext request)
              throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
putEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getAuthor

public java.lang.String getAuthor(org.apache.abdera.protocol.server.RequestContext request)
                           throws org.apache.abdera.protocol.server.context.ResponseContextException
Specified by:
getAuthor in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getAuthors

public java.util.List<org.apache.abdera.model.Person> getAuthors(Resource entry,
                                                                 org.apache.abdera.protocol.server.RequestContext request)
                                                          throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
getAuthors in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getId

public java.lang.String getId(org.apache.abdera.protocol.server.RequestContext request)
Specified by:
getId in class org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter

getTitle

public java.lang.String getTitle(org.apache.abdera.protocol.server.RequestContext request)

getSummary

public org.apache.abdera.model.Text getSummary(Resource entry,
                                               org.apache.abdera.protocol.server.RequestContext request)
                                        throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
getSummary in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

postMedia

public Resource postMedia(javax.activation.MimeType mimeType,
                          java.lang.String slug,
                          java.io.InputStream inputStream,
                          org.apache.abdera.protocol.server.RequestContext request)
                   throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
postMedia in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getContentType

public java.lang.String getContentType(Resource entry)
Overrides:
getContentType in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>

getMediaName

public java.lang.String getMediaName(Resource entry)
                              throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
getMediaName in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

addMediaContent

protected java.lang.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
Overrides:
addMediaContent in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getMediaStream

public java.io.InputStream getMediaStream(Resource entry)
                                   throws org.apache.abdera.protocol.server.context.ResponseContextException
Overrides:
getMediaStream in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>
Throws:
org.apache.abdera.protocol.server.context.ResponseContextException

getFeedIriForEntry

protected java.lang.String getFeedIriForEntry(Resource entryObj,
                                              org.apache.abdera.protocol.server.RequestContext request)
Overrides:
getFeedIriForEntry in class org.apache.abdera.protocol.server.impl.AbstractEntityCollectionAdapter<Resource>


Copyright © 2007 Apache Web Services Project. All Rights Reserved.