org.exist.storage
Class NativeClusterBroker

java.lang.Object
  extended by java.util.Observable
      extended by org.exist.storage.DBBroker
          extended by org.exist.storage.NativeBroker
              extended by org.exist.storage.NativeClusterBroker

public class NativeClusterBroker
extends NativeBroker

Created by Francesco Mondora.

Author:
Francesco Mondora aka Makkina, Michele Danieli aka mdanieli Date: 13-dic-2004 Time: 17.12.51 Revision $Revision: 5432 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exist.storage.NativeBroker
NativeBroker.NodeRef
 
Field Summary
 
Fields inherited from class org.exist.storage.NativeBroker
BUFFERS, COLLECTIONS_DBX_ID, DEFAULT_DATA_DIR, DEFAULT_INDEX_DEPTH, DEFAULT_MIN_MEMORY, DEFAULT_NODES_BEFORE_MEMORY_CHECK, DEFAULT_PAGE_SIZE, DOM_DBX_ID, ELEMENTS_DBX_ID, OFFSET_COLLECTION_ID, OFFSET_VALUE, PREPEND_DB_ALWAYS, PREPEND_DB_AS_NEEDED, PREPEND_DB_NEVER, PROPERTY_INDEX_DEPTH, PROPERTY_MIN_FREE_MEMORY, PROPERTY_PAGE_SIZE, TEMP_FRAGMENT_TIMEOUT, VALUES_DBX_ID, WORDS_DBX_ID
 
Fields inherited from class org.exist.storage.DBBroker
customProperties, MATCH_EXACT, MATCH_REGEXP, MATCH_WILDCARDS, PROPERTY_XUPDATE_CONSISTENCY_CHECKS, PROPERTY_XUPDATE_FRAGMENTATION_FACTOR, PROPERTY_XUPDATE_GROWTH_FACTOR, ROOT_COLLECTION, ROOT_COLLECTION_NAME, SYSTEM_COLLECTION, TEMP_COLLECTION
 
Constructor Summary
NativeClusterBroker(BrokerPool pool, Configuration config)
           
 
Method Summary
 Collection getOrCreateCollection(Txn transaction, XmldbURI name)
          get collection object If the collection does not yet exists, it is created automatically.
 Collection openCollection(XmldbURI name, int lockMode)
          Get collection object.
 void saveCollection(Txn transaction, Collection collection)
          Saves the specified collection to storage.
 void sync(int syncEvent)
          Sync dom and collection state data (pages) to disk.
 
Methods inherited from class org.exist.storage.NativeBroker
addObserver, checkXMLResourceConsistency, checkXMLResourceTree, cleanUpTempCollection, cleanUpTempResources, closeDocument, copyCollection, copyXMLResource, defragXMLResource, deleteObservers, dropCollectionIndex, endElement, endRemove, flush, getAllXMLResources, getBinaryResource, getCollection, getCollectionResources, getDOMFile, getElementIndex, getFreeCollectionId, getFreeResourceId, getIndexConfiguration, getNextCollectionId, getNextResourceId, getNodeIterator, getNodeValue, getPageSize, getResourceMetadata, getSerializer, getStorage, getStorageFileIds, getSymbols, getTextEngine, getValueIndex, getXMLResource, getXMLResource, getXMLResourcesByDoctype, getXMLStreamReader, getXMLStreamReader, indexNode, indexNode, insertNodeAfter, isReadOnly, moveCollection, moveXMLResource, newSerializer, objectWith, objectWith, prepend, readBinaryResource, reindexCollection, reindexCollection, reindexCollection, removeAllNodes, removeBinaryResource, removeCollection, removeNode, removeXMLResource, repair, shutdown, storeBinaryResource, storeBinaryResource, storeNode, storeNode, storeTempResource, storeXMLResource, updateNode
 
Methods inherited from class org.exist.storage.DBBroker
addContentLoadingObserver, clearContentLoadingObservers, decReferenceCount, endElement, getBrokerPool, getConfiguration, getId, getIndexController, getReferenceCount, getUser, getXQueryService, incReferenceCount, indexNode, removeContentLoadingObserver, removeXMLResource, setId, setUser, toString
 
Methods inherited from class java.util.Observable
countObservers, deleteObserver, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NativeClusterBroker

public NativeClusterBroker(BrokerPool pool,
                           Configuration config)
                    throws EXistException
Throws:
EXistException
Method Detail

openCollection

public Collection openCollection(XmldbURI name,
                                 int lockMode)
Get collection object. If the collection does not exist, null is returned. Wraps for cluster the resultant collection in a ClusterCollection

Overrides:
openCollection in class NativeBroker
Parameters:
name - Description of the Parameter
lockMode - one of the modes specified in class Lock
Returns:
The collection value

saveCollection

public void saveCollection(Txn transaction,
                           Collection collection)
                    throws PermissionDeniedException,
                           IOException
Description copied from class: NativeBroker
Saves the specified collection to storage. Collections are usually cached in memory. If a collection is modified, this method needs to be called to make the changes persistent. Note: appending a new document to a collection does not require a save.

Overrides:
saveCollection in class NativeBroker
collection - Collection to store
Throws:
PermissionDeniedException
IOException

getOrCreateCollection

public Collection getOrCreateCollection(Txn transaction,
                                        XmldbURI name)
                                 throws PermissionDeniedException,
                                        IOException
get collection object If the collection does not yet exists, it is created automatically. Wraps for cluster the resultant collection in a ClusterCollection

Overrides:
getOrCreateCollection in class NativeBroker
Parameters:
name - the collection's name
transaction - The transaction, which registers the acquired write locks. The locks should be released on commit/abort.
Returns:
The orCreateCollection value
Throws:
PermissionDeniedException - Description of the Exception
IOException

sync

public void sync(int syncEvent)
Description copied from class: DBBroker
Sync dom and collection state data (pages) to disk. In case of Sync.MAJOR_SYNC, sync all states (dom, collection, text and element) to disk.

Overrides:
sync in class NativeBroker
Parameters:
syncEvent - Sync.MAJOR_SYNC or Sync.MINOR_SYNC


Copyright (C) Wolfgang Meier. All rights reserved.