org.apache.lucene.gdata.server
Interface Service

All Known Subinterfaces:
AdminService
All Known Implementing Classes:
GDataAdminService, GDataSearchService, GDataService

public interface Service

The Service class represents an interface to access the GData service componentes of the GData-Server. It encapsulates all interactions with the GData client.

This class provides the base level common functionality required to access the GData components. It is also designed to act as a base class that can be extended for specific types of underlaying server components as different indexing or storage components.

It could also encapsulate caching mechanismn build on top of the storage to reduce load on the storage component

Author:
Simon Willnauer

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.
 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.
 

Method Detail

createEntry

com.google.gdata.data.BaseEntry createEntry(GDataRequest request,
                                            GDataResponse response)
                                            throws ServiceException
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.

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

deleteEntry

com.google.gdata.data.BaseEntry deleteEntry(GDataRequest request,
                                            GDataResponse response)
                                            throws ServiceException
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.

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

updateEntry

com.google.gdata.data.BaseEntry updateEntry(GDataRequest request,
                                            GDataResponse response)
                                            throws ServiceException
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.

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.

getFeed

com.google.gdata.data.BaseFeed getFeed(GDataRequest request,
                                       GDataResponse response)
                                       throws ServiceException
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.

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.

getSingleEntry

com.google.gdata.data.BaseEntry getSingleEntry(GDataRequest request,
                                               GDataResponse response)
                                               throws ServiceException
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.

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.

close

void close()
will close the Service - service should not be used after this method has been called


getFeedLastModified

Date getFeedLastModified(String feedId)
                         throws ServiceException
Retruns the date of the last modification for the given feed id

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

getEntryLastModified

Date getEntryLastModified(String entryId,
                          String feedId)
                          throws ServiceException
Retruns the date of the last modification for the given entry id

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


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