See: Description
Class | Description |
---|---|
DBElement |
DBElement class extends tigase.xml.Element . |
DBElementFactory |
DBElementFactory is implementation of factory design pattern
required by XML DOM builder to create proper
Element instances for tree nodes. |
Types |
Describe class Types here.
|
XMLDB |
XMLDB is the main database access class. |
Enum | Description |
---|---|
Types.DataType |
Describe class DataType here.
|
Exception | Description |
---|---|
NodeExistsException |
This exception is thrown when user tries to add subnode with name which
already exists in data base.
|
NodeNotFoundException |
Exception is thrown when user tries to access non-existen node on 1st level.
|
XMLDBException |
This is parrent exception for all data base related exceptions.
|
This data base implementation is very simple but also very handy. It simple
because it reads whole data base file into memory to operate on data. It
allows to store and retrieve only text or character string data.
Data base is kept in XML file. This gives us a few nice benefits:
As a whole data base is kept in memory it is not good for storring large number of data in one file. But it is very fast. It is good especially for storring configuration or data which are similar in their nature to LDAP supporting data bases. You don't have to worry about saving data. Each time you add new item to data base it take care about saving them to permanent storage.
XMLDB
is the main data base access class.
It allows you to create new data base in given file, open data base from
given file, add, delete and retrieve data and data lists. All data or data
lists are stored in data base nodes. There are three possible kinds of nodes
for each data base:
root
' is used.node
' is used.node
' element name and this can't
be changed.All node1 nodes and subnodes can contains any number of
data associated with keys. With some keys there ca be more than one value
assigned. Such kind of data are called data lists.
Although element name for subnode can not be defined it is actually not
important. Because data base user doesn't use subnode element names. He doesn't
even use neiher root node element name nor node1 element
name. Data base user uses node name what is quite different
from node element name. Let see example below:
<node name='roster'/>
In this example node element name is node and
node name is roster.
Data base users (actually developers) use only node names.
If you want to access subnode on some level you need to give full path to
this subnode. For example, let's assume we have following data base:
<node name='tigase'> <node name='server'> </node> <node name='xmpp'> </node> </node>
If you need to access 'server
' subnode you need to call method
with '/tigase/server
' as subnode path and for subnode
'xmpp
' proper subnode path is of course
'/tigase/xmpp
'. If you skip subnode path or give
null
as a parameter you will be accessing data on node1
level. You can not access or save data on root node level.
DBElement
class extends tigase.xml.Element
. It
adds some extra functionality useful for data base operations like searching
for some specific nodes, add data entries, remove data, and all other common
operations not directly related to pure XML processing. Pure
XML processing is of course implemented in
tigase.xml.Element
. The are also some methods which make it
easier to save XML tree from memory to disk file in a form which is
easier to read by a human.
DBElementFactory
is implementation of factory design pattern
required by XML DOM builder to create proper
Element
instances for tree nodes.
Copyright © 2019 "Tigase, Inc.". All rights reserved.