|
||||||||
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 other components rely on the methods defined here.
Field Summary | |
protected boolean |
caseSensitive
|
protected Configuration |
config
|
static int |
DBM
|
static int |
MATCH_EXACT
|
static int |
MATCH_REGEXP
|
static int |
MATCH_WILDCARDS
|
static int |
MYSQL
|
static int |
NATIVE
|
static int |
ORACLE
|
protected BrokerPool |
pool
|
static int |
POSTGRESQL
|
Constructor Summary | |
DBBroker(BrokerPool pool,
Configuration config)
Constructor for the DBBroker object |
Method Summary | |
void |
addDocument(Collection collection,
DocumentImpl doc)
|
void |
closeDocument()
|
void |
endRemove()
|
abstract 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()
Gets the allDocuments attribute of the DBBroker object |
abstract DocumentSet |
getAllDocuments(User user)
get all the documents in this database repository. |
abstract NodeSet |
getAttributesByName(DocumentSet docs,
java.lang.String name)
find elements by their tag name. |
BrokerPool |
getBrokerPool()
|
abstract Collection |
getCollection(java.lang.String name)
Gets the collection attribute of the DBBroker object |
Collection |
getCollection(java.lang.String name,
long address)
|
Configuration |
getConfiguration()
get the configuration. |
abstract int |
getDatabaseType()
return the type of database this broker is connected to. |
org.w3c.dom.Document |
getDocument(java.lang.String fileName)
Gets the document attribute of the DBBroker object |
abstract org.w3c.dom.Document |
getDocument(User user,
java.lang.String fileName)
get a document by it's file name. |
DocumentSet |
getDocumentsByCollection(java.lang.String collection)
Gets the documentsByCollection attribute of the DBBroker object |
abstract DocumentSet |
getDocumentsByCollection(User user,
java.lang.String collection)
Gets the documentsByCollection attribute of the DBBroker object |
abstract DocumentSet |
getDocumentsByCollection(User user,
java.lang.String collection,
boolean inclusive)
Gets the documentsByCollection attribute of the DBBroker object |
DocumentSet |
getDocumentsByDoctype(java.lang.String doctype)
Gets the documentsByDoctype attribute of the DBBroker object |
abstract 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(org.w3c.dom.Document doc,
long gid)
Gets the dOMIterator attribute of the DBBroker object |
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. |
abstract int |
getNextDocId(Collection collection)
Gets the nextDocId attribute of the DBBroker object |
java.util.Iterator |
getNodeIterator(NodeProxy proxy)
|
abstract NodeSet[] |
getNodesContaining(DocumentSet doc,
java.lang.String[] expr)
get all the nodes containing the search terms given by the array expr using the fulltext-index. |
NodeSet[] |
getNodesContaining(DocumentSet doc,
java.lang.String[] expr,
int type)
Gets the nodesContaining attribute of the DBBroker object |
abstract NodeSet |
getNodesEqualTo(NodeSet context,
DocumentSet docs,
int relation,
java.lang.String expr)
find all Nodes whose string value is equal to expr in the document set. |
java.lang.String |
getNodeValue(NodeProxy proxy)
Gets the nodeValue attribute of the DBBroker object |
Collection |
getOrCreateCollection(java.lang.String name)
Gets the orCreateCollection attribute of the DBBroker object |
Collection |
getOrCreateCollection(User user,
java.lang.String name)
Retrieve a collection by name. |
abstract org.w3c.dom.NodeList |
getRange(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 Serializer |
getSerializer()
get an instance of the Serializer used for converting nodes back to XML. |
static SymbolTable |
getSymbols()
|
abstract TextSearchEngine |
getTextEngine()
get the TextSearchEngine associated with this broker. |
void |
index(NodeImpl node)
|
void |
insertAfter(NodeImpl previous,
NodeImpl node)
|
boolean |
isCaseSensitive()
Gets the caseSensitive attribute of the DBBroker object |
boolean |
isReadOnly()
Is the database running read-only? Returns false by default. |
abstract Serializer |
newSerializer()
Description of the Method |
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)
|
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(java.lang.String name)
Description of the Method |
abstract boolean |
removeCollection(User user,
java.lang.String name)
Description of the Method |
void |
removeDocument(java.lang.String docName)
Description of the Method |
abstract void |
removeDocument(User user,
java.lang.String docName)
remove the document with the given document name. |
void |
removeNode(NodeImpl node,
java.lang.String currentPath)
|
abstract void |
saveCollection(Collection collection)
Store a collection into the database. |
Occurrences[] |
scanIndexedElements(User user,
Collection collection,
boolean inclusive)
|
void |
shutdown()
shutdown the broker. |
abstract void |
store(NodeImpl node,
java.lang.CharSequence currentPath)
Store a node into the database. |
abstract 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 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, toString, 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 MYSQL
public static final int NATIVE
public static final int ORACLE
public static final int POSTGRESQL
public static final int DBM
protected boolean caseSensitive
protected Configuration config
protected BrokerPool pool
Constructor Detail |
public DBBroker(BrokerPool pool, Configuration config)
config
- Description of the ParameterMethod Detail |
public abstract NodeSet findElementsByTagName(DocumentSet docs, java.lang.String tagName)
docs
- Description of the ParametertagName
- Description of the Parameter
public void flush()
public DocumentSet getAllDocuments()
public abstract DocumentSet getAllDocuments(User user)
user
- Description of the Parameter
public abstract NodeSet getAttributesByName(DocumentSet docs, java.lang.String name)
docs
- Description of the Parametername
- Description of the Parameter
public abstract Collection getCollection(java.lang.String name)
name
- Description of the Parameter
public Collection getCollection(java.lang.String name, long address)
public Configuration getConfiguration()
public java.util.Iterator getDOMIterator(org.w3c.dom.Document doc, long gid)
doc
- Description of the Parametergid
- Description of the Parameter
public java.util.Iterator getDOMIterator(NodeProxy proxy)
proxy
- Description of the Parameter
public java.util.Iterator getNodeIterator(NodeProxy proxy)
public abstract int getDatabaseType()
public org.w3c.dom.Document getDocument(java.lang.String fileName) throws PermissionDeniedException
fileName
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract org.w3c.dom.Document getDocument(User user, java.lang.String fileName) throws PermissionDeniedException
fileName
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic DocumentSet getDocumentsByCollection(java.lang.String collection) throws PermissionDeniedException
collection
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract DocumentSet getDocumentsByCollection(User user, java.lang.String collection) throws PermissionDeniedException
collection
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract DocumentSet getDocumentsByCollection(User user, java.lang.String collection, boolean inclusive) throws PermissionDeniedException
collection
- Description of the Parameterinclusive
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic DocumentSet getDocumentsByDoctype(java.lang.String doctype)
doctype
- Description of the Parameter
public abstract DocumentSet getDocumentsByDoctype(User user, java.lang.String doctypeName)
doctypeName
- Description of the Parameteruser
- Description of the Parameter
public java.lang.String getNamespacePrefix(java.lang.String namespace)
namespace
- Description of the Parameter
public java.lang.String getNamespaceURI(java.lang.String prefix)
prefix
- Description of the Parameter
public abstract int getNextDocId(Collection collection)
collection
- Description of the Parameter
public java.lang.String getNodeValue(NodeProxy proxy)
proxy
- Description of the Parameter
public abstract NodeSet[] getNodesContaining(DocumentSet doc, java.lang.String[] expr)
doc
- the set of documents to search throughexpr
- an array of search terms. a query is executed for each of
them
public NodeSet[] getNodesContaining(DocumentSet doc, java.lang.String[] expr, int type)
doc
- Description of the Parameterexpr
- Description of the Parametertype
- Description of the Parameter
public abstract NodeSet getNodesEqualTo(NodeSet context, DocumentSet docs, int relation, java.lang.String expr)
context
- Description of the Parameterdocs
- Description of the Parameterrelation
- Description of the Parameterexpr
- Description of the Parameter
public Collection getOrCreateCollection(java.lang.String name) throws PermissionDeniedException
name
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic Collection getOrCreateCollection(User user, java.lang.String name) throws PermissionDeniedException
name
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract org.w3c.dom.NodeList getRange(org.w3c.dom.Document doc, long first, long last)
doc
- the document the node's belong tofirst
- unique id of the first node to retrievelast
- unique id of the last node to retrieve
public abstract Serializer getSerializer()
public abstract TextSearchEngine getTextEngine()
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 identifier
public abstract org.w3c.dom.Node objectWith(NodeProxy p)
public void registerNamespace(java.lang.String namespace, java.lang.String prefix)
namespace
- Description of the Parameterprefix
- Description of the Parameterpublic boolean removeCollection(java.lang.String name) throws PermissionDeniedException
name
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract boolean removeCollection(User user, java.lang.String name) throws PermissionDeniedException
name
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic void removeDocument(java.lang.String docName) throws PermissionDeniedException
docName
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract void removeDocument(User user, java.lang.String docName) throws PermissionDeniedException
docName
- Description of the Parameteruser
- Description of the Parameter
PermissionDeniedException
- Description of the Exceptionpublic abstract void saveCollection(Collection collection) throws PermissionDeniedException
collection
- Description of the Parameter
PermissionDeniedException
public void addDocument(Collection collection, DocumentImpl doc) throws PermissionDeniedException
PermissionDeniedException
public void closeDocument()
public static SymbolTable getSymbols()
public void shutdown()
public abstract void store(NodeImpl node, java.lang.CharSequence currentPath)
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 abstract void storeDocument(DocumentImpl doc)
doc
- Description of the Parameterpublic void sync()
public void update(NodeImpl node)
node
- Description of the Parameterpublic boolean isReadOnly()
public BrokerPool getBrokerPool()
public void insertAfter(NodeImpl previous, NodeImpl node)
public void reindex(DocumentImpl oldDoc, DocumentImpl doc, NodeImpl node)
public void index(NodeImpl node)
public void removeNode(NodeImpl node, java.lang.String currentPath)
public void endRemove()
public Occurrences[] scanIndexedElements(User user, Collection collection, boolean inclusive) throws PermissionDeniedException
PermissionDeniedException
public void readDocumentMetadata(DocumentImpl doc)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |