com.ontimize.util.gis.client.manager
Class DefaultGisClientManager

java.lang.Object
  extended by com.ontimize.util.gis.client.manager.DefaultGisClientManager
All Implemented Interfaces:
IGisClientManager

public class DefaultGisClientManager
extends java.lang.Object
implements IGisClientManager


Field Summary
protected  IGisDataDispatcher dataDispatcher
           
protected  com.ontimize.gui.container.EJDialog dGisInfo
           
protected  com.ontimize.gui.Form fGisInfo
           
protected  IGisCacheManager gisClientCache
           
protected  IGisServerManager gisServerManager
           
protected  int lastTicketNumber
           
protected  IGisClientSideDataManager localDataManager
           
protected  com.ontimize.locator.ReferenceLocator referenceLocator
           
protected  IGisDataRequestsManager requestsManager
           
protected  java.util.concurrent.ExecutorService requestsThreadPool
           
protected  java.util.HashMap<java.lang.Object,java.lang.Object> storedConfigurations
           
protected  java.util.HashMap<java.lang.Object,java.lang.Object> storedLayersConfigurations
           
protected  java.util.HashMap<java.lang.Object,java.lang.Object> storedLayersLists
           
 
Constructor Summary
DefaultGisClientManager()
           
DefaultGisClientManager(java.util.Hashtable parameters)
           
DefaultGisClientManager(java.lang.String xmlPath)
           
 
Method Summary
protected  void addKeyListeners()
           
protected  void checkGisClientLibraries()
           
 void clearConfiguration(java.lang.Object configurationId)
          Clear all the data on client side related to the given Gis layers configuration
 void clearLayersCache(java.lang.Object layersId)
          Clear the client data cache related to the given layers identifiers layersId
 void deleteLayer(java.lang.Object layerKeys)
          Delete the layer layerId
 void deleteLayerData(java.lang.Object layerKeys, java.lang.Object deletedKeys)
          Delete the data identified by deletedKeys from the layer layerId
 IGisCacheManager getCacheManager()
          Get cache manager
 java.lang.Object getConfigurationParameters(java.lang.Object configurationId)
          Get the initial configuration parameters for the gis viewer with the identifier configurationId
 IGisDataDispatcher getDataDispatcher()
          Get Gis data dispatcher
 java.lang.Object getDataHandlerReference(java.lang.Object layerKeys)
          Get the reference of the data handler related to the given layer
 IGisDataRequestsManager getDataRequestsManager()
          Get Gis data requests manager
 void getLayerData(java.lang.Object requesterId, java.lang.Object layerKeys, java.lang.Object appliedFilters)
          Request the data related to the filters appliedFilters from the layer layerId, the requester receives the data throught the method setData() of interface IDataRequester
 java.lang.Object getLayerDataSynchronous(java.lang.Object requesterId, java.lang.Object layerKeys, java.lang.Object appliedFilters)
          Synchonous request of data related to the filters appliedFilters from the layer layerId, the requester waits for the client manager data returning
 java.lang.Object getLayersInformation(java.lang.Object layersConfigurationId)
          Get the layers configuration with the identifier layersConfigurationId
 IGisClientSideDataManager getLocalDataManager()
          Gets the client side data manager, if exists
 com.ontimize.locator.ReferenceLocator getReferenceLocator()
           
 java.lang.String getRemotePreference(java.lang.String preference)
          Get a remote preference
 IGisServerManager getServerManager()
          Get gis server manager reference
protected  int getTicketNumber()
           
protected  void init(java.util.Hashtable parameters)
           
protected  void initCacheManager(java.util.Hashtable<java.lang.String,java.lang.Object> cacheParameters)
          Init the Gis Cache Manager with the given parameters
protected  void initDataDispatcher(java.util.Hashtable<java.lang.String,java.lang.Object> dispatcherParameters)
          Init the client data dispatcher with the given parameters
protected  void initDataRequester(java.util.Hashtable<java.lang.String,java.lang.Object> requesterParameters)
          Init the client data requester with the given parameters
protected  void initGisDataManager(java.lang.Object dataManagerParams, boolean defaultConf)
           
protected  void initLogger(java.util.Hashtable<java.lang.String,java.lang.Object> loggerParameters)
          Init the Gis Client Logger
 void insertLayer(java.lang.Object insertParameters)
          Insert a new layer with the parameters insertParameters
 java.lang.Object insertLayerData(java.lang.Object layerKeys, java.lang.Object insertedValues)
          Insert the given data insertedValues into the layer indentified by layerId
protected  void log(java.lang.Object o, int level)
           
protected  java.util.Hashtable<java.lang.String,java.lang.Object> parseParametersFromXML(java.lang.String xmlPath)
          Get the parameters configuration Hashtable from the XML configuration file
protected  void registerInformationKey()
           
 void showGisInformation()
           
 void updateLayer(java.lang.Object layerKeys, java.lang.Object updateParameters)
          Update the parameters defined at updateParameters for the layer with reference layerId
 void updateLayerData(java.lang.Object layerKeys, java.lang.Object updatedKeys, java.lang.Object newValues)
          Update the data identified by updatedKeys with the values newValues for the layer layerId
 void updateRemotePreference(java.lang.String preference, java.lang.String param)
          Updates a remote preference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storedConfigurations

protected java.util.HashMap<java.lang.Object,java.lang.Object> storedConfigurations

storedLayersLists

protected java.util.HashMap<java.lang.Object,java.lang.Object> storedLayersLists

storedLayersConfigurations

protected java.util.HashMap<java.lang.Object,java.lang.Object> storedLayersConfigurations

dGisInfo

protected com.ontimize.gui.container.EJDialog dGisInfo

fGisInfo

protected com.ontimize.gui.Form fGisInfo

gisServerManager

protected IGisServerManager gisServerManager

gisClientCache

protected IGisCacheManager gisClientCache

dataDispatcher

protected IGisDataDispatcher dataDispatcher

requestsManager

protected IGisDataRequestsManager requestsManager

localDataManager

protected IGisClientSideDataManager localDataManager

referenceLocator

protected com.ontimize.locator.ReferenceLocator referenceLocator

requestsThreadPool

protected java.util.concurrent.ExecutorService requestsThreadPool

lastTicketNumber

protected int lastTicketNumber
Constructor Detail

DefaultGisClientManager

public DefaultGisClientManager()

DefaultGisClientManager

public DefaultGisClientManager(java.lang.String xmlPath)

DefaultGisClientManager

public DefaultGisClientManager(java.util.Hashtable parameters)
Method Detail

addKeyListeners

protected void addKeyListeners()

checkGisClientLibraries

protected void checkGisClientLibraries()

init

protected void init(java.util.Hashtable parameters)

registerInformationKey

protected void registerInformationKey()

showGisInformation

public void showGisInformation()

initLogger

protected void initLogger(java.util.Hashtable<java.lang.String,java.lang.Object> loggerParameters)
Init the Gis Client Logger

Parameters:
loggerParameters - Gis Client Logger configuration parameters

initCacheManager

protected void initCacheManager(java.util.Hashtable<java.lang.String,java.lang.Object> cacheParameters)
Init the Gis Cache Manager with the given parameters

Parameters:
cacheParameters - Gis Cache Manager configuration parameters

initDataDispatcher

protected void initDataDispatcher(java.util.Hashtable<java.lang.String,java.lang.Object> dispatcherParameters)
Init the client data dispatcher with the given parameters

Parameters:
dispatcherParameters - Data dispatcher configuration parameters

initDataRequester

protected void initDataRequester(java.util.Hashtable<java.lang.String,java.lang.Object> requesterParameters)
Init the client data requester with the given parameters

Parameters:
requesterParameters - Data requester configuration parameters

clearLayersCache

public void clearLayersCache(java.lang.Object layersId)
Description copied from interface: IGisClientManager
Clear the client data cache related to the given layers identifiers layersId

Specified by:
clearLayersCache in interface IGisClientManager
Parameters:
layersId - Indentifier of the layers to delete from the cache

deleteLayer

public void deleteLayer(java.lang.Object layerKeys)
Description copied from interface: IGisClientManager
Delete the layer layerId

Specified by:
deleteLayer in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer to delete

deleteLayerData

public void deleteLayerData(java.lang.Object layerKeys,
                            java.lang.Object deletedKeys)
Description copied from interface: IGisClientManager
Delete the data identified by deletedKeys from the layer layerId

Specified by:
deleteLayerData in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer to delete
deletedKeys - Identifiers of the values to delete

getDataHandlerReference

public java.lang.Object getDataHandlerReference(java.lang.Object layerKeys)
Description copied from interface: IGisClientManager
Get the reference of the data handler related to the given layer

Specified by:
getDataHandlerReference in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer
Returns:
reference of the requested data handler

getLayersInformation

public java.lang.Object getLayersInformation(java.lang.Object layersConfigurationId)
Description copied from interface: IGisClientManager
Get the layers configuration with the identifier layersConfigurationId

Specified by:
getLayersInformation in interface IGisClientManager
Parameters:
layersConfigurationId - Identifier for the layers configuration data
Returns:
requested layers configuration data

getConfigurationParameters

public java.lang.Object getConfigurationParameters(java.lang.Object configurationId)
Description copied from interface: IGisClientManager
Get the initial configuration parameters for the gis viewer with the identifier configurationId

Specified by:
getConfigurationParameters in interface IGisClientManager
Parameters:
configurationId - Identifier for the configuration data
Returns:
requested configuration data

insertLayer

public void insertLayer(java.lang.Object insertParameters)
Description copied from interface: IGisClientManager
Insert a new layer with the parameters insertParameters

Specified by:
insertLayer in interface IGisClientManager
Parameters:
insertParameters - New layer configuration parameters

insertLayerData

public java.lang.Object insertLayerData(java.lang.Object layerKeys,
                                        java.lang.Object insertedValues)
Description copied from interface: IGisClientManager
Insert the given data insertedValues into the layer indentified by layerId

Specified by:
insertLayerData in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer to insert
insertedValues - New values to insert

updateLayer

public void updateLayer(java.lang.Object layerKeys,
                        java.lang.Object updateParameters)
Description copied from interface: IGisClientManager
Update the parameters defined at updateParameters for the layer with reference layerId

Specified by:
updateLayer in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer to update
updateParameters - Parameters to update

updateLayerData

public void updateLayerData(java.lang.Object layerKeys,
                            java.lang.Object updatedKeys,
                            java.lang.Object newValues)
Description copied from interface: IGisClientManager
Update the data identified by updatedKeys with the values newValues for the layer layerId

Specified by:
updateLayerData in interface IGisClientManager
Parameters:
layerKeys - Identifiers for the layer to update
updatedKeys - Identifiers of the values to update
newValues - Values to update

getLayerData

public void getLayerData(java.lang.Object requesterId,
                         java.lang.Object layerKeys,
                         java.lang.Object appliedFilters)
Description copied from interface: IGisClientManager
Request the data related to the filters appliedFilters from the layer layerId, the requester receives the data throught the method setData() of interface IDataRequester

Specified by:
getLayerData in interface IGisClientManager
Parameters:
requesterId - Reference to the object that request the data
layerKeys - Identifiers for the layer to request
appliedFilters - Defined filters for the data request

getTicketNumber

protected int getTicketNumber()

getLayerDataSynchronous

public java.lang.Object getLayerDataSynchronous(java.lang.Object requesterId,
                                                java.lang.Object layerKeys,
                                                java.lang.Object appliedFilters)
Description copied from interface: IGisClientManager
Synchonous request of data related to the filters appliedFilters from the layer layerId, the requester waits for the client manager data returning

Specified by:
getLayerDataSynchronous in interface IGisClientManager
Parameters:
requesterId - Reference to the object that request the data
layerKeys - Identifiers for the layer to request
appliedFilters - Defined filters for the data request
Returns:
requested layer data

parseParametersFromXML

protected java.util.Hashtable<java.lang.String,java.lang.Object> parseParametersFromXML(java.lang.String xmlPath)
Get the parameters configuration Hashtable from the XML configuration file

Parameters:
xmlPath - Path to the configuration file
Returns:
Parsed initialization parameters

getCacheManager

public IGisCacheManager getCacheManager()
Description copied from interface: IGisClientManager
Get cache manager

Specified by:
getCacheManager in interface IGisClientManager
Returns:
cache manager

getDataDispatcher

public IGisDataDispatcher getDataDispatcher()
Description copied from interface: IGisClientManager
Get Gis data dispatcher

Specified by:
getDataDispatcher in interface IGisClientManager
Returns:
data dispatcher

getServerManager

public IGisServerManager getServerManager()
Description copied from interface: IGisClientManager
Get gis server manager reference

Specified by:
getServerManager in interface IGisClientManager
Returns:
server manager

getReferenceLocator

public com.ontimize.locator.ReferenceLocator getReferenceLocator()
Specified by:
getReferenceLocator in interface IGisClientManager

getRemotePreference

public java.lang.String getRemotePreference(java.lang.String preference)
Description copied from interface: IGisClientManager
Get a remote preference

Specified by:
getRemotePreference in interface IGisClientManager
Parameters:
preference - Preference name

updateRemotePreference

public void updateRemotePreference(java.lang.String preference,
                                   java.lang.String param)
Description copied from interface: IGisClientManager
Updates a remote preference

Specified by:
updateRemotePreference in interface IGisClientManager
Parameters:
preference - Preference name
param - Preference value

log

protected void log(java.lang.Object o,
                   int level)

getLocalDataManager

public IGisClientSideDataManager getLocalDataManager()
Description copied from interface: IGisClientManager
Gets the client side data manager, if exists

Specified by:
getLocalDataManager in interface IGisClientManager
Returns:
client side data manager

initGisDataManager

protected void initGisDataManager(java.lang.Object dataManagerParams,
                                  boolean defaultConf)

clearConfiguration

public void clearConfiguration(java.lang.Object configurationId)
Description copied from interface: IGisClientManager
Clear all the data on client side related to the given Gis layers configuration

Specified by:
clearConfiguration in interface IGisClientManager
Parameters:
configurationId - Layers configuration to clear

getDataRequestsManager

public IGisDataRequestsManager getDataRequestsManager()
Description copied from interface: IGisClientManager
Get Gis data requests manager

Specified by:
getDataRequestsManager in interface IGisClientManager
Returns:
data requests manager