javax.rad.model
Interface IDataSource

All Known Implementing Classes:
MemDataSource, RemoteDataSource

public interface IDataSource

The IDataSource is a storage independent way to access table oriented data, or any data that can be approximately represented as table.

See Also:
IDataBook

Method Summary
 void addDataBook(IDataBook pDataBook)
          Adds the given IDataBook.
 void close()
          Closes this IDataSource.
 DataSourceHandler eventDataBookAdded()
          Gets the DataSourceHandler for databook added event.
 DataSourceHandler eventDataBookRemoved()
          Gets the DataSourceHandler for databook removed event.
 IDataBook getDataBook(java.lang.String pName)
          Gets the (first) IDataBook with the given name.
 IDataBook[] getDataBooks()
          Gets all the IDataBooks which have been added to this IDataSource.
 IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
          Gets the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.
 boolean isOpen()
          Gets if this IDataSource is open.
 void open()
          Opens this IDataSource so that it can be used.
 void reloadAllDataBooks()
          Reloads all added IDataBooks by invoking IDataBook.reload().
 void removeDataBook(IDataBook pDataBook)
          Removes the given IDataBook.
 void restoreAllDataBooks()
          Restores all added IDataBooks by invoking IDataBook.restoreAllRows().
 void saveAllDataBooks()
          Saves all changes in the added IDataBooks by invoking IDataBook.saveAllRows().
 void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
          Sets the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.
 

Method Detail

open

void open()
          throws ModelException
Opens this IDataSource so that it can be used. Only an open IDataSource can be used.

Implementing classes should perform their set up work here.

Throws:
ModelException - if there was an error during opening.
See Also:
close(), isOpen()

isOpen

boolean isOpen()
Gets if this IDataSource is open.

Only an open IDataSource is a usable IDataSource.

Returns:
true if this IDataSource is open.
See Also:
open()

close

void close()
Closes this IDataSource. A closed IDataSource can no longer be used, however it can always be reopened.

Implementing classes should perform their clean up work here. It closes the IDataSource and all its IDataBooks.

See Also:
isOpen(), open()

saveAllDataBooks

void saveAllDataBooks()
                      throws ModelException
Saves all changes in the added IDataBooks by invoking IDataBook.saveAllRows().

Throws:
ModelException - if the changes could not be saved.
See Also:
reloadAllDataBooks(), restoreAllDataBooks(), IDataBook.saveAllRows()

reloadAllDataBooks

void reloadAllDataBooks()
                        throws ModelException
Reloads all added IDataBooks by invoking IDataBook.reload().

Throws:
ModelException - if the IDataBooks could not be reloaded.
See Also:
restoreAllDataBooks(), saveAllDataBooks(), IDataBook.reload()

restoreAllDataBooks

void restoreAllDataBooks()
                         throws ModelException
Restores all added IDataBooks by invoking IDataBook.restoreAllRows().

Throws:
ModelException - if the IDataBooks could not be restored.
See Also:
reloadAllDataBooks(), saveAllDataBooks(), IDataBook.restoreAllRows()

addDataBook

void addDataBook(IDataBook pDataBook)
Adds the given IDataBook.

Parameters:
pDataBook - the IDataBook to add.

removeDataBook

void removeDataBook(IDataBook pDataBook)
Removes the given IDataBook.

Parameters:
pDataBook - the given IDataBook to remove.

getDataBooks

IDataBook[] getDataBooks()
Gets all the IDataBooks which have been added to this IDataSource.

Returns:
all the IDataBooks which have been added to this IDataSource.

getDataBook

IDataBook getDataBook(java.lang.String pName)
Gets the (first) IDataBook with the given name.

Parameters:
pName - the name of the IDataBook to get.
Returns:
the (first) IDataBook with the given name, null if none was found.

setWritebackIsolationLevel

void setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel pIsolationLevel)
Sets the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.

The default IDataBook.WriteBackIsolationLevel is IDataBook.WriteBackIsolationLevel.DATA_ROW.

Parameters:
pIsolationLevel - the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.
See Also:
getWritebackIsolationLevel()

getWritebackIsolationLevel

IDataBook.WriteBackIsolationLevel getWritebackIsolationLevel()
Gets the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.

The default IDataBook.WriteBackIsolationLevel is IDataBook.WriteBackIsolationLevel.DATA_ROW.

Returns:
the default IDataBook.WriteBackIsolationLevel for all added IDataBooks.
See Also:
setWritebackIsolationLevel(IDataBook.WriteBackIsolationLevel)

eventDataBookAdded

DataSourceHandler eventDataBookAdded()
Gets the DataSourceHandler for databook added event.

This event is fired if an IDataBook has been added.

Returns:
the DataSourceHandler for databook added event.

eventDataBookRemoved

DataSourceHandler eventDataBookRemoved()
Gets the DataSourceHandler for databook removed event.

This event is fired if an IDataBook has been removed.

Returns:
the DataSourceHandler for databook removed event.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.