|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.gdata.storage.lucenestorage.StorageQuery
public class StorageQuery
StorageQuery wraps a Lucene IndexSearcher
and a StorageBuffer
to
perform all request on the lucene storage. The wrapped components are thread -
safe.
An instance of this class will serve all client requests. To obtain the
current instance of the StorageQuery
the method
StorageCoreController.getStorageQuery()
has to be invoked. This method will release the current StorageQuery.
IndexSearcher
,
StorageCoreController
,
StorageBuffer
Constructor Summary | |
---|---|
protected |
StorageQuery(StorageBuffer buffer,
Searcher searcher)
Creates a new StorageQuery |
Method Summary | |
---|---|
protected boolean |
checkEntryVersion(String id,
String feedId,
int version)
|
void |
close()
Closes all resources used in the StorageQuery . |
List<com.google.gdata.data.BaseEntry> |
entryQuery(List<String> entryIds,
String feedId,
ProvidedService config)
Fetches the requested entries from the storage. |
String |
getAccountNameForFeedId(String feedId)
Looks up the account reference for the given feed id |
protected long |
getEntryLastModified(String entryId,
String feedId)
|
protected long |
getFeedLastModified(String feedId)
|
com.google.gdata.data.BaseFeed |
getLatestFeedQuery(String feedId,
int resultCount,
int startIndex,
ProvidedService config)
This method fetches the latest feed entries from the storage. |
String |
getService(String feedID)
Looks up the feed type for the given feed ID |
GDataAccount |
getUser(String username)
Queries the storage for an user instance |
protected boolean |
isEntryStored(String entryId,
String feedId)
|
boolean |
isFeedStored(String feedId)
Checks whether a feed for the given feedID is stored |
com.google.gdata.data.BaseEntry |
singleEntryQuery(String entryId,
String feedId,
ProvidedService config)
This method retrieves a single entry from the storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected StorageQuery(StorageBuffer buffer, Searcher searcher)
buffer
- -
the buffer instance to get the buffered inserts, updates from.searcher
- -
the searcher instance to use to query the storage index.Method Detail |
---|
public com.google.gdata.data.BaseFeed getLatestFeedQuery(String feedId, int resultCount, int startIndex, ProvidedService config) throws IOException, com.google.gdata.util.ParseException
The REST interface requests all the entries from a Storage. The Storage
retrieves the entries corresponding to the parameters specified. This
method first requests the latest entries or updated entries from the
StorageBuffer
. If the buffer already contains enough entries
for the the specified result count the entries will be returned. If not,
the underlying lucene index will be searcher for all documents of the
specified feed sorted by storing timestamp desc.
The entries will be searched in a feed context specified by the given feed ID
feedId
- -
the requested feed, this id will be used to retrieve the
entries.resultCount
- -
how many entries are requestedstartIndex
- -
the offset of the entry to start from.config
- -
the FeedInstanceConfiguration containing extension profile used
to create the entry instances
BaseEntry
objects, or an empty list
if no entries could be found
IOException
- -
if the index could not be queries or the entries could not be
build
com.google.gdata.util.ParseException
- -
if an entry could not be parsed while building it from the
Lucene Document.public com.google.gdata.data.BaseEntry singleEntryQuery(String entryId, String feedId, ProvidedService config) throws IOException, com.google.gdata.util.ParseException
StorageBuffer
does not contain the requested entry the
underlying storage index will be searched.
The Entry will be searched in a feed context specified by the given feed ID
entryId
- -
the entry to fetchfeedId
- -
the feed id e.g. feed contextconfig
- -
the FeedInstanceConfiguration containing extension profile used
to create the entry instances
BaseEntry
or null
if the
entry can not be found
IOException
- -
if the index could not be queries or the entries could not be
build
com.google.gdata.util.ParseException
- -
if an entry could not be parsed while building it from the
Lucene Document.public List<com.google.gdata.data.BaseEntry> entryQuery(List<String> entryIds, String feedId, ProvidedService config) throws IOException, com.google.gdata.util.ParseException
StorageBuffer
will be queried for the entry id's. If not all of the entries remain in
the buffer the underlying lucene index will be searched. The entries are
not guaranteed to be in the same order as they are in the given id list.
Entry ID's not found in the index or the buffer will be omitted.
The entries will be searched in a feed context specified by the given feed ID
entryIds
- -
the entry id's to fetch.feedId
- -
the feed id e.g. feed context.config
- -
the FeedInstanceConfiguration containing extension profile used
to create the entry instances
IOException
- -
if the index could not be queries or the entries could not be
build
com.google.gdata.util.ParseException
- -
if an entry could not be parsed while building it from the
Lucene Document.public GDataAccount getUser(String username) throws IOException
username
- -
the username (primary key)
null
if not exists
IOException
- -
if the storage can not be accessed.public void close() throws IOException
StorageQuery
. The instance can
not be reused after invoking this method.
IOException
- -
if the resources can not be closedpublic boolean isFeedStored(String feedId) throws IOException
feedId
- -
the feed ID
true
if and only if a feed is stored for the
provided feed ID, false
if no feed for the given
id is stored
IOException
public String getService(String feedID) throws IOException
feedID
- -
the feed ID
IOException
- -
if the storage can not be accessedpublic String getAccountNameForFeedId(String feedId) throws IOException
feedId
- -
id of the feed
null
if the feed is not stored
IOException
- -
if the storage can not be accessedprotected long getEntryLastModified(String entryId, String feedId) throws IOException, StorageException
IOException
StorageException
protected long getFeedLastModified(String feedId) throws IOException
IOException
protected boolean isEntryStored(String entryId, String feedId) throws IOException
IOException
protected boolean checkEntryVersion(String id, String feedId, int version) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |