io::zorba::api::xqj::ZorbaXQStaticCollectionManager

Using the ZorbaXQStaticCollectionManager one can retrieve information about statically declared collections and indexes as well as manage them. The ZorbaXQStaticCollectionManager can be retrieved from (1) a compiled XQuery or (2) a XQStaticContext 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.

Private Attributes

boolean

closed

StaticCollectionManager

collectionManager

Collection< ZorbaXQCollection >

collections

Collection< XQSequence >

sequences

Protected Functions

ZorbaXQStaticCollectionManager(StaticCollectionManager cm)

Public Functions

XQSequence

availableCollections()

This function returns a sequence of names of the collections that are available.

void

close()

void

createCollection(XQItem aName)

This function creates the collection with the given name.

void

deleteCollection(XQItem aName)

This function removes the collection with the given name.

ZorbaXQCollection

getCollection(XQItem aName)

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.

boolean

isAvailableCollection(XQItem aName)

This function returns true if a collection with the given name is available.

boolean

isClosed()

Private Functions

void

isClosedXQException()

Private Attributes

closed

boolean closed

collectionManager

StaticCollectionManager collectionManager

collections

Collection< ZorbaXQCollection > collections

sequences

Collection< XQSequence > sequences

Protected Functions

ZorbaXQStaticCollectionManager

 ZorbaXQStaticCollectionManager(StaticCollectionManager cm)

Public Functions

availableCollections

XQSequence availableCollections()

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.

Returns

ZorbaXQSequence - The list of names of the available collections.

close

void close()

createCollection

void createCollection(XQItem aName)

This function creates the collection with the given name.

Parameters

aName The name of the collection to create.

Parameters

XQException- if a collection with the given name already exists.

deleteCollection

void deleteCollection(XQItem aName)

This function removes the collection with the given name.

Parameters

aName - The name of the collection to delete.

Parameters

XQException - if the collection does not exist.

getCollection

ZorbaXQCollection getCollection(XQItem aName)

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.

Parameters

aName - The name of the collection to retrieve.

Returns

ZorbaXQCollection - The collection if available.

Parameters

XQException - if the collection does not exist.

isAvailableCollection

boolean isAvailableCollection(XQItem aName)

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.

Parameters

aName - The name of the collection that is being checked.

Returns

true if the collection is available and false otherwise.

Parameters

XQException - if the Collection Manager is closed

isClosed

boolean isClosed()

Private Functions

isClosedXQException

void isClosedXQException()