|
||||||||
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
org.exist.storage.NativeBroker
NativeBroker.
Nested Class Summary | |
static class |
NativeBroker.NodeRef
|
Field Summary | |
protected static int |
BUFFERS
|
protected CollectionStore |
collectionsDb
|
protected org.apache.oro.text.regex.PatternCompiler |
compiler
|
protected int |
defaultIndexDepth
|
protected DOMFile |
domDb
|
protected NativeElementIndex |
elementIndex
|
protected ElementPool |
elementPool
|
protected BFile |
elementsDb
|
protected java.util.Map |
idxPathMap
|
protected org.apache.oro.text.regex.PatternMatcher |
matcher
|
protected static int |
MEM_LIMIT_CHECK
|
protected int |
memMinFree
|
protected BFile |
namespacesDb
|
protected int |
nodesCount
|
protected boolean |
readOnly
|
protected static SymbolTable |
symbols
|
protected NativeTextEngine |
textEngine
|
protected Serializer |
xmlSerializer
|
Fields inherited from class org.exist.storage.DBBroker |
caseSensitive, config, DBM, MATCH_EXACT, MATCH_REGEXP, MATCH_WILDCARDS, MYSQL, NATIVE, ORACLE, pool, POSTGRESQL |
Constructor Summary | |
NativeBroker(BrokerPool pool,
Configuration config)
Constructor for the NativeBroker object |
Method Summary | |
void |
addDocument(Collection collection,
DocumentImpl doc)
|
void |
addObserver(java.util.Observer o)
|
void |
closeDocument()
|
void |
endRemove()
|
NodeSet |
findElementsByTagName(DocumentSet docs,
java.lang.String tagName)
find elements by their tag name. |
void |
flush()
flush all data that has not been written before. |
DocumentSet |
getAllDocuments(User user)
get all the documents in this database repository. |
NodeSet |
getAttributesByName(DocumentSet docs,
java.lang.String name)
Attributes are stored in the element-index (with a leading "@" in the name). |
Collection |
getCollection(java.lang.String name)
Gets the collection attribute of the DBBroker object |
Collection |
getCollection(java.lang.String name,
long addr)
get collection object. |
int |
getDatabaseType()
return the type of database this broker is connected to. |
org.w3c.dom.Document |
getDocument(User user,
java.lang.String fileName)
get a document by it's file name. |
DocumentSet |
getDocumentsByCollection(User user,
java.lang.String collection)
Gets the documentsByCollection attribute of the DBBroker object |
DocumentSet |
getDocumentsByCollection(User user,
java.lang.String collection,
boolean inclusive)
Gets the documentsByCollection attribute of the DBBroker object |
DocumentSet |
getDocumentsByDoctype(User user,
java.lang.String doctypeName)
get all the documents in this database matching the given document-type's name. |
java.util.Iterator |
getDOMIterator(NodeProxy proxy)
Gets the dOMIterator attribute of the DBBroker object |
java.lang.String |
getNamespacePrefix(java.lang.String namespace)
get a common prefix for a namespace URI. |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
get the namespace associated with the given prefix. |
protected short |
getNextCollectionId()
|
int |
getNextDocId(Collection collection)
get the number of documents in the repository this is used to determine a free document-id for the document to be stored. |
java.util.Iterator |
getNodeIterator(NodeProxy proxy)
|
NodeSet[] |
getNodesContaining(DocumentSet docs,
java.lang.String[] termList)
get all the nodes containing the search terms given by the array expr using the fulltext-index. |
NodeSet[] |
getNodesContaining(DocumentSet docs,
java.lang.String[] termList,
int type)
get all the nodes containing the search terms given by the array expr using the fulltext-index. |
NodeSet |
getNodesEqualTo(NodeSet context,
DocumentSet docs,
int relation,
java.lang.String expr)
This method handles left or left-and-right truncated search terms. |
java.lang.String |
getNodeValue(NodeProxy proxy)
Gets the nodeValue attribute of the DBBroker object |
Collection |
getOrCreateCollection(User user,
java.lang.String name)
get collection object If the collection does not yet exists, it is created automatically. |
org.w3c.dom.NodeList |
getRange(org.w3c.dom.Document doc,
long first,
long last)
Gets a range of nodes, starting with first, ending with last |
Serializer |
getSerializer()
get an instance of the Serializer used for converting nodes back to XML. |
static SymbolTable |
getSymbols()
|
TextSearchEngine |
getTextEngine()
get the TextSearchEngine associated with this broker. |
void |
index(NodeImpl node)
|
void |
insertAfter(NodeImpl previous,
NodeImpl node)
|
boolean |
isReadOnly()
Is the database running read-only? Returns false by default. |
protected static SymbolTable |
loadSymbols(BFile namespacesDb)
|
Serializer |
newSerializer()
Description of the Method |
protected static java.lang.String |
normalizeCollectionName(java.lang.String name)
|
org.w3c.dom.Node |
objectWith(org.w3c.dom.Document doc,
long gid)
get a node with given owner document and id from the database. |
org.w3c.dom.Node |
objectWith(NodeProxy p)
|
void |
readDocumentMetadata(DocumentImpl doc)
|
void |
registerNamespace(java.lang.String namespace,
java.lang.String prefix)
associate a prefix with a given namespace. |
void |
reindex(DocumentImpl oldDoc,
DocumentImpl doc,
NodeImpl node)
|
boolean |
removeCollection(User user,
java.lang.String name)
Description of the Method |
void |
removeDocument(User user,
java.lang.String docName)
remove the document with the given document name. |
void |
removeNode(NodeImpl node,
java.lang.String currentPath)
|
void |
saveCollection(Collection collection)
Store a collection into the database. |
static void |
saveSymbols(BFile namespacesDb)
|
Occurrences[] |
scanIndexedElements(User user,
Collection collection,
boolean inclusive)
|
protected NodeSet |
scanSequential(NodeSet context,
DocumentSet doc,
int relation,
int truncation,
java.lang.String expr)
Do a sequential search through the DOM-file. |
void |
shutdown()
shutdown the broker. |
void |
store(NodeImpl node,
java.lang.CharSequence currentPath)
Store a node into the database. |
void |
storeDocument(DocumentImpl doc)
Store a document into the database. |
void |
sync()
Description of the Method |
void |
update(NodeImpl node)
Update a node's data. |
Methods inherited from class org.exist.storage.DBBroker |
getAllDocuments, getBrokerPool, getConfiguration, getDocument, getDocumentsByCollection, getDocumentsByDoctype, getDOMIterator, getOrCreateCollection, isCaseSensitive, removeCollection, removeDocument |
Methods inherited from class java.util.Observable |
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int BUFFERS
protected static int MEM_LIMIT_CHECK
protected CollectionStore collectionsDb
protected DOMFile domDb
protected NativeElementIndex elementIndex
protected ElementPool elementPool
protected BFile elementsDb
protected BFile namespacesDb
protected NativeTextEngine textEngine
protected Serializer xmlSerializer
protected static SymbolTable symbols
protected org.apache.oro.text.regex.PatternCompiler compiler
protected org.apache.oro.text.regex.PatternMatcher matcher
protected int defaultIndexDepth
protected java.util.Map idxPathMap
protected boolean readOnly
protected int memMinFree
protected int nodesCount
Constructor Detail |
public NativeBroker(BrokerPool pool, Configuration config) throws EXistException
config
- Description of the Parameter
EXistException
- Description of the ExceptionMethod Detail |
protected static final java.lang.String normalizeCollectionName(java.lang.String name)
public void addObserver(java.util.Observer o)
public Occurrences[] scanIndexedElements(User user, Collection collection, boolean inclusive) throws PermissionDeniedException
scanIndexedElements
in class DBBroker
PermissionDeniedException
public NodeSet findElementsByTagName(DocumentSet docs, java.lang.String tagName)
findElementsByTagName
in class DBBroker
docs
- Description of the ParametertagName
- Description of the Parameter
public void flush()
DBBroker
flush
in class DBBroker
public void endRemove()
endRemove
in class DBBroker
public DocumentSet getAllDocuments(User user)
getAllDocuments
in class DBBroker
user
- Description of the Parameter
public NodeSet getAttributesByName(DocumentSet docs, java.lang.String name)
getAttributesByName
in class DBBroker
docs
- Description of the Parametername
- Description of the Parameter
public Collection getCollection(java.lang.String name)
DBBroker
getCollection
in class DBBroker
name
- Description of the Parameter
public Collection getCollection(java.lang.String name, long addr)
getCollection
in class DBBroker
name
- Description of the Parameter
public static SymbolTable getSymbols()
protected static SymbolTable loadSymbols(BFile namespacesDb)
public java.util.Iterator getDOMIterator(NodeProxy proxy)
DBBroker
getDOMIterator
in class DBBroker
proxy
- Description of the Parameter
public java.util.Iterator getNodeIterator(NodeProxy proxy)
getNodeIterator
in class DBBroker
public int getDatabaseType()
DBBroker
getDatabaseType
in class DBBroker
public org.w3c.dom.Document getDocument(User user, java.lang.String fileName) throws PermissionDeniedException
getDocument
in class DBBroker
fileName
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic DocumentSet getDocumentsByCollection(User user, java.lang.String collection) throws PermissionDeniedException
DBBroker
getDocumentsByCollection
in class DBBroker
collection
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic DocumentSet getDocumentsByCollection(User user, java.lang.String collection, boolean inclusive) throws PermissionDeniedException
DBBroker
getDocumentsByCollection
in class DBBroker
collection
- Description of the Parameterinclusive
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic DocumentSet getDocumentsByDoctype(User user, java.lang.String doctypeName)
getDocumentsByDoctype
in class DBBroker
doctypeName
- Description of the Parameteruser
- Description of the Parameter
public java.lang.String getNamespacePrefix(java.lang.String namespace)
DBBroker
getNamespacePrefix
in class DBBroker
namespace
- Description of the Parameter
public java.lang.String getNamespaceURI(java.lang.String prefix)
DBBroker
getNamespaceURI
in class DBBroker
prefix
- Description of the Parameter
protected short getNextCollectionId() throws ReadOnlyException
ReadOnlyException
public int getNextDocId(Collection collection)
getNextDocId
in class DBBroker
collection
- Description of the Parameter
public void index(NodeImpl node)
index
in class DBBroker
public void reindex(DocumentImpl oldDoc, DocumentImpl doc, NodeImpl node)
reindex
in class DBBroker
public java.lang.String getNodeValue(NodeProxy proxy)
DBBroker
getNodeValue
in class DBBroker
proxy
- Description of the Parameter
public NodeSet[] getNodesContaining(DocumentSet docs, java.lang.String[] termList, int type)
getNodesContaining
in class DBBroker
docs
- Description of the ParametertermList
- Description of the Parametertype
- Description of the Parameter
public NodeSet[] getNodesContaining(DocumentSet docs, java.lang.String[] termList)
DBBroker
getNodesContaining
in class DBBroker
docs
- the set of documents to search throughtermList
- an array of search terms. a query is executed for each of
them
public NodeSet getNodesEqualTo(NodeSet context, DocumentSet docs, int relation, java.lang.String expr)
getNodesEqualTo
in class DBBroker
context
- Description of the Parameterdocs
- Description of the Parameterrelation
- Description of the Parameterexpr
- Description of the Parameter
public Collection getOrCreateCollection(User user, java.lang.String name) throws PermissionDeniedException
getOrCreateCollection
in class DBBroker
name
- the collection's nameuser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic org.w3c.dom.NodeList getRange(org.w3c.dom.Document doc, long first, long last)
getRange
in class DBBroker
doc
- the documentfirst
- node-id of the first nodelast
- node-id of the last node
public Serializer getSerializer()
DBBroker
getSerializer
in class DBBroker
public TextSearchEngine getTextEngine()
DBBroker
getTextEngine
in class DBBroker
public Serializer newSerializer()
DBBroker
newSerializer
in class DBBroker
public org.w3c.dom.Node objectWith(org.w3c.dom.Document doc, long gid)
DBBroker
objectWith
in class DBBroker
doc
- the document the node belongs togid
- the node's unique identifier
public org.w3c.dom.Node objectWith(NodeProxy p)
objectWith
in class DBBroker
public void registerNamespace(java.lang.String namespace, java.lang.String prefix)
DBBroker
registerNamespace
in class DBBroker
namespace
- Description of the Parameterprefix
- Description of the Parameterpublic boolean removeCollection(User user, java.lang.String name) throws PermissionDeniedException
DBBroker
removeCollection
in class DBBroker
name
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic void removeDocument(User user, java.lang.String docName) throws PermissionDeniedException
DBBroker
removeDocument
in class DBBroker
docName
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic void removeNode(NodeImpl node, java.lang.String currentPath)
removeNode
in class DBBroker
public void addDocument(Collection collection, DocumentImpl doc) throws PermissionDeniedException
addDocument
in class DBBroker
PermissionDeniedException
public void saveCollection(Collection collection) throws PermissionDeniedException
DBBroker
saveCollection
in class DBBroker
collection
- Description of the Parameter
PermissionDeniedException
public static void saveSymbols(BFile namespacesDb)
protected NodeSet scanSequential(NodeSet context, DocumentSet doc, int relation, int truncation, java.lang.String expr)
context
- Description of the Parameterdoc
- Description of the Parameterrelation
- Description of the Parametertruncation
- Description of the Parameterexpr
- Description of the Parameter
public void shutdown()
DBBroker
shutdown
in class DBBroker
public void store(NodeImpl node, java.lang.CharSequence currentPath)
store
in class DBBroker
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 storeDocument(DocumentImpl doc)
DBBroker
storeDocument
in class DBBroker
doc
- Description of the Parameterpublic void readDocumentMetadata(DocumentImpl doc)
readDocumentMetadata
in class DBBroker
public void sync()
DBBroker
sync
in class DBBroker
public void closeDocument()
closeDocument
in class DBBroker
public void update(NodeImpl node)
DBBroker
update
in class DBBroker
node
- Description of the Parameterpublic void insertAfter(NodeImpl previous, NodeImpl node)
insertAfter
in class DBBroker
public boolean isReadOnly()
DBBroker
isReadOnly
in class DBBroker
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |