|
||||||||
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 | |
static java.lang.String |
COLLECTION_CONFIG_FILENAME
|
static java.lang.String |
CONFIG_COLLECTION
|
java.util.HashMap |
customProperties
|
static int |
MATCH_EXACT
|
static int |
MATCH_REGEXP
|
static int |
MATCH_WILDCARDS
|
static int |
NATIVE
|
static int |
NATIVE_CLUSTER
|
static java.lang.String |
PROPERTY_XUPDATE_CONSISTENCY_CHECKS
|
static java.lang.String |
PROPERTY_XUPDATE_FRAGMENTATION_FACTOR
|
static java.lang.String |
PROPERTY_XUPDATE_GROWTH_FACTOR
|
static java.lang.String |
ROOT_COLLECTION
|
static java.lang.String |
ROOT_COLLECTION_NAME
|
static java.lang.String |
SYSTEM_COLLECTION
|
static java.lang.String |
TEMP_COLLECTION
|
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()
|
abstract void |
copyCollection(Txn transaction,
Collection collection,
Collection destination,
XmldbURI newName)
Copy a collection to the destination collection and rename it. |
abstract void |
copyXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
XmldbURI 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(XmldbURI uri)
Returns the database collection identified by the specified path. |
abstract Collection |
getCollection(XmldbURI uri,
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(StoredNode node)
Return a DOMFileIterator starting at the
specified node. |
abstract ElementIndex |
getElementIndex()
|
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(StoredNode node)
Return a NodeIterator starting at the
specified node. |
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(StoredNode node,
boolean addWhitespace)
Get the string value of the specified node. |
Collection |
getOrCreateCollection(Txn transaction,
XmldbURI uri)
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()
|
abstract NativeValueIndex |
getValueIndex()
|
abstract org.w3c.dom.Document |
getXMLResource(XmldbURI docURI)
Return the document stored at the specified path. |
abstract DocumentImpl |
getXMLResource(XmldbURI docURI,
int lockMode)
Return the document stored at the specified path. |
abstract DocumentSet |
getXMLResourcesByDoctype(java.lang.String doctype,
DocumentSet result)
|
XQuery |
getXQueryService()
|
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. |
abstract void |
moveCollection(Txn transaction,
Collection collection,
Collection destination,
XmldbURI newName)
Move a collection and all its subcollections to another collection and rename it. |
abstract void |
moveXMLResource(Txn transaction,
DocumentImpl doc,
Collection destination,
XmldbURI newName)
Move a resource to the destination collection and rename it. |
abstract Serializer |
newSerializer()
|
abstract StoredNode |
objectWith(org.w3c.dom.Document doc,
NodeId nodeId)
Get a node with given owner document and id from the database. |
abstract StoredNode |
objectWith(NodeProxy p)
|
abstract Collection |
openCollection(XmldbURI uri,
int lockMode)
Open a collection for reading or writing. |
abstract void |
readBinaryResource(BinaryDocument blob,
java.io.OutputStream os)
|
abstract void |
reindexCollection(XmldbURI collectionName)
Reindex a collection. |
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. |
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). |
abstract void |
storeBinaryResource(Txn transaction,
BinaryDocument blob,
java.io.InputStream is)
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. |
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, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
equals, 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
public static final java.lang.String CONFIG_COLLECTION
public static final java.lang.String COLLECTION_CONFIG_FILENAME
public static java.lang.String PROPERTY_XUPDATE_GROWTH_FACTOR
public static java.lang.String PROPERTY_XUPDATE_FRAGMENTATION_FACTOR
public static java.lang.String PROPERTY_XUPDATE_CONSISTENCY_CHECKS
public java.util.HashMap customProperties
Constructor Detail |
public DBBroker(BrokerPool pool, Configuration config) throws EXistException
Method Detail |
public void backupSymbolsTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public 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(XmldbURI uri)
public abstract Collection getCollection(XmldbURI uri, long address)
public abstract Collection openCollection(XmldbURI uri, int lockMode)
uri
- The collection pathlockMode
- one of the modes specified in class
Lock
public Collection getOrCreateCollection(Txn transaction, XmldbURI uri) throws PermissionDeniedException
PermissionDeniedException
public 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(StoredNode node)
DOMFileIterator
starting at the
specified node.
public java.util.Iterator getNodeIterator(StoredNode node)
NodeIterator
starting at the
specified node.
node
-
public abstract org.w3c.dom.Document getXMLResource(XmldbURI docURI) throws PermissionDeniedException
PermissionDeniedException
public abstract DocumentImpl getXMLResource(XmldbURI docURI, int lockMode) throws PermissionDeniedException
PermissionDeniedException
public abstract int getNextResourceId(Txn transaction, Collection collection)
public java.lang.String getNodeValue(StoredNode node, 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
Constants
expr
- the string value to search forpublic abstract Serializer getSerializer()
public abstract TextSearchEngine getTextEngine()
public abstract NativeValueIndex getValueIndex()
public abstract NativeValueIndexByQName getQNameValueIndex()
public boolean isCaseSensitive()
public abstract Serializer newSerializer()
public abstract StoredNode objectWith(org.w3c.dom.Document doc, NodeId nodeId)
doc
- the document the node belongs tonodeId
- the node's unique identifierpublic abstract StoredNode 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(XmldbURI collectionName) throws PermissionDeniedException
collectionName
-
PermissionDeniedException
- public abstract void reindexCollection(String collectionName) throws
PermissionDeniedException;public abstract void repair() throws PermissionDeniedException
PermissionDeniedException
public abstract void saveCollection(Txn transaction, Collection collection) throws PermissionDeniedException
transaction
- collection
- Collection to store
PermissionDeniedException
public 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)
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 storeBinaryResource(Txn transaction, BinaryDocument blob, java.io.InputStream is)
blob
- the binary document descriptoris
- the document binary data as input streampublic abstract void getCollectionResources(Collection collection)
public abstract byte[] getBinaryResource(BinaryDocument blob)
blob
- the binary document descriptor
public abstract void readBinaryResource(BinaryDocument blob, java.io.OutputStream os)
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 thispublic abstract void moveCollection(Txn transaction, Collection collection, Collection destination, XmldbURI 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, XmldbURI newName) throws PermissionDeniedException, LockException
doc
- the resource to movedestination
- the destination collectionnewName
- the new name the resource should have in the destination
collection
PermissionDeniedException
LockException
public abstract void copyCollection(Txn transaction, Collection collection, Collection destination, XmldbURI newName) throws PermissionDeniedException, LockException
collection
- the resource to movedestination
- the destination collectionnewName
- the new name the resource should have in the destination
collection
PermissionDeniedException
LockException
public abstract void copyXMLResource(Txn transaction, DocumentImpl doc, Collection destination, XmldbURI 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
EXistException
public abstract void sync(int syncEvent)
Sync.MAJOR_SYNC
, sync all states (dom,
collection, text and element) to disk.
syncEvent
- Sync.MAJOR_SYNC or Sync.MINOR_SYNCpublic 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 indexNode(Txn transaction, StoredNode node, NodePath currentPath)
public void indexNode(Txn transaction, StoredNode node)
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
doc
-
EXistException
PermissionDeniedException
LockException
public 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 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 |