io::zorba::api::xqj::ZorbaXQCollectionManager

This class defines a set of functions for managing persistent collections.

Private Attributes

boolean

closed

CollectionManager

collectionManager

Collection< ZorbaXQCollection >

collections

Collection< XQSequence >

sequences

Protected Functions

ZorbaXQCollectionManager(CollectionManager cm)

Public Functions

XQSequence

availableCollections()

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

void

close()

Closes the collection manager.

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()

Checks if the collection manager is closed.

Private Functions

void

isClosedXQException()

Private Attributes

closed

boolean closed

collectionManager

CollectionManager collectionManager

collections

Collection< ZorbaXQCollection > collections

sequences

Collection< XQSequence > sequences

Protected Functions

ZorbaXQCollectionManager

 ZorbaXQCollectionManager(CollectionManager 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

The list of names of the available collections.

Parameters

XQException if any error occurs retreiving the collections

close

void close()

Closes the collection manager.

Once the collection manager is closed, no method other than close or the isClosed method may be called on the collection manager object. Calling close on an ZorbaXQCollectionManager object that is already closed has no effect.

Parameters

XQException - if there is an error during closing the collection.

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.

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 any error occurs verifying the collection

isClosed

boolean isClosed()

Checks if the collection manager is closed.

Returns

true if the collection manager is in a closed state, false otherwise

Private Functions

isClosedXQException

void isClosedXQException()