public class StoreImpl extends BaseStoreImpl implements Store
Constructor and Description |
---|
StoreImpl(java.lang.String database,
java.lang.String username,
java.lang.String password,
java.lang.String storeParentPath,
java.lang.String dataCollectionName)
Initialise the database connection.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the data store.
|
void |
delete()
Close and then delete the data store.
|
DBConnection |
getConnection() |
int |
getSize() |
<F extends XML> |
getXMLResource(java.lang.String index)
Retrieves a fragment from an XBRL API data store.
|
boolean |
hasXMLResource(java.lang.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(java.lang.String query)
This method must be synchronised
|
java.util.Set<java.lang.String> |
queryForIndices(java.lang.String query)
Run a query against the collection of all fragments in the store.
|
java.util.Set<java.lang.String> |
queryForStrings(java.lang.String query)
Run a query that is required to return a sequence of strings.
|
<F extends XML> |
queryForXMLResources(java.lang.String query)
Run a query against the collection of all fragments in the store.
|
void |
remove(java.lang.String index)
Remove a fragment from the DTS.
|
void |
remove(XML xml)
Remove a XML resource from the underlying data structure.
|
java.lang.String |
toString() |
augmentNetworkForFragment, augmentNetworksForFragment, clearFilteringURIs, deleteDocument, deleteRelatedDocuments, equals, getAllFactIndices, getAllFacts, getAllFacts, getAnalyser, getArcIndicesWithArcrole, getArcIndicesWithLinkIndex, getArcroles, getArcroles, getArcroleTypes, getArcroleTypes, getArcs, getArcs, getChildFragments, getChildFragments, getCompositeDocument, getConcept, getDocumentAsDOM, getDocumentsToDiscover, getDocumentURIs, getExtendedLinkIndices, getExtendedLinks, getFactIndices, getFacts, getFacts, getFacts, getFacts, getFilteringURIs, getFragmentIndices, getFragmentIndicesFromDocument, getFragmentIndicesFromDocument, getFragmentsFromDocument, getFragmentsFromDocument, getGlobalDeclaration, getId, getItems, getItems, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithResourceRole, getLanguage, getLanguageMap, getLanguages, getLinkRoles, getLinkRoles, getMatcher, getMinimalNetwork, getMinimalNetworksWithArcrole, getMinimalNetworksWithArcrole, getMinimumDocumentSet, getMinimumDocumentSet, getMissingDocumentURIs, getNetworkRoots, getNetworks, getNetworks, getNetworks, getNetworksFrom, getNetworksFrom, getNetworksFrom, getNetworksTo, getNetworksTo, getNetworksTo, getNumberOfXMLResources, getReferencedDocuments, getReferences, getReferences, getReferences, getReferencesWithLanguage, getReferencesWithResourceRole, getReferencingDocuments, getReferencingFragments, getRelationshipsFrom, getRelationshipsTo, getResourceRoles, getRoleTypes, getRoleTypes, getRootFragmentForDocument, getRootFragmentIndices, getRootFragments, getRootFragments, getSchema, getSchemaContent, getSourceIndices, getSources, getStoreAsDOM, getStubs, getStubs, getSubtree, getTargets, getTuples, getTuples, getXMLResources, getXMLResources, hasAllRelationships, hasDocument, hashCode, isFilteringByURIs, isLoading, isPersistingRelationships, persistLoaderState, persistStub, queryForString, recindLoadingRightsFor, removeNamespaceBinding, removeStub, requestLoadingRightsFor, saveDocuments, saveDocuments, saveStoreAsSingleDocument, serialize, serialize, serialize, setAnalyser, setFilteringURIs, setMatcher, setNamespaceBinding, startLoading, stopLoading, sync
augmentNetworkForFragment, augmentNetworksForFragment, clearFilteringURIs, deleteDocument, deleteRelatedDocuments, getAllFactIndices, getAllFacts, getAllFacts, getAnalyser, getArcIndicesWithArcrole, getArcIndicesWithLinkIndex, getArcroles, getArcroles, getArcroleTypes, getArcroleTypes, getArcs, getArcs, getChildFragments, getChildFragments, getCompositeDocument, getConcept, getDocumentAsDOM, getDocumentsToDiscover, getDocumentURIs, getExtendedLinkIndices, getExtendedLinks, getFactIndices, getFacts, getFacts, getFacts, getFacts, getFilteringURIs, getFragmentIndices, getFragmentIndicesFromDocument, getFragmentIndicesFromDocument, getFragmentsFromDocument, getFragmentsFromDocument, getGlobalDeclaration, getId, getItems, getItems, getLabels, getLabels, getLabels, getLabelsWithLanguage, getLabelsWithResourceRole, getLanguage, getLanguageMap, getLanguages, getLinkRoles, getLinkRoles, getMatcher, getMinimalNetwork, getMinimalNetworksWithArcrole, getMinimalNetworksWithArcrole, getMinimumDocumentSet, getMinimumDocumentSet, getMissingDocumentURIs, getNetworkRoots, getNetworks, getNetworks, getNetworks, getNetworksFrom, getNetworksFrom, getNetworksFrom, getNetworksTo, getNetworksTo, getNetworksTo, getNumberOfXMLResources, getReferencedDocuments, getReferences, getReferences, getReferences, getReferencesWithLanguage, getReferencesWithResourceRole, getReferencingDocuments, getReferencingFragments, getRelationshipsFrom, getRelationshipsTo, getResourceRoles, getRoleTypes, getRoleTypes, getRootFragmentForDocument, getRootFragmentIndices, getRootFragments, getRootFragments, getSchema, getSchemaContent, getSourceIndices, getSources, getStoreAsDOM, getStubs, getStubs, getSubtree, getTargets, getTuples, getTuples, getXMLResources, getXMLResources, hasAllRelationships, hasDocument, isFilteringByURIs, isLoading, isPersistingRelationships, persistLoaderState, persistStub, queryForString, recindLoadingRightsFor, removeNamespaceBinding, removeStub, requestLoadingRightsFor, saveDocuments, saveDocuments, saveStoreAsSingleDocument, serialize, serialize, serialize, setAnalyser, setFilteringURIs, setMatcher, setNamespaceBinding, startLoading, stopLoading, sync
public StoreImpl(java.lang.String database, java.lang.String username, java.lang.String password, java.lang.String storeParentPath, java.lang.String dataCollectionName) throws XBRLException
database
- 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
public DBConnection getConnection()
public void close() throws XBRLException
close
in interface Store
close
in class BaseStoreImpl
XBRLException
Store.close()
public void delete() throws XBRLException
Store
delete
in interface Store
XBRLException
- if the data store cannot be deleted.Store.delete()
public int getSize() throws XBRLException
getSize
in interface Store
XBRLException
- if the number of fragments cannot be determined.Store.persist(XML)
public void persist(XML xml) throws XBRLException
persist
in interface Store
xml
- 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(java.lang.String index) throws XBRLException
hasXMLResource
in interface Store
index
- The index of the fragment to test for.XBRLException
- If the test cannot be conducted.public <F extends XML> F getXMLResource(java.lang.String index) throws XBRLException
getXMLResource
in interface Store
index
- The index of the fragment.XBRLException
- if the fragment cannot be retrieved.public void remove(java.lang.String index) throws XBRLException
remove
in interface Store
index
- 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 Store
remove
in class BaseStoreImpl
xml
- The XML resource to remove.XBRLException
- if the XML resource cannot be removed from the store.Store.remove(XML)
public <F extends XML> java.util.List<F> queryForXMLResources(java.lang.String query) throws XBRLException
Store
queryForXMLResources
in interface Store
query
- 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(java.lang.String query) throws XBRLException
Store
queryCount
in interface Store
query
- 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 java.util.Set<java.lang.String> queryForIndices(java.lang.String query) throws XBRLException
Store
queryForIndices
in interface Store
query
- 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 java.util.Set<java.lang.String> queryForStrings(java.lang.String query) throws XBRLException
Store
queryForStrings
in interface Store
query
- 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 java.lang.String toString()
toString
in class java.lang.Object