|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface XNodeStoreProvider
An interface for the backing storage for an XNodeStore.
The XNode Implementation (the package org.ceryle.xnode.*, both its source code and documentation), are released under the Apache 2.0 License. For more details, check the LICENSE file contained with the distribution, or see The Ceryle Project for more information. It is distributed with no warranty.
| Method Summary | |
|---|---|
void |
closeDatabase(String did)
Close the Database backing the XNodeCollection having ID did. |
void |
deleteContent(String did,
String rid)
Permanently deletes the key/data pair (database record) matching the key String rid from the Database with ID did. |
void |
deleteDatabase(String did)
Delete the Database backing the XNodeCollection having ID did. |
String |
getContent(String did,
String rid)
The method that does the actual work of retrieving the contents in the record with key String rid (record ID) from the Database with ID did. |
int |
getContentSize(String did,
String rid)
Returns the record storage size of the document in the Database with ID did for the data matching the key String rid (record ID). |
Object |
getDatabase(String did)
Return the Database backing the XNodeCollection having ID did. |
List |
getDatabaseIndex()
Returns the List of existing Database IDs. |
List |
getDocumentIndex(String did)
Returns the document index for the Database with key did, sorted, created from the Database. |
boolean |
hasContent(String did,
String rid)
Returns true if the Database with ID did contains data matching the key String rid (record ID). |
boolean |
hasDatabase(String did)
Returns true if there is an existing Database with key did. |
void |
initialize(XNodeStore xnodestore)
Initializes the XNodeStoreProvider provided its parent XNodeStore. |
boolean |
isLoadedDatabase(String did)
Returns true if the Database with key did has already been loaded. |
void |
optimize(ActionListener listener)
Using any native processes, optimizes the Database. |
void |
putContent(String did,
String rid,
String content,
boolean overwrite)
The method that does the actual work of storing the String content in the Database db using the key String rid (record ID). |
void |
start()
Start the database service. |
void |
stop()
Shuts down the database service. |
boolean |
storageExists()
Temporary method (do not rely on its longevity). |
void |
writeXNodeToDatabase(XNode xnode,
XNodeCollection collection,
boolean overwrite)
Writes the provided XNode to the XNodeCollection's Database using the XNode's ID as the key. |
| Method Detail |
|---|
boolean storageExists()
void initialize(XNodeStore xnodestore)
throws XNodeStoreProviderException
xnodestore - the parent XNodeStore.
XNodeStoreProviderException - if any error occurs while initializing the provider.
void start()
throws XNodeStoreProviderException
XNodeStoreProviderException - if unable to start the database.
void stop()
throws XNodeStoreProviderException
XNodeStoreProviderException - if an error occurs while stopping the database.boolean isLoadedDatabase(String did)
Object getDatabase(String did)
throws XNodeStoreProviderException
The returned Object will necessarily be implementation-dependent and is likely be of no use outside the implementing class. Implementations are free to return a null value if returning a value is inappropriate or introduces a security or other issue.
did - the ID of the Database
XNodeStoreProviderException - if any error occurs while getting or creating the Database.
boolean hasDatabase(String did)
throws XNodeStoreProviderException
did - the ID of the Database to query.
XNodeStoreProviderException - if any error occurs while querying.
List getDatabaseIndex()
throws XNodeStoreProviderException
XNodeStoreProviderException - if any error occurs while building the index.
void closeDatabase(String did)
throws XNodeStoreProviderException
did - the ID of the Database to close.
XNodeStoreProviderException - if any error occurs while closing the Database.
void deleteDatabase(String did)
throws XNodeStoreProviderException
did - the ID of the Database to delete.
XNodeStoreProviderException - if any error occurs while deleting the Database.
void putContent(String did,
String rid,
String content,
boolean overwrite)
throws XNodeStoreProviderException
did - the ID of the Databaserid - the ID of the recordcontent - the content String.overwrite - when true permit the overwrite of previous content.
XNodeStoreProviderException - if any error occurs while putting the content into the Database.
boolean hasContent(String did,
String rid)
throws XNodeStoreProviderException
did - the ID of the Databaserid - the ID of the record
XNodeStoreProviderException - if an error occurs retrieving the content.
int getContentSize(String did,
String rid)
hasContent(String,String)
since it does basically the same function but returns a more useful value.
This returns -1 if either of the parameters is null, if the collection or
document doesn't exist, and returns a -2 if any error occurs, rather than
throwing an exception.
did - the ID of the Databaserid - the ID of the record
String getContent(String did,
String rid)
throws XNodeStoreProviderException
did - the ID of the Databaserid - the ID of the record
XNodeStoreProviderException - if an error occurs retrieving the content.
void deleteContent(String did,
String rid)
throws XNodeStoreProviderException
did - the ID of the Databaserid - the ID of the record
XNodeStoreProviderException - if an error occurs deleting the key/data pair.
List getDocumentIndex(String did)
throws XNodeStoreProviderException
did - the database ID
XNodeStoreProviderException - if an error occurs obtaining the document index.
void writeXNodeToDatabase(XNode xnode,
XNodeCollection collection,
boolean overwrite)
throws XNodeStoreProviderException
xnode - the XNode to write.collection - the XNodeCollection.overwrite - when true permit the overwrite of previous content.
XNodeStoreProviderException - if an error occurs deleting writing the XNode.void optimize(ActionListener listener)
If the optional ActionListener is provided its
ActionListener.actionPerformed(ActionEvent)
method will be called upon completion of the optimization.
listener - an optional listener to receive
notification upon completion.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||