com.sibvisions.rad.model.remote
Class RemoteDataSource

java.lang.Object
  extended by com.sibvisions.rad.model.mem.MemDataSource
      extended by com.sibvisions.rad.model.remote.RemoteDataSource
All Implemented Interfaces:
IDataSource

public class RemoteDataSource
extends MemDataSource

The RemoteDataSource is a remote DataSource for all RemoteDataBook's, which uses a connection to the server to forward the storage operation to server objects.

See Also:
RemoteDataBook, MemDataSource

Nested Class Summary
static class RemoteDataSource.MetaDataCacheRole
          The meta data cache roles.
 
Constructor Summary
RemoteDataSource()
          It constructs a new RemoteDataSource.
RemoteDataSource(AbstractConnection pConnection)
          It constructs a new RemoteDataSource with the given AbstractConnection.
 
Method Summary
static void clearGlobalMetaData()
          Clears the complete meta data cache.
static void clearGlobalMetaData(AbstractConnection pConnection)
          Clears the meta data cache for the given application.
 void clearMetaData()
          Clears the local meta data cache.
 AbstractConnection getConnection()
          Returns the AbstractConnection to the server IStorage object.
static MetaData getGlobalMetaData(AbstractConnection pConnection, String pKey)
          Returns the column meta data from the global client cache.
 MetaData getMetaData(String pKey)
          Returns the column meta data from the client cache.
static RemoteDataSource.MetaDataCacheRole getMetaDataCacheRole()
          Gets whether the global or the local cache is used.
 void open()
          It opens the IDataSource.
static void putGlobalMetaData(AbstractConnection pConnection, String pKey, MetaData pMetaData)
          Puts the column meta data to the global client cache.
 void putMetaData(String pKey, MetaData pMetaData)
          Puts the column meta data to the client cache.
 void setConnection(AbstractConnection pConnection)
          Sets the AbstractConnection to the server IStorage object.
static void setMetaDataCacheRole(RemoteDataSource.MetaDataCacheRole pCacheRole)
          Sets the global meta data cache role.
 
Methods inherited from class com.sibvisions.rad.model.mem.MemDataSource
addDataBook, close, finalize, getDataBooks, getWritebackIsolationLevel, isOpen, reloadAllDataBooks, removeDataBook, restoreAllDataBooks, saveAllDataBooks, setWritebackIsolationLevel, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteDataSource

public RemoteDataSource()
It constructs a new RemoteDataSource.


RemoteDataSource

public RemoteDataSource(AbstractConnection pConnection)
It constructs a new RemoteDataSource with the given AbstractConnection.

Parameters:
pConnection - the AbstractConnection to use for the communication to the server.
Method Detail

open

public void open()
          throws ModelException
It opens the IDataSource.

Specified by:
open in interface IDataSource
Overrides:
open in class MemDataSource
Throws:
ModelException - if the open dosn't work out.

getConnection

public AbstractConnection getConnection()
Returns the AbstractConnection to the server IStorage object.

Returns:
the AbstractConnection to the server IStorage object.

setConnection

public void setConnection(AbstractConnection pConnection)
Sets the AbstractConnection to the server IStorage object.

Parameters:
pConnection - the AbstractConnection to set

getMetaData

public MetaData getMetaData(String pKey)
Returns the column meta data from the client cache.

Parameters:
pKey - is the name of the meta data object
Returns:
the MetaData from the client cache

putMetaData

public void putMetaData(String pKey,
                        MetaData pMetaData)
Puts the column meta data to the client cache.

Parameters:
pKey - is the name of the meta data object
pMetaData - the MetaData to cache

clearMetaData

public void clearMetaData()
Clears the local meta data cache.


getGlobalMetaData

public static MetaData getGlobalMetaData(AbstractConnection pConnection,
                                         String pKey)
Returns the column meta data from the global client cache.

Parameters:
pConnection - the connection associated with cached metadata
pKey - is the name of the meta data object
Returns:
the MetaData from the client cache

putGlobalMetaData

public static void putGlobalMetaData(AbstractConnection pConnection,
                                     String pKey,
                                     MetaData pMetaData)
Puts the column meta data to the global client cache.

Parameters:
pConnection - the connection associated with cached metadata
pKey - is the name of the meta data object
pMetaData - the MetaData to cache

clearGlobalMetaData

public static void clearGlobalMetaData()
Clears the complete meta data cache.


clearGlobalMetaData

public static void clearGlobalMetaData(AbstractConnection pConnection)
Clears the meta data cache for the given application.

Parameters:
pConnection - the connection associated with cached metadata

setMetaDataCacheRole

public static void setMetaDataCacheRole(RemoteDataSource.MetaDataCacheRole pCacheRole)
Sets the global meta data cache role.

Parameters:
pCacheRole - the cache role to use

getMetaDataCacheRole

public static RemoteDataSource.MetaDataCacheRole getMetaDataCacheRole()
Gets whether the global or the local cache is used.

Returns:
true means that the global cache is enabled


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.