|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - The data record typepublic interface RecordLoader<T extends DataRecord>
This interface defines a mechanism for loading and saving data records from an arbitrary storage engine, most likely an SQL database of some kind. The backing store could potentially be something like a file or RPC server as well.
| Method Summary | |
|---|---|
void |
changed(T changedRecord)
accept a notification from a record that it has been changed. |
void |
initializeStorage(String storageURL)
Prepare the RecordLoader for accessing a given storage medium. |
boolean |
isRealtime()
|
T |
loadRecord(int id)
Load the record with the given ID number from the storage system |
T |
loadRecord(String identifier)
Load the data record identified from the storage system. |
void |
refresh(T record)
Refreshes the record: Re-read the contents of the database into the given record. |
void |
removeRecord(T record)
|
void |
saveRecord(T record)
Save a record back to the storage system |
| Methods inherited from interface org.starhope.util.HasSubversionRevision |
|---|
getSubversionRevision |
| Method Detail |
|---|
void changed(T changedRecord)
changedRecord - the record that has been changed
void initializeStorage(String storageURL)
throws NotReadyException
storageURL - A URL or identifier of the storage engine. The
syntax is specific to the RecordLoader implementation.
NotReadyException - if the storage engine can't be
initialisedboolean isRealtime()
T loadRecord(int id)
throws NotFoundException
id - the ID number for the record
NotFoundException - if the record can't be loaded
T loadRecord(String identifier)
throws NotFoundException
identifier - the identifier for the record
NotFoundException - if the record can't be loadedvoid refresh(T record)
SimpleDataRecord.checkStale() to try to reload data when
it might have been changed: it's trading elegance and efficiency
for expediency, but eventually, it should be removed.
record - the record to be reloaded.void removeRecord(T record)
record - Record to be deleted/removedvoid saveRecord(T record)
record - the record to be saved
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||