|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.model.mem.DataRow
com.sibvisions.rad.model.mem.ChangeableDataRow
com.sibvisions.rad.model.mem.MemDataBook
com.sibvisions.rad.model.remote.RemoteDataBook
public class RemoteDataBook
The RemoteDataBook is a storage independent table, and handles all operations
based on the the MemDatabook base class.
It communicates to the IStorage and uses the storage methods to fetch, insert
update, delete the data on server.
MemDataBook,
IDataPage,
IDataBook,
IRowDefinition,
IChangeableDataRow,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.rad.model.IDataBook |
|---|
IDataBook.SelectionMode, IDataBook.WriteBackIsolationLevel |
| Field Summary |
|---|
| Fields inherited from class com.sibvisions.rad.model.mem.MemDataBook |
|---|
bMemFilter, bMemSort, rootDataBook, rowInstance1, rowInstance2 |
| Fields inherited from class com.sibvisions.rad.model.mem.ChangeableDataRow |
|---|
DELETING, DETAILS_CHANGED, dpDataPage, INSERTING, INTERNAL_OFFSET, iRowIndex, UPDATING, WRITABLE_COLUMN_CHANGED |
| Fields inherited from class com.sibvisions.rad.model.mem.DataRow |
|---|
oaStorage, rdRowDefinition |
| Constructor Summary | |
|---|---|
RemoteDataBook()
Creates a new instance of RemoteDataBook. |
|
| Method Summary | |
|---|---|
void |
close()
Closes this IDataBook. |
protected MemDataPage |
createDataPage(IDataRow pMasterDataRow)
It constructs a new MemDataPage. |
protected void |
executeDelete(IChangeableDataRow pDataRow)
Its called when the deleting DataRow (delete row) should be deleted. |
protected IDataRow |
executeInsert(IChangeableDataRow pDataRow)
Its called when the inserting DataRow (new row) should be inserted. |
protected IDataRow |
executeLockAndRefetch(IChangeableDataRow pDataRow)
Its called before the DataRow (existing row) will be changed. |
protected void |
executeRefresh()
It will be called, when the MemDataBook will be completely refreshed. |
protected void |
executeRefreshDataPage()
It will be called, when the MemDataBook will be completely refreshed. |
protected IDataRow |
executeUpdate(IChangeableDataRow pDataRow)
Its called when the updating DataRow (changed row) should be updated Derived classed should override this to implemented the needed functionality. |
java.lang.String[] |
getBlockFetchColumnNames()
Returns the block fetch columns. |
protected AbstractConnection |
getConnection()
Returns the AbstractConnection of the RemoteDataSource for this StorageDataSource. |
RemoteDataSource |
getDataSource()
Gets the IDataSource that is used. |
protected int[] |
getFetchColumnIndexes()
Returns the correct column indexes of the fetched data, after opening the data book. |
protected int |
getFetchedRowsForBlock(IDataRow pMasterDataRow)
Returns the amount of fetched rows per block. |
protected int[] |
getMasterColumnIndexesForBlock()
Returns the correct master column indexes of the fetched data, after opening the data book. |
protected java.lang.String[] |
getMetaDataColumnNames()
Returns the server meta data column names. |
protected boolean |
isCachingStorage()
Returns whether the server storage is a cached storage or a storage without cache. |
protected boolean |
isDataPageRefetchPossible()
This function is used for rehashing data pages after insert of the master row. |
boolean |
isFetchEnabled()
This can be used for performance tuning. |
boolean |
isMemFilter()
Returns true if the filter is handled in memory. |
boolean |
isMemSort()
Returns true if the sort is handled in memory. |
boolean |
isMetaDataCacheEnabled()
Gets whether metadata cache is enabled. |
boolean |
isWritebackEnabled()
Returns true if this data book should write its changes to the storage. |
void |
open()
Opens this IDataBook. |
void |
setBlockFetchColumnNames(java.lang.String[] pBlockFetchColumnNames)
Sets the block fetch columns. |
void |
setDataSource(IDataSource pDataSource)
Sets the IDataSource to use, which allows the IDataBook
to retrieve and set data. |
protected void |
setFetchedRowsForBlock(IDataRow pMasterDataRow,
int pFetchedRows)
Sets the amount of fetched rows per block. |
void |
setFetchEnabled(boolean pFetchEnabled)
This can be used for performance tuning. |
void |
setMemFilter(boolean pMemFilter)
Sets if the sort is handled in memory. |
void |
setMemSort(boolean pMemSort)
Sets if the sort is handled in memory. |
void |
setMetaDataCacheEnabled(boolean pCacheEnabled)
Sets the metadata cache enabled. |
void |
setWritebackEnabled(boolean pWritebackEnabled)
Sets if this data book should write back its changes to the storage. |
| Methods inherited from class com.sibvisions.rad.model.mem.ChangeableDataRow |
|---|
getOriginalRow, restore, setDeleting, setDetailChanged, setInserting, setUID, setUpdating, setValueIntern |
| Methods inherited from class com.sibvisions.rad.model.mem.DataRow |
|---|
compareTo, compareTo, createEmptyDataRow, createEmptyRow, equals, equals, eventValuesChanged, eventValuesChanged, getControls, getValueAsString, getValuesAsString, hasControls, hashCode, invokeCancelEditingControls, invokeRepaintListeners, invokeSaveEditingControls, removeControl, setDefaultValues, setValuesIntern |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.rad.model.IChangeableDataRow |
|---|
getOriginalRow |
| Methods inherited from interface javax.rad.model.IDataRow |
|---|
compareTo, createEmptyDataRow, createEmptyRow, equals, eventValuesChanged, eventValuesChanged, getControls, getValueAsString, getValuesAsString, removeControl |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public RemoteDataBook()
RemoteDataBook.
| Method Detail |
|---|
protected boolean isDataPageRefetchPossible()
isDataPageRefetchPossible in class MemDataBookprotected MemDataPage createDataPage(IDataRow pMasterDataRow)
createDataPage in class MemDataBookpMasterDataRow - the master IDataRow for this IDataPage.
public void setDataSource(IDataSource pDataSource)
throws ModelException
IDataSource to use, which allows the IDataBook
to retrieve and set data.
The IDataSource can only be set if the IDataBook is not
already open.
setDataSource in interface IDataBooksetDataSource in class MemDataBookpDataSource - the IDataSource to use.
ModelException - if the IDataBook is already
open.IDataBook.getDataSource(),
IDataSourcepublic RemoteDataSource getDataSource()
IDataSource that is used.
getDataSource in interface IDataBookgetDataSource in class MemDataBookIDataSource that is used.IDataBook.setDataSource(IDataSource),
IDataSource
public void open()
throws ModelException
IDataBook.
"Open" means that all actions are performed which are needed to deliver
data to the user, an IDataBook that is open can be used for
querying and changing data.
Implementations should perform all needed set up work in this method (like reading metadata from the storage).
open in interface IDataBookopen in class MemDataBookModelException - if there is no name set, or if
there is no column in the row
definition, or if there is no IDataBook.getDataSource() set.public void close()
IDataBook.
A closed IDataBook has the same state as an not
open IDataBook. It can't be used to
query or change data, but it can be reopened.
Implementations should performs all clean up in this method and the (cached) data can be discarded at this point.
close in interface IDataBookclose in class MemDataBook
protected IDataRow executeLockAndRefetch(IChangeableDataRow pDataRow)
throws ModelException
executeLockAndRefetch in class MemDataBookpDataRow - the data row to lock
ModelException - if an ModelException occur during insert.
protected IDataRow executeInsert(IChangeableDataRow pDataRow)
throws ModelException
executeInsert in class MemDataBookpDataRow - the data row to insert
ModelException - if an ModelException occur during insert.
protected IDataRow executeUpdate(IChangeableDataRow pDataRow)
throws ModelException
executeUpdate in class MemDataBookpDataRow - the data row to update
ModelException - if an ModelException occur during update.
protected void executeDelete(IChangeableDataRow pDataRow)
throws ModelException
executeDelete in class MemDataBookpDataRow - the data row to delete
ModelException - if an ModelException occur during delete.
protected void executeRefresh()
throws ModelException
executeRefresh in class MemDataBookModelException - if an ModelExcpetion happen during refresh
protected void executeRefreshDataPage()
throws ModelException
executeRefreshDataPage in class MemDataBookModelException - if an ModelExcpetion happen during refreshpublic void setMemSort(boolean pMemSort)
setMemSort in class MemDataBookpMemSort - true if the sort is handled in memory.public boolean isMemSort()
isMemSort in class MemDataBookpublic void setMemFilter(boolean pMemFilter)
setMemFilter in class MemDataBookpMemFilter - true if the filter is handled in memory.public boolean isMemFilter()
isMemFilter in class MemDataBookpublic void setWritebackEnabled(boolean pWritebackEnabled)
setWritebackEnabled in class MemDataBookpWritebackEnabled - determines if changes should be written to the store.public boolean isWritebackEnabled()
isWritebackEnabled in class MemDataBookpublic boolean isFetchEnabled()
public void setFetchEnabled(boolean pFetchEnabled)
pFetchEnabled - true, if calling fetch on server is enabledpublic java.lang.String[] getBlockFetchColumnNames()
public void setBlockFetchColumnNames(java.lang.String[] pBlockFetchColumnNames)
throws ModelException
pBlockFetchColumnNames - the block fetch columns.
ModelException - if the data book is already open.public void setMetaDataCacheEnabled(boolean pCacheEnabled)
pCacheEnabled - true to enable the cachepublic boolean isMetaDataCacheEnabled()
true if the cache is enabled, false otherwiseprotected java.lang.String[] getMetaDataColumnNames()
protected int[] getFetchColumnIndexes()
protected int[] getMasterColumnIndexesForBlock()
protected int getFetchedRowsForBlock(IDataRow pMasterDataRow)
throws ModelException
pMasterDataRow - the master data row.
ModelException - if it fails.
protected void setFetchedRowsForBlock(IDataRow pMasterDataRow,
int pFetchedRows)
throws ModelException
pMasterDataRow - the master data row.pFetchedRows - the amount of fetched rows per block.
ModelException - if it fails.protected AbstractConnection getConnection()
protected boolean isCachingStorage()
true if the server storage uses a cache, false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||