Using the StaticCollectionManager one can retrieve information about statically declared collections and indexes as well as manage them. More...
#include <zorba/static_collection_manager.h>
Public Member Functions | |
virtual ItemSequence_t | availableCollections () const =0 |
This function returns a sequence of names of the collections that are available. | |
virtual ItemSequence_t | availableIndexes () const =0 |
This function returns a sequence of names of the indexes that are available. | |
virtual void | createCollection (const Item &aName)=0 |
This function creates the collection with the given name. | |
virtual void | createCollection (const Item &aName, const ItemSequence_t &aContents)=0 |
This function creates the collection with the given name. | |
virtual void | createIndex (const Item &aQName)=0 |
Create the index with the given name. | |
virtual ItemSequence_t | declaredCollections () const =0 |
List all the collections that are declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager. | |
virtual ItemSequence_t | declaredIndexes () const =0 |
List all the indexes that are declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager. | |
virtual void | deleteCollection (const Item &aName)=0 |
This function removes the collection with the given name. | |
virtual void | deleteIndex (const Item &aQName)=0 |
Create the index with the given name. | |
virtual Collection_t | getCollection (const Item &aName) const =0 |
Returns a instance of the Collection class which can be used to modify and retrieve the contents of the collection identified by the given name. | |
virtual bool | isAvailableCollection (const Item &aName) const =0 |
This function returns true if a collection with the given name is available. | |
virtual bool | isAvailableIndex (const Item &aQName) const =0 |
This function returns true if a index with the given name is available. | |
virtual bool | isDeclaredCollection (const Item &aQName) const =0 |
Checks if a collection with a given QName is declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager. | |
virtual bool | isDeclaredIndex (const Item &aQName) const =0 |
Checks if a index with a given QName is declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager. | |
virtual void | registerDiagnosticHandler (DiagnosticHandler *aDiagnosticHandler)=0 |
Register a DiagnosticHandler to which errors occuring during the management of collections are reported. | |
virtual | ~StaticCollectionManager () |
Using the StaticCollectionManager one can retrieve information about statically declared collections and indexes as well as manage them.
The StaticCollectionManager can be retrieved from (1) a compiled XQuery or (2) a StaticContext object. In both cases, this class provides access to information for the collections and indexes that are declared in (1) all the modules (transitively) imported by the main query or (2) the module that resulted in the compilation of the StaticContext, respectively. Moreover, this class allows to create or delete such collections and indexes.
Definition at line 36 of file static_collection_manager.h.
virtual zorba::StaticCollectionManager::~StaticCollectionManager | ( | ) | [inline, virtual] |
Definition at line 122 of file static_collection_manager.h.
virtual ItemSequence_t zorba::CollectionManager::availableCollections | ( | ) | const [pure virtual, inherited] |
This function returns a sequence of names of the collections that are available.
If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager methods), the collections returned by this function are also statically declared.
virtual ItemSequence_t zorba::StaticCollectionManager::availableIndexes | ( | ) | const [pure virtual] |
This function returns a sequence of names of the indexes that are available.
virtual void zorba::CollectionManager::createCollection | ( | const Item & | aName | ) | [pure virtual, inherited] |
This function creates the collection with the given name.
aName | The name of the collection to create. |
XDDY0002 | if a collection with the given name already exists. |
virtual void zorba::CollectionManager::createCollection | ( | const Item & | aName, |
const ItemSequence_t & | aContents | ||
) | [pure virtual, inherited] |
This function creates the collection with the given name.
Moreover, it adds copies of the sequence aContents to the new collection.
aName | The name of the collection to create. |
aContents | The sequence of items. |
XDDY0002 | if a collection with the given name already exists. |
virtual void zorba::StaticCollectionManager::createIndex | ( | const Item & | aQName | ) | [pure virtual] |
Create the index with the given name.
aQName | The name of the index to create. |
zerr:ZDDY0021 | if a index with the given name is not declared. |
zerr:ZDDY0022 | if a index with the given name already exists. |
virtual ItemSequence_t zorba::StaticCollectionManager::declaredCollections | ( | ) | const [pure virtual] |
List all the collections that are declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager.
virtual ItemSequence_t zorba::StaticCollectionManager::declaredIndexes | ( | ) | const [pure virtual] |
List all the indexes that are declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager.
virtual void zorba::CollectionManager::deleteCollection | ( | const Item & | aName | ) | [pure virtual, inherited] |
This function removes the collection with the given name.
aName | The name of the collection to delete. |
XDDY0003 | if the collection does not exist. |
virtual void zorba::StaticCollectionManager::deleteIndex | ( | const Item & | aQName | ) | [pure virtual] |
Create the index with the given name.
aQName | The name of the index to create. |
zerr:ZDDY0021 | if a index with the given name is not declared. |
zerr:ZDDY0009 | if a index with the given name does not exist |
virtual Collection_t zorba::CollectionManager::getCollection | ( | const Item & | aName | ) | const [pure virtual, inherited] |
Returns a instance of the Collection class which can be used to modify and retrieve the contents of the collection identified by the given name.
aName | The name of the collection to retrieve. |
XDDY0003 | if the collection does not exist. |
virtual bool zorba::CollectionManager::isAvailableCollection | ( | const Item & | aName | ) | const [pure virtual, inherited] |
This function returns true if a collection with the given name is available.
If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager() methods), the collection also needs to be statically declared.
aName | The name of the collection that is being checked. |
virtual bool zorba::StaticCollectionManager::isAvailableIndex | ( | const Item & | aQName | ) | const [pure virtual] |
This function returns true if a index with the given name is available.
aQName | The name of the index that is being checked. |
virtual bool zorba::StaticCollectionManager::isDeclaredCollection | ( | const Item & | aQName | ) | const [pure virtual] |
Checks if a collection with a given QName is declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager.
virtual bool zorba::StaticCollectionManager::isDeclaredIndex | ( | const Item & | aQName | ) | const [pure virtual] |
Checks if a index with a given QName is declared in the XQuery or the StaticContext that was used to retrieve this StaticCollectionManager.
virtual void zorba::CollectionManager::registerDiagnosticHandler | ( | DiagnosticHandler * | aDiagnosticHandler | ) | [pure virtual, inherited] |
Register a DiagnosticHandler to which errors occuring during the management of collections are reported.
If no DiagnosticHandler has been set using this function or the corresponding function of the XmlDataManager then subclasses of the ZorbaException class are thrown to report errors.
aDiagnosticHandler | DiagnosticHandler to which errors are reported. The caller retains ownership over the DiagnosticHandler passed as parameter. |