|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
org.exist.storage.DBBroker
This is the base class for all database backends. All the basic database operations like storing, removing or index access are provided by subclasses of this class.
| Field Summary | |
protected boolean |
caseSensitive
|
protected Configuration |
config
|
protected int |
docFragmentationLimit
|
protected java.lang.String |
id
|
protected static Logger |
LOG
|
static int |
MATCH_EXACT
|
static int |
MATCH_REGEXP
|
static int |
MATCH_WILDCARDS
|
static int |
NATIVE
|
static int |
NATIVE_CLUSTER
|
protected BrokerPool |
pool
|
static java.lang.String |
ROOT_COLLECTION
|
static java.lang.String |
ROOT_COLLECTION_NAME
|
protected SymbolTable |
symbols
|
protected java.io.File |
symbolsFile
|
static java.lang.String |
SYSTEM_COLLECTION
|
static java.lang.String |
TEMP_COLLECTION
|
protected User |
user
|
protected XQuery |
xqueryService
|
protected boolean |
xupdateConsistencyChecks
|
protected int |
xupdateGrowthFactor
|
| Constructor Summary | |
DBBroker(BrokerPool pool,
Configuration config)
|
|
| Method Summary | |
void |
backupSymbolsTo(java.io.OutputStream os)
|
abstract void |
checkXMLResourceConsistency(DocumentImpl doc)
|
abstract void |
checkXMLResourceTree(DocumentImpl doc)
Perform a consistency check on the specified document. |
abstract void |
cleanUpTempCollection()
Clean up any temporary resources. |
abstract void |
cleanUpTempResources()
Clean up temporary resources. |
abstract void |
cleanUpTempResources(java.util.List docs)
Remove the temporary document fragments specified by a list of names. |
void |
closeDocument()
|
boolean |
consistencyChecksEnabled()
|
abstract void |
copyCollection(Txn transaction,
Collection collection,
Collection destination,
java.lang.String newName)
Copy a collection to the destination collection and rename it. |
abstract void |
copyXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
java.lang.String newName)
Copy a resource to the destination collection and rename it. |
void |
decReferenceCount()
|
abstract void |
defragXMLResource(Txn transaction,
DocumentImpl doc)
Defragment pages of this document. |
void |
endElement(StoredNode node,
NodePath currentPath,
java.lang.String content)
|
abstract void |
endElement(StoredNode node,
NodePath currentPath,
java.lang.String content,
long oldAddress)
Update indexes for the given element node. |
abstract void |
endRemove()
|
void |
flush()
Flush all data that has not been written before. |
abstract DocumentSet |
getAllXMLResources(DocumentSet docs)
Adds all the documents in the database to the specified DocumentSet. |
abstract int |
getBackendType()
|
abstract byte[] |
getBinaryResource(BinaryDocument blob)
Retrieve the binary data stored under the resource descriptor BinaryDocument. |
BrokerPool |
getBrokerPool()
|
abstract Collection |
getCollection(java.lang.String name)
Returns the database collection identified by the specified path. |
abstract Collection |
getCollection(java.lang.String name,
long address)
Returns the database collection identified by the specified path. |
abstract void |
getCollectionResources(Collection collection)
|
Configuration |
getConfiguration()
Returns the configuration object used to initialize the current database instance. |
java.util.Iterator |
getDOMIterator(org.w3c.dom.Document doc,
long gid)
Return a DOMFileIterator starting
at the specified node. |
java.util.Iterator |
getDOMIterator(NodeProxy proxy)
Return a DOMFileIterator starting
at the specified node. |
abstract ElementIndex |
getElementIndex()
|
int |
getFragmentationLimit()
|
java.lang.String |
getId()
|
abstract IndexSpec |
getIndexConfiguration()
|
abstract int |
getNextResourceId(Txn transaction,
Collection collection)
Get a new document id that does not yet exist within the collection. |
java.util.Iterator |
getNodeIterator(NodeProxy proxy)
Return a NodeIterator starting
at the specified node. |
abstract org.w3c.dom.NodeList |
getNodeRange(org.w3c.dom.Document doc,
long first,
long last)
Get a range of nodes with given owner document from the database, starting at first and ending at last. |
abstract NodeSet |
getNodesEqualTo(NodeSet context,
DocumentSet docs,
int relation,
int truncation,
java.lang.String expr,
java.text.Collator collator)
Find all Nodes whose string value is equal to expr in the document set. |
java.lang.String |
getNodeValue(NodeProxy proxy,
boolean addWhitespace)
Get the string value of the specified node. |
Collection |
getOrCreateCollection(Txn transaction,
java.lang.String name)
Returns the database collection identified by the specified path. |
abstract int |
getPageSize()
|
abstract NativeValueIndexByQName |
getQNameValueIndex()
|
int |
getReferenceCount()
|
abstract void |
getResourceMetadata(DocumentImpl doc)
|
abstract Serializer |
getSerializer()
Get an instance of the Serializer used for converting nodes back to XML. |
SymbolTable |
getSymbols()
|
abstract TextSearchEngine |
getTextEngine()
Get the TextSearchEngine associated with this broker. |
User |
getUser()
Get the user that is currently using this DBBroker object. |
abstract NativeValueIndex |
getValueIndex()
|
abstract org.w3c.dom.Document |
getXMLResource(java.lang.String path)
Return the document stored at the specified path. |
abstract DocumentImpl |
getXMLResource(java.lang.String docPath,
int lockMode)
|
abstract DocumentSet |
getXMLResourcesByDoctype(java.lang.String doctype,
DocumentSet result)
|
XQuery |
getXQueryService()
Returns a reference to the global XQuery service. |
int |
getXUpdateGrowthFactor()
|
void |
incReferenceCount()
|
void |
indexNode(Txn transaction,
StoredNode node)
|
abstract void |
indexNode(Txn transaction,
StoredNode node,
NodePath currentPath)
|
abstract void |
insertNodeAfter(Txn transaction,
StoredNode previous,
StoredNode node)
|
boolean |
isCaseSensitive()
Is string comparison case sensitive? |
boolean |
isReadOnly()
Is the database running read-only? Returns false by default. |
protected void |
loadSymbols()
Read the global symbol table. |
abstract void |
moveCollection(Txn transaction,
Collection collection,
Collection destination,
java.lang.String newName)
Move a collection and all its subcollections to another collection and rename it. |
abstract void |
moveXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
java.lang.String newName)
Move a resource to the destination collection and rename it. |
abstract Serializer |
newSerializer()
|
abstract org.w3c.dom.Node |
objectWith(org.w3c.dom.Document doc,
long gid)
Get a node with given owner document and id from the database. |
abstract org.w3c.dom.Node |
objectWith(NodeProxy p)
|
abstract Collection |
openCollection(java.lang.String name,
int lockMode)
Open a collection for reading or writing. |
abstract void |
reindexCollection(java.lang.String collectionName)
Reindex a collection. |
abstract void |
reindexXMLResource(Txn transaction,
DocumentImpl oldDoc,
DocumentImpl doc,
StoredNode node)
|
abstract void |
removeAllNodes(Txn transaction,
StoredNode node,
NodePath currentPath)
|
abstract void |
removeBinaryResource(Txn transaction,
BinaryDocument blob)
Completely delete this binary document (descriptor and binary data). |
abstract boolean |
removeCollection(Txn transaction,
Collection collection)
Remove the collection and all its subcollections from the database. |
abstract void |
removeNode(Txn transaction,
StoredNode node,
NodePath currentPath,
java.lang.String content)
|
void |
removeXMLResource(Txn transaction,
DocumentImpl document)
Remove a document from the database. |
abstract void |
removeXMLResource(Txn transaction,
DocumentImpl document,
boolean freeDocId)
|
abstract void |
repair()
|
abstract void |
saveCollection(Txn transaction,
Collection collection)
Saves the specified collection to storage. |
protected void |
saveSymbols()
Save the global symbol table. |
void |
setId(java.lang.String id)
|
void |
setUser(User user)
Set the user that is currently using this DBBroker object. |
void |
shutdown()
Shut down the database instance. |
abstract void |
storeBinaryResource(Txn transaction,
BinaryDocument blob,
byte[] data)
Stores the given data under the given binary resource descriptor (BinaryDocument). |
void |
storeNode(Txn transaction,
StoredNode node,
NodePath currentPath)
|
abstract void |
storeNode(Txn transaction,
StoredNode node,
NodePath currentPath,
boolean index)
Store a node into the database. |
abstract DocumentImpl |
storeTempResource(DocumentImpl doc)
Create a temporary document in the temp collection and store the supplied data. |
abstract void |
storeXMLResource(Txn transaction,
DocumentImpl doc)
Store a document (descriptor) into the database (all metadata information which is returned by org.exist.dom.DocumentImpl#serialize()). |
abstract void |
sync(int syncEvent)
Sync dom and collection state data (pages) to disk. |
java.lang.String |
toString()
|
abstract void |
updateNode(Txn transaction,
StoredNode node)
Update a node's data. |
| Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MATCH_EXACT
public static final int MATCH_REGEXP
public static final int MATCH_WILDCARDS
public static final int NATIVE
public static final int NATIVE_CLUSTER
public static final java.lang.String ROOT_COLLECTION_NAME
public static final java.lang.String ROOT_COLLECTION
public static final java.lang.String SYSTEM_COLLECTION
public static final java.lang.String TEMP_COLLECTION
protected static final Logger LOG
protected boolean caseSensitive
protected Configuration config
protected BrokerPool pool
protected java.io.File symbolsFile
protected SymbolTable symbols
protected User user
protected XQuery xqueryService
protected int xupdateGrowthFactor
protected int docFragmentationLimit
protected boolean xupdateConsistencyChecks
protected java.lang.String id
| Constructor Detail |
public DBBroker(BrokerPool pool,
Configuration config)
throws EXistException
| Method Detail |
protected void saveSymbols()
throws EXistException
EXistException
protected void loadSymbols()
throws EXistException
EXistException
public void backupSymbolsTo(java.io.OutputStream os)
throws java.io.IOException
java.io.IOExceptionpublic SymbolTable getSymbols()
public void setUser(User user)
user - public User getUser()
public XQuery getXQueryService()
XQuery service.
public abstract ElementIndex getElementIndex()
public void flush()
public abstract DocumentSet getAllXMLResources(DocumentSet docs)
docs - a (possibly empty) document set to which the found
documents are added.public abstract Collection getCollection(java.lang.String name)
public abstract Collection getCollection(java.lang.String name,
long address)
public abstract Collection openCollection(java.lang.String name,
int lockMode)
name - the collection pathlockMode - one of the modes specified in class Lock
public Collection getOrCreateCollection(Txn transaction,
java.lang.String name)
throws PermissionDeniedException
PermissionDeniedExceptionpublic Configuration getConfiguration()
public java.util.Iterator getDOMIterator(org.w3c.dom.Document doc,
long gid)
DOMFileIterator starting
at the specified node.
public java.util.Iterator getDOMIterator(NodeProxy proxy)
DOMFileIterator starting
at the specified node.
public java.util.Iterator getNodeIterator(NodeProxy proxy)
NodeIterator starting
at the specified node.
proxy -
public abstract org.w3c.dom.Document getXMLResource(java.lang.String path)
throws PermissionDeniedException
PermissionDeniedException
public abstract DocumentImpl getXMLResource(java.lang.String docPath,
int lockMode)
throws PermissionDeniedException
PermissionDeniedException
public abstract int getNextResourceId(Txn transaction,
Collection collection)
public java.lang.String getNodeValue(NodeProxy proxy,
boolean addWhitespace)
public abstract NodeSet getNodesEqualTo(NodeSet context,
DocumentSet docs,
int relation,
int truncation,
java.lang.String expr,
java.text.Collator collator)
context - the set of nodes to processdocs - the current set of documentsrelation - less-than, equal etc. One of the constants specified in
Constantsexpr - the string value to search for
public abstract org.w3c.dom.NodeList getNodeRange(org.w3c.dom.Document doc,
long first,
long last)
doc - the document the nodes belong tofirst - unique id of the first node to retrievelast - unique id of the last node to retrievepublic abstract Serializer getSerializer()
public abstract TextSearchEngine getTextEngine()
public abstract NativeValueIndex getValueIndex()
public abstract NativeValueIndexByQName getQNameValueIndex()
public boolean isCaseSensitive()
public abstract Serializer newSerializer()
public abstract org.w3c.dom.Node objectWith(org.w3c.dom.Document doc,
long gid)
doc - the document the node belongs togid - the node's unique identifierpublic abstract org.w3c.dom.Node objectWith(NodeProxy p)
public abstract boolean removeCollection(Txn transaction,
Collection collection)
throws PermissionDeniedException
PermissionDeniedException
public void removeXMLResource(Txn transaction,
DocumentImpl document)
throws PermissionDeniedException
PermissionDeniedException
public abstract void removeXMLResource(Txn transaction,
DocumentImpl document,
boolean freeDocId)
throws PermissionDeniedException
PermissionDeniedException
public abstract void reindexCollection(java.lang.String collectionName)
throws PermissionDeniedException
collectionName -
PermissionDeniedException
public abstract void repair()
throws PermissionDeniedException
PermissionDeniedException
public abstract void saveCollection(Txn transaction,
Collection collection)
throws PermissionDeniedException
#addDocument(Collection, DocumentImpl) is called.
collection - to store
PermissionDeniedExceptionpublic void closeDocument()
public void shutdown()
public abstract void storeNode(Txn transaction,
StoredNode node,
NodePath currentPath,
boolean index)
node - the node to be storedcurrentPath - path expression which points to this node's
element-parent or to itself if it is an element (currently used by
the Broker to determine if a node's content should be
fulltext-indexed).
public void storeNode(Txn transaction,
StoredNode node,
NodePath currentPath)
public void endElement(StoredNode node,
NodePath currentPath,
java.lang.String content)
public abstract void endElement(StoredNode node,
NodePath currentPath,
java.lang.String content,
long oldAddress)
node - the current element nodecurrentPath - node path leading to the elementcontent - contains the string value of the element. Needed if a range index
is defined on it.oldAddress - when copying a node, contains the storage address of the old node.
public abstract void storeXMLResource(Txn transaction,
DocumentImpl doc)
org.exist.dom.DocumentImpl#serialize()).
doc - the document's metadata to store.
public abstract void storeBinaryResource(Txn transaction,
BinaryDocument blob,
byte[] data)
blob - the binary document descriptordata - the document binary datapublic abstract void getCollectionResources(Collection collection)
public abstract byte[] getBinaryResource(BinaryDocument blob)
blob - the binary document descriptor
public abstract void getResourceMetadata(DocumentImpl doc)
public abstract void removeBinaryResource(Txn transaction,
BinaryDocument blob)
throws PermissionDeniedException
blob - the binary document descriptor
PermissionDeniedException - if you don't have the right to do this
public abstract void moveCollection(Txn transaction,
Collection collection,
Collection destination,
java.lang.String newName)
throws PermissionDeniedException,
LockException
collection - the collection to movedestination - the destination collectionnewName - the new name the collection should have in the destination collection
PermissionDeniedException
LockException
public abstract void moveXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
java.lang.String newName)
throws PermissionDeniedException,
LockException
doc - the resource to movedestination - the destination collection
PermissionDeniedException
LockException
public abstract void copyCollection(Txn transaction,
Collection collection,
Collection destination,
java.lang.String newName)
throws PermissionDeniedException,
LockException
destination - the destination collection
PermissionDeniedException
LockException
public abstract void copyXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
java.lang.String newName)
throws PermissionDeniedException,
LockException
doc - the resource to copydestination - the destination collectionnewName - the new name the resource should have in the destination collection
PermissionDeniedException
LockException
public abstract void defragXMLResource(Txn transaction,
DocumentImpl doc)
doc - to defragpublic abstract void checkXMLResourceTree(DocumentImpl doc)
doc -
public abstract void checkXMLResourceConsistency(DocumentImpl doc)
throws EXistException
EXistExceptionpublic abstract void sync(int syncEvent)
org.exist.storage.sync.Sync.MAJOR_SYNC, sync all
states (dom, collection, text and element) to disk.
syncEvent - Sync.MAJOR_SYNC or Sync.MINOR_SYNC
public abstract void updateNode(Txn transaction,
StoredNode node)
node - Description of the Parameterpublic boolean isReadOnly()
public BrokerPool getBrokerPool()
public abstract void insertNodeAfter(Txn transaction,
StoredNode previous,
StoredNode node)
public abstract void reindexXMLResource(Txn transaction,
DocumentImpl oldDoc,
DocumentImpl doc,
StoredNode node)
public void indexNode(Txn transaction,
StoredNode node)
public abstract void indexNode(Txn transaction,
StoredNode node,
NodePath currentPath)
public abstract void removeNode(Txn transaction,
StoredNode node,
NodePath currentPath,
java.lang.String content)
public abstract void removeAllNodes(Txn transaction,
StoredNode node,
NodePath currentPath)
public abstract void endRemove()
public abstract DocumentImpl storeTempResource(DocumentImpl doc)
throws EXistException,
PermissionDeniedException,
LockException
EXistException
PermissionDeniedException
LockExceptionpublic abstract void cleanUpTempCollection()
public abstract void cleanUpTempResources()
public abstract void cleanUpTempResources(java.util.List docs)
docs -
public abstract DocumentSet getXMLResourcesByDoctype(java.lang.String doctype,
DocumentSet result)
public int getReferenceCount()
public void incReferenceCount()
public void decReferenceCount()
public int getXUpdateGrowthFactor()
public int getFragmentationLimit()
public boolean consistencyChecksEnabled()
public abstract int getPageSize()
public abstract IndexSpec getIndexConfiguration()
public void setId(java.lang.String id)
public java.lang.String getId()
public java.lang.String toString()
public abstract int getBackendType()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||