javax.rad.model
Interface IDataSource

All Known Implementing Classes:
MemDataSource, RemoteDataSource

public interface IDataSource

The IDataSource defines the methods to access any kind of table oriented IDataSource: e.g. a database, XML file, ...

Its used in the IDataPage/IDataBook to read and save data from/to the IDataSource.

See Also:
IDataPage, IDataBook

Method Summary
 void addDataBook(IDataBook pDataBook)
          Register a IDataBook at the IDataSource.
 void close()
          It closes the IDataSource and all its IDataBooks.
 IDataBook[] getDataBooks()
          Returns all registered IDataBooks from the IDataSource.
 IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
          Returns the current write back isolation level.
 boolean isOpen()
          Returns if the IDataSource is open.
 void open()
          It opens the IDataSource.
 void reloadAllDataBooks()
          It removes all changes from all IDataBook's till last storeAllDataBooks() call.
 void removeDataBook(IDataBook pDataBook)
          Unregister a IDataBook at the IDataSource.
 void restoreAllDataBooks()
          It removes all changes from all IDataBook's till last storeAllDataBooks() call.
 void saveAllDataBooks()
          It saves all changes from all IDataBook's to the IDataSource.
 void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
          Sets when the IDataSource needs to write back the data to the storage.
 

Method Detail

open

void open()
          throws ModelException
It opens the IDataSource.

Throws:
ModelException - if the open dosn't work out.

isOpen

boolean isOpen()
Returns if the IDataSource is open. IDataBooks need to check on open if the used IDataSource is open.

Returns:
true if the IDataSource is open.

close

void close()
It closes the IDataSource and all its IDataBooks.


saveAllDataBooks

void saveAllDataBooks()
                      throws ModelException
It saves all changes from all IDataBook's to the IDataSource.
The recommended way to do this, is to call on every IDataBook storeAllRows().

Events:
It calls before the store on all registered IComponents the saveEditing() method, to set all changes to the DataBook before the store operation.

Throws:
ModelException - if not all changes could be stored in the IDataBook

reloadAllDataBooks

void reloadAllDataBooks()
                        throws ModelException
It removes all changes from all IDataBook's till last storeAllDataBooks() call. The recommended way to do this, is to call on every IDataBook restoreAllRows().

Events:
It calls before the restore on all registered IComponents the cancelEditing() method, to cancel the editing mode of the GUI control.

Throws:
ModelException - if not all changes could be restored in the IDataBook

restoreAllDataBooks

void restoreAllDataBooks()
                         throws ModelException
It removes all changes from all IDataBook's till last storeAllDataBooks() call.

Events:
It calls before the restore on all registered IComponents the cancelEditing() method, to cancel the editing mode of the GUI control.

Throws:
ModelException - if not all changes could be restored in the IDataBook

addDataBook

void addDataBook(IDataBook pDataBook)
Register a IDataBook at the IDataSource.

Parameters:
pDataBook - the new IDataBook to register

removeDataBook

void removeDataBook(IDataBook pDataBook)
Unregister a IDataBook at the IDataSource.

Parameters:
pDataBook - the IDataBook to unregister

getDataBooks

IDataBook[] getDataBooks()
Returns all registered IDataBooks from the IDataSource.

Returns:
all registered IDataBooks from the IDataSource.

setWritebackIsolationLevel

void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
Sets when the IDataSource needs to write back the data to the storage.
The default write back isolation level is DATA_ROW.

Parameters:
pIsolationLevel - the new write back isolation level.
See Also:
IDataBook.WriteBackIsolationLevel

getWritebackIsolationLevel

IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
Returns the current write back isolation level.

Returns:
the current write back isolation level.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.