|
XBRLAPIA Java API for XBRL |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xbrlapi.data.BaseStoreImpl
org.xbrlapi.data.bdbxml.StoreImpl
public class StoreImpl
Implementation of the data store using the Oracle Berkeley Database. Note that this store implementation does not use the XML:DB API and so does not require a DBConnection implementation.
| Field Summary | |
|---|---|
com.sleepycat.dbxml.XmlContainer |
dataContainer
|
com.sleepycat.dbxml.XmlManager |
dataManager
|
| Fields inherited from class org.xbrlapi.data.BaseStoreImpl |
|---|
domImplementation, matcher, namespaceBindings, storeDOM |
| Constructor Summary | |
|---|---|
StoreImpl(String location,
String container)
This uses the default 1 GB cache size. |
|
StoreImpl(String location,
String container,
int cacheSize)
|
|
| Method Summary | ||
|---|---|---|
void |
addIndex(URI namespace,
String name,
String type)
|
|
void |
close()
The closure operation entails closing the XML container and the XML data manager that are used by the store. |
|
void |
delete()
Close and then delete the data store. |
|
boolean |
equals(Object obj)
|
|
int |
getSize()
|
|
|
getXMLResource(String index)
Retrieves an XML Resource from a data store. |
|
int |
hashCode()
|
|
boolean |
hasXMLResource(String index)
Test if a store contains a specific fragment, as identified by its index. |
|
void |
logIndexes()
Log information about all the indexes in the data store. |
|
void |
persist(XML xml)
Store a fragment. |
|
long |
queryCount(String query)
This method must be synchronised |
|
Set<String> |
queryForIndices(String query)
Run a query against the collection of all fragments in the store. |
|
Set<String> |
queryForStrings(String query)
Run a query that is required to return a sequence of strings. |
|
|
queryForXMLResources(String query)
Run a query against the collection of all fragments in the store. |
|
void |
remove(String index)
Remove a fragment from the underlying data structure. |
|
void |
remove(XML fragment)
Remove a XML resource from the underlying data structure. |
|
void |
sync()
Default implementation does nothing. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public transient com.sleepycat.dbxml.XmlManager dataManager
public transient com.sleepycat.dbxml.XmlContainer dataContainer
| Constructor Detail |
|---|
public StoreImpl(String location,
String container)
throws XBRLException
location - The location of the database (The path to where the database exists)container - The name of the container to hold the data in the store.
XBRLException
public StoreImpl(String location,
String container,
int cacheSize)
throws XBRLException
location - The location of the database (The path to where the database exists)container - The name of the container to hold the data in the store.cacheSize - The number of megabytes to use for the cache size.
XBRLException| Method Detail |
|---|
public void logIndexes()
public int getSize()
throws XBRLException
getSize in interface StoreXBRLException - if the number of fragments cannot be determined.Store.persist(XML)
public void close()
throws XBRLException
close in interface Storeclose in class BaseStoreImplXBRLExceptionStore.close()
public void delete()
throws XBRLException
Store
delete in interface StoreXBRLException - if the data store cannot be deleted.Store.delete()
public void persist(XML xml)
throws XBRLException
Store
persist in interface Storexml - The fragment to be added to the store.
XBRLException - if the fragment cannot be added to the store.Store.persist(XML)
public boolean hasXMLResource(String index)
throws XBRLException
Store
hasXMLResource in interface Storeindex - The index of the fragment to test for.
XBRLException - If the test cannot be conducted.Store.hasXMLResource(String)
public <F extends XML> F getXMLResource(String index)
throws XBRLException
Store
getXMLResource in interface Storeindex - The index of the XML resource.
XBRLException - if the XML resource cannot be retrieved.Store.getXMLResource(String)
public void remove(XML fragment)
throws XBRLException
Store
remove in interface Storeremove in class BaseStoreImplfragment - The XML resource to remove.
XBRLException - if the XML resource cannot be removed from the store.Store.remove(String)
public void remove(String index)
throws XBRLException
Store
remove in interface Storeindex - The index of the fragment to be removed from the DTS store.
XBRLException - if the fragment cannot be removed from the store.Store.remove(String)
public <F extends XML> List<F> queryForXMLResources(String query)
throws XBRLException
Store
queryForXMLResources in interface Storequery - The XQuery query to run against the set of fragments.
Any occurrences of the string #roots# in a query will be deemed to
be a marker for the root elements of the fragments in an XML database collection
and it will be substituted with the necessary
expression to identify those roots in the data store.
XBRLException - if the query cannot be executed.Store.queryForXMLResources(String)
public Set<String> queryForIndices(String query)
throws XBRLException
Store
queryForIndices in interface Storequery - The XQuery query to run against the set of fragments.
Any occurrences of the string #roots# in a query will be deemed to
be a marker for the root elements of the fragments in an XML database collection
and it will be substituted with the necessary
expression to identify those roots in the data store.
The query MUST return a sequence of XML resource metadata root elements
matching the query. Otherwise, results from the query will be unpredictable.
XBRLException - if the query cannot be executed.Store.queryForIndices(String)
public Set<String> queryForStrings(String query)
throws XBRLException
Store
queryForStrings in interface Storequery - The XQuery query to run against the set of fragments.
Any occurrences of the string #roots# in a query will be deemed to
be a marker for the root elements of the fragments in an XML database collection
and it will be substituted with the necessary
expression to identify those roots in the data store.
XBRLException - if the query cannot be executed or if the
query results are not strings.Store.queryForStrings(String)
public long queryCount(String query)
throws XBRLException
Store
queryCount in interface Storequery - The XQuery to run.
Any occurrences of the string #roots# in a query will be deemed to
be a marker for the root elements of the fragments in an XML database collection
and it will be substituted with the necessary
expression to identify those roots in the data store.
XBRLException - if the query cannot be executed.Store.queryCount(String)
public void sync()
throws XBRLException
BaseStoreImpl
sync in interface Storesync in class BaseStoreImplXBRLException - if the sync operation fails.Store.sync()
public void addIndex(URI namespace,
String name,
String type)
throws XBRLException
namespace - The namespace of the node to index or null if the node does not have a namespace.name - The local name of the node to index.type - The index type. See the Oracle Berkeley DB documentation for details on what strings to use.
XBRLExceptionpublic int hashCode()
hashCode in class BaseStoreImplObject.hashCode()public boolean equals(Object obj)
equals in class BaseStoreImplObject.equals(java.lang.Object)public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||