|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface implemented by objects that manage a collection of records.
Method Summary | |
void |
addDataListener(DataListener dl)
Add a listener that gets notified if ever a record is inserted, updated or deleted. |
void |
close()
A method that should be called to free any resources associated with the data source. |
Record |
delete(Record rec)
Delete a record. |
Record |
delete(java.lang.String type,
java.lang.Object key)
Delete a record. |
Record |
get(java.lang.Object key)
|
Record |
get(java.lang.String type,
java.lang.Object key)
|
java.lang.String |
getName()
|
void |
init(java.util.Properties props)
A method that initializes a DataSource with a set of initialization properties. |
Record |
insert(Record rec)
Adds a new record to the managed pool. |
java.util.List |
keys()
This is equivalent to calling keys(null) where no record type is specified. |
java.util.List |
keys(java.lang.String type)
|
java.util.List |
lookup(java.lang.Object lookupKey)
Some datasources may support a multiple lookup by key functionality. |
void |
reload(org.xml.sax.InputSource input)
loads data from an InputSource, meant to be used in a startup phase. |
void |
reload(Record rec)
loads a Record without any notification to listeners or any synchronization. |
void |
removeDataListener(DataListener dl)
Remove a listener that gets notified if ever a record is inserted, updated or deleted. |
java.util.List |
select(RecordFilter filter)
This is equivalent to calling select(filter, null) |
java.util.List |
select(RecordFilter filter,
RecordComparator comparator)
Fetches a list of records matching filter. |
Record |
update(Record oldRec,
Record newRec)
Replaces an existing version of a record with a new updated version. |
void |
wipeCache()
If this data source is backed by some external mechanism, like an RDBMS, wipes the in-memory cache, if one is being maintained. |
void |
writeElement(java.io.Writer writer,
java.lang.String type,
java.lang.Object key,
boolean recurse)
This is used to write out an XML tree. |
void |
writeSnapshot(java.io.OutputStream out)
This method outputs the entire contents of the data source as an XML tree. |
Methods inherited from interface org.oreodata.DataListener |
handleEvent |
Method Detail |
public java.util.List keys() throws java.io.IOException
java.io.IOException
public java.util.List keys(java.lang.String type) throws java.io.IOException
type
- the record type we are interested,
under some circumstances, this may be null.
java.io.IOException
public void init(java.util.Properties props) throws java.io.IOException
init
in interface DataListener
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void wipeCache() throws java.io.IOException
java.io.IOException
public java.lang.String getName() throws java.io.IOException
java.io.IOException
public Record get(java.lang.Object key) throws java.io.IOException
key
- the lookup key
method that exists for backward compatibility
This is equivalent to get(null, key);
java.io.IOException
public Record get(java.lang.String type, java.lang.Object key) throws java.io.IOException
type
- the type of the record, if this is null,
then any type will do.key
- the lookup key
java.io.IOException
public Record insert(Record rec) throws java.io.IOException
rec
- the record to add
DuplicateRecordException
- if another record already exists
with same primary key as 'rec'.
java.io.IOException
- if the record cannot be
initialized (i.e. has missing fields or invalid
field values, etc.), or in case of a low-level error.public Record update(Record oldRec, Record newRec) throws java.io.IOException
oldRec
- the record to replace.newRec
- the new record.
java.io.IOException
- thrown in case of any other database or
communication error.public Record delete(Record rec) throws java.io.IOException
rec
- the record to delete.
java.io.IOException
public Record delete(java.lang.String type, java.lang.Object key) throws java.io.IOException
type
- the type of the record, if this is null,
then any type will do.key
- the primary key of the record to delete.
java.io.IOException
public java.util.List select(RecordFilter filter) throws java.io.IOException
select(filter, null)
java.io.IOException
public java.util.List select(RecordFilter filter, RecordComparator comparator) throws java.io.IOException
filter
- the record filter, or null.comparator
- defines an ordering for the records.
java.io.IOException
public void reload(Record rec) throws java.io.IOException
java.io.IOException
public void addDataListener(DataListener dl) throws java.io.IOException
dl
- the listener
java.io.IOException
public void removeDataListener(DataListener dl) throws java.io.IOException
dl
- the listener
java.io.IOException
public void writeSnapshot(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void writeElement(java.io.Writer writer, java.lang.String type, java.lang.Object key, boolean recurse) throws java.io.IOException
writer
- the character stream to write to.type
- the record type.key
- the primary key of the record.recurse
- whether to write out the child elements recursively (if
this applies)
java.io.IOException
public void reload(org.xml.sax.InputSource input) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public java.util.List lookup(java.lang.Object lookupKey) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |