Qizx fe-4.4p2 API

com.qizx.api
Interface PostCommitTrigger.CommitEvent

Enclosing interface:
PostCommitTrigger

public static interface PostCommitTrigger.CommitEvent

Provides access to changes operated by a commit.

Affected Documents and Collections are classified in three exclusive groups:

A Collection is said updated if at any level a Document or sub-collection has been created, deleted or updated.


Method Summary
 int createdDocumentCount()
          Returns the number of documents created in the transaction.
 LibraryMemberIterator createdDocuments()
          Returns an iterator on documents created in the transaction.
 int deletedDocumentCount()
          Returns the number of documents deleted in the transaction.
 LibraryMemberIterator deletedDocuments()
          Returns an iterator on documents deleted in the transaction.
 long getCommitId()
          Returns the "commit id", an integer which is increased on each successful commit.
 long getCommitTime()
          Returns the precise time when the commit was performed.
 Document getCreatedDocument(String path)
          Returns the Document descriptor corresponding to this path if and only if this document has been created in the related commit.
 Document getDeletedDocument(String path)
          Returns the Document descriptor corresponding to this path if and only if this document has been deleted in the related commit.
 Library getLibrary()
          Returns an XML Library session reflecting the state of the database after the commit.
 Collection getUpdatedCollection(String path)
          Returns a non-null Collection descriptor if the collection with this path has been updated (i.e anything nested within the collection has changed).
 Document getUpdatedDocument(String path)
          Returns the Document descriptor corresponding to this path if and only if this document has been updated in the related commit.
 int updatedCollectionCount()
          Returns the number of collections whose contents have changed in the transaction.
 LibraryMemberIterator updatedCollections()
          Returns an iterator on collections whose contents have changed in the transaction.
 int updatedDocumentCount()
          Returns the number of documents whose contents have changed in the transaction.
 LibraryMemberIterator updatedDocuments()
          Returns an iterator on documents whose contents have changed in the transaction.
 

Method Detail

getLibrary

Library getLibrary()
Returns an XML Library session reflecting the state of the database after the commit.

This session has the same User as the Library session which performed the commit.


getCommitTime

long getCommitTime()
Returns the precise time when the commit was performed.

Returns:
a time-stamp in milliseconds as returned by System.currentTimeMillis().

getCommitId

long getCommitId()
Returns the "commit id", an integer which is increased on each successful commit. It indicates the state of the database: a replica with a lesser commitId is not up-to-date.

Returns:
a positive integer

createdDocumentCount

int createdDocumentCount()
Returns the number of documents created in the transaction.


createdDocuments

LibraryMemberIterator createdDocuments()
                                       throws DataModelException
Returns an iterator on documents created in the transaction.

Throws:
DataModelException

getCreatedDocument

Document getCreatedDocument(String path)
                            throws DataModelException
Returns the Document descriptor corresponding to this path if and only if this document has been created in the related commit.

Parameters:
path - path of a document within the Library
Returns:
a Document descriptor, or null if the document has not been created in the related commit (i.e does not exist)
Throws:
DataModelException

updatedDocumentCount

int updatedDocumentCount()
Returns the number of documents whose contents have changed in the transaction. Does not include created or deleted documents.


updatedDocuments

LibraryMemberIterator updatedDocuments()
                                       throws DataModelException
Returns an iterator on documents whose contents have changed in the transaction. Does not include created or deleted documents.

Throws:
DataModelException

getUpdatedDocument

Document getUpdatedDocument(String path)
                            throws DataModelException
Returns the Document descriptor corresponding to this path if and only if this document has been updated in the related commit.

Parameters:
path - path of a document within the Library
Returns:
a Document descriptor, or null if the document has not been created in the related commit (i.e does not exist)
Throws:
DataModelException

deletedDocumentCount

int deletedDocumentCount()
Returns the number of documents deleted in the transaction.


deletedDocuments

LibraryMemberIterator deletedDocuments()
                                       throws DataModelException
Returns an iterator on documents deleted in the transaction.

Throws:
DataModelException

getDeletedDocument

Document getDeletedDocument(String path)
                            throws DataModelException
Returns the Document descriptor corresponding to this path if and only if this document has been deleted in the related commit.

Notice that this Document is a "zombie" document that cannot be found by queries. Only the metadata properties are accessible: attempt to get the XML contents will raise an error.

Parameters:
path - path of a document within the Library
Returns:
a Document descriptor, or null if the document has not been deleted in the related commit (i.e does not exist)
Throws:
DataModelException

updatedCollectionCount

int updatedCollectionCount()
Returns the number of collections whose contents have changed in the transaction.

'Changed collection contents' means that a document or a collection, nested at any level inside this collection, has been created, deleted or updated.

Caution: the root collection / is not counted because it is always


updatedCollections

LibraryMemberIterator updatedCollections()
                                         throws DataModelException
Returns an iterator on collections whose contents have changed in the transaction.

'Changed collection contents' means that a document or a collection, nested at any level inside this collection, has been created, deleted or updated.

Throws:
DataModelException

getUpdatedCollection

Collection getUpdatedCollection(String path)
                                throws DataModelException
Returns a non-null Collection descriptor if the collection with this path has been updated (i.e anything nested within the collection has changed).

Parameters:
path - path of a collection within the Library
Returns:
a non-null Collection descriptor if the collection contents have changed, null otherwise (even if the collection exists)
Throws:
DataModelException

© 2010 Axyana Software