org.apache.lucene.gdata.server
Class GDataService

java.lang.Object
  extended by org.apache.lucene.gdata.server.GDataService
All Implemented Interfaces:
Service
Direct Known Subclasses:
GDataAdminService, GDataSearchService

public class GDataService
extends Object
implements Service

default implementation of the Service interface.

Author:
Simon Willnauer

Field Summary
protected  EntryEventMediator entryEventMediator
           
protected  GDataServerRegistry registry
           
protected  Storage storage
           
 
Constructor Summary
protected GDataService()
           
 
Method Summary
 void close()
          will close the Service - service should not be used after this method has been called
 com.google.gdata.data.BaseEntry createEntry(GDataRequest request, GDataResponse response)
          Service method to create an entry in an already created and existing feed.
 com.google.gdata.data.BaseEntry deleteEntry(GDataRequest request, GDataResponse response)
          Service Method to delete an entry specified in the given FeedRequest.
protected  void dynamicElementFeedStragey(com.google.gdata.data.BaseFeed feed, GDataRequest request)
           
protected  com.google.gdata.data.DateTime getCurrentDateTime()
           
 Date getEntryLastModified(String entryId, String feedId)
          Retruns the date of the last modification for the given entry id
 com.google.gdata.data.BaseFeed getFeed(GDataRequest request, GDataResponse response)
          Service method to retrieve a requested Feed.
 Date getFeedLastModified(String feedId)
          Retruns the date of the last modification for the given feed id
 com.google.gdata.data.BaseEntry getSingleEntry(GDataRequest request, GDataResponse response)
          Service method to retrieve a requested entry.
 com.google.gdata.data.BaseEntry updateEntry(GDataRequest request, GDataResponse response)
          Service method to update an existing entry in a existing feed context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storage

protected Storage storage

registry

protected GDataServerRegistry registry

entryEventMediator

protected final EntryEventMediator entryEventMediator
Constructor Detail

GDataService

protected GDataService()
                throws ServiceException
Throws:
ServiceException
Method Detail

createEntry

public com.google.gdata.data.BaseEntry createEntry(GDataRequest request,
                                                   GDataResponse response)
                                            throws ServiceException
Description copied from interface: Service
Service method to create an entry in an already created and existing feed. This method will create the entry and passes the entry to the indexing component to make the new entry accessable via get-queries. The response and the corresponding http status code will be added to the given FeedResponse.

Specified by:
createEntry in interface Service
Parameters:
request - - the current FeedRequest
response - - the current FeedResponse
Returns:
- the entry which has been created
Throws:
ServiceException - - if the corresponding feed does not exist or the storage can not be accessed
See Also:
Service.createEntry(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)

deleteEntry

public com.google.gdata.data.BaseEntry deleteEntry(GDataRequest request,
                                                   GDataResponse response)
                                            throws ServiceException
Description copied from interface: Service
Service Method to delete an entry specified in the given FeedRequest. This method will remove the entry permanently. There will be no possiblity to restore the entry. The response and the corresponding http status code will be added to the given FeedResponse.

Specified by:
deleteEntry in interface Service
Parameters:
request - - the current FeedRequest
response - - the current FeedResponse
Returns:
- the entry wich has been deleted
Throws:
ServiceException - - if the entry does not exist or the storage can not be accessed
See Also:
Service.deleteEntry(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)

updateEntry

public com.google.gdata.data.BaseEntry updateEntry(GDataRequest request,
                                                   GDataResponse response)
                                            throws ServiceException
Description copied from interface: Service
Service method to update an existing entry in a existing feed context. The entry version will be checked and a ServiceException will be thrown if the version to update is outdated. The new entry will be passed to the indexing component to make the version accessable via get-queries.

Specified by:
updateEntry in interface Service
Parameters:
request - - the current FeedRequest
response - - the current FeedResponse
Returns:
- the entry wich has been updated
Throws:
ServiceException - - if the corresponding feed does not exist, the storage can not be accessed or the version to update is out of date.
See Also:
Service.updateEntry(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)

getFeed

public com.google.gdata.data.BaseFeed getFeed(GDataRequest request,
                                              GDataResponse response)
                                       throws ServiceException
Description copied from interface: Service
Service method to retrieve a requested Feed. The feed will also be added to the given FeedResponse instance and can also be accessed via the FeedResponse object.

Specified by:
getFeed in interface Service
Parameters:
request - - the current FeedRequest
response - - the current FeedResponse
Returns:
- the requested feed
Throws:
ServiceException - - If the storage can not be accessed or the requested feed does not exist.
See Also:
Service.getFeed(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)

getSingleEntry

public com.google.gdata.data.BaseEntry getSingleEntry(GDataRequest request,
                                                      GDataResponse response)
                                               throws ServiceException
Description copied from interface: Service
Service method to retrieve a requested entry. The entry will also be added to the given FeedResponse instance and can also be accessed via the FeedResponse object.

Specified by:
getSingleEntry in interface Service
Parameters:
request - - the current FeedRequest
response - - the current FeedResponse
Returns:
- the requested entry
Throws:
ServiceException - - If the storage can not be accessed or the requested entry does not exist.
See Also:
Service.getSingleEntry(org.apache.lucene.gdata.server.GDataRequest, org.apache.lucene.gdata.server.GDataResponse)

dynamicElementFeedStragey

protected void dynamicElementFeedStragey(com.google.gdata.data.BaseFeed feed,
                                         GDataRequest request)

close

public void close()
Description copied from interface: Service
will close the Service - service should not be used after this method has been called

Specified by:
close in interface Service
See Also:
Service.close()

getFeedLastModified

public Date getFeedLastModified(String feedId)
                         throws ServiceException
Description copied from interface: Service
Retruns the date of the last modification for the given feed id

Specified by:
getFeedLastModified in interface Service
Parameters:
feedId - - the id of the feed
Returns:
- the last modified date or the current date if the date can not be retrieved
Throws:
ServiceException - - if the storage can not be accessed
See Also:
Service.getFeedLastModified(java.lang.String)

getEntryLastModified

public Date getEntryLastModified(String entryId,
                                 String feedId)
                          throws ServiceException
Description copied from interface: Service
Retruns the date of the last modification for the given entry id

Specified by:
getEntryLastModified in interface Service
Parameters:
entryId - - the id of the entry
feedId - - the feed id this entry belongs to
Returns:
- the last modified date or the current date if the date can not be retrieved
Throws:
ServiceException - - if the storage can not be accessed
See Also:
Service.getEntryLastModified(java.lang.String, java.lang.String)

getCurrentDateTime

protected com.google.gdata.data.DateTime getCurrentDateTime()


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.