|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.gdata.storage.lucenestorage.StorageModifier
public class StorageModifier
The StorageModifier is the a Singleton component of the LuceneStorage. There
is one single instance of this class modifying the index used to store all
the gdata Entities as Entries, Feeds and Users. This class contains an
instance of IndexModifier
used to manage all
delete and add actions to the storage.
To prevent the storage component from opening and closing the
IndexModifier
for every modifying operation
the incoming entry actions (DELETE, UPDATE, INSERT) will be buffered in a
registered instance of
StorageBuffer
. When a
certain amout (specified as the persistfactor in the configuration file) of
modifications have been executed the StorageModifier will persist the
buffered entries.
Feed and User operations won't be buffered. These actions occure not very often compared to entry actions. Every call of an user / feed modifying operation forces all changes to be written to the storage index.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
protected |
StorageModifier(StorageCoreController controller,
IndexModifier modifier,
StorageBuffer buffer,
int persitsFactor,
int optimizeInterval)
Creates a new StorageModifier |
Method Summary | |
---|---|
protected void |
close()
|
void |
createAccount(StorageAccountWrapper account)
Adds a new accountr to the storage. |
void |
createFeed(StorageFeedWrapper wrapper)
Adds a new Feed to the storage. |
void |
deleteAccount(String accountName)
Deletes the user with the given username. |
void |
deleteEntry(StorageEntryWrapper wrapper)
Deletes the entry for the given entry id. |
void |
deleteFeed(String feedId)
Deletes the feed with the given feed id Feed action will be not buffered. |
void |
forceWrite()
Persists all changes imediately |
void |
insertEntry(StorageEntryWrapper wrapper)
Inserts a new Entry to the Lucene index storage |
void |
updateAccount(StorageAccountWrapper user)
User action will be not buffered. |
void |
updateEntry(StorageEntryWrapper wrapper)
Updates the given entry. |
void |
updateFeed(StorageFeedWrapper wrapper)
Feed action will be not buffered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
protected StorageModifier(StorageCoreController controller, IndexModifier modifier, StorageBuffer buffer, int persitsFactor, int optimizeInterval)
controller
- -
the registered StorageControllermodifier
- -
the IndexModifierbuffer
- -
the StorageBufferpersitsFactor
- -
the factor when the changes will be persisted to the storage
indexoptimizeInterval
- -
after how many storage operations the index will be optimizedMethod Detail |
---|
public void updateEntry(StorageEntryWrapper wrapper) throws StorageException
wrapper
- -
the wrapper containing the entry
StorageException
- -
if the entry can not be storedpublic void insertEntry(StorageEntryWrapper wrapper) throws StorageException
wrapper
- -
the wrapper containing the entry
StorageException
- -
if the entry can not be storedpublic void deleteEntry(StorageEntryWrapper wrapper) throws StorageException
wrapper
- - the wrapper containing the information to delete
StorageException
- -
if the entry can not be deletedpublic void createFeed(StorageFeedWrapper wrapper) throws StorageException
wrapper
- -
the wrapper containing the feed;
StorageException
- -
if the feed can not be writtenpublic void createAccount(StorageAccountWrapper account) throws StorageException
account
- -the wrapper containig the user to be persisted
StorageException
- -
if the user can not be persisted.public void deleteAccount(String accountName) throws StorageException
accountName
- -
the user to be deleted
StorageException
- -
If the user could not be deletedpublic void updateAccount(StorageAccountWrapper user) throws StorageException
user
- -the wrapper containig the user to be persisted
StorageException
- -
if the user can not be persisted.public void updateFeed(StorageFeedWrapper wrapper) throws StorageException
wrapper
- -
the wrapper containig the feed
StorageException
- -
if the feed can not be persistedpublic void deleteFeed(String feedId) throws StorageException
feedId
- -
the id of the feed to delete
StorageException
- -
if the feed can not be deletedpublic void forceWrite() throws IOException
IOException
- -- if an IO Exception occuresprotected void close() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |