|
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.exist.StoreImpl
public class StoreImpl
Implementation of the XBRL data store using eXist as the underlying database.
| Field Summary | |
|---|---|
protected static String |
configurationRoot
|
| Fields inherited from class org.xbrlapi.data.BaseStoreImpl |
|---|
domImplementation, matcher, namespaceBindings, storeDOM |
| Constructor Summary | |
|---|---|
StoreImpl(String host,
String port,
String database,
String username,
String password,
String storeParentPath,
String dataCollectionName)
Initialise the database connection. |
|
| Method Summary | ||
|---|---|---|
void |
close()
Close the data store. |
|
void |
delete()
Close and then delete the data store. |
|
DBConnection |
getConnection()
|
|
int |
getSize()
|
|
|
getXMLResource(String index)
Retrieves a fragment from an XBRL API data store. |
|
boolean |
hasXMLResource(String index)
Test if a store contains a specific fragment, as identified by its index. |
|
void |
persist(XML xml)
Add a fragment to the DTS. |
|
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 DTS. |
|
void |
remove(XML xml)
Remove a XML resource from the underlying data structure. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String configurationRoot
| Constructor Detail |
|---|
public StoreImpl(String host,
String port,
String database,
String username,
String password,
String storeParentPath,
String dataCollectionName)
throws XBRLException
host - Host DB server IP address or domain nameport - Host DB server portdatabase - Database nameusername - Username of the database userpassword - Password of the database userstoreParentPath - The full path to the container collection, which is the
collection that will hold the data collection when it are created.dataCollectionName - The name of the data collection.
XBRLException| Method Detail |
|---|
public DBConnection getConnection()
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 int getSize()
throws XBRLException
getSize in interface StoreXBRLException - if the number of fragments cannot be determined.Store.persist(XML)
public void persist(XML xml)
throws XBRLException
persist in interface Storexml - The fragment to be added to the DTS store.
XBRLException - if the fragment cannot be added to the store
(eg: because one with the same index is already in the store).
public boolean hasXMLResource(String index)
throws XBRLException
hasXMLResource in interface Storeindex - The index of the fragment to test for.
XBRLException - If the test cannot be conducted.
public <F extends XML> F getXMLResource(String index)
throws XBRLException
getXMLResource in interface Storeindex - The index of the fragment.
XBRLException - if the fragment cannot be retrieved.
public void remove(String index)
throws XBRLException
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.
public void remove(XML xml)
throws XBRLException
Store
remove in interface Storeremove in class BaseStoreImplxml - The XML resource to remove.
XBRLException - if the XML resource cannot be removed from the store.Store.remove(XML)
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 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 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 String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||