com.ontimize.util.gis.client.defaultimplementations
Class DefaultGisCacheManager

java.lang.Object
  extended by com.ontimize.util.gis.client.defaultimplementations.DefaultGisCacheManager
All Implemented Interfaces:
IGisCacheManager

public class DefaultGisCacheManager
extends java.lang.Object
implements IGisCacheManager

Cache manager default implementation


Field Summary
protected  IGisClientManager clientManager
           
protected  java.util.Hashtable<java.lang.Object,ICacheElement> dataLayers
           
protected  java.util.Hashtable<java.lang.String,java.lang.Object> initParams
           
 
Constructor Summary
DefaultGisCacheManager()
           
 
Method Summary
 void clearDataCache()
          Clears the cache
 void deleteData(java.lang.Object layerId, java.lang.Object deletedKeys, java.lang.Object appliedFilters)
          Delete the data identified by deletedKeys from the data provider dataProviderId
 com.vividsolutions.jts.geom.Geometry getIntersectedArea(java.lang.Object layerId, com.vividsolutions.jts.geom.Envelope interestBoundingBox)
          Gets the area resulting from the intersection of a bounding box with the cached area
protected  java.util.Hashtable<java.lang.String,java.lang.Object> getKeyFromValues(java.lang.Object layerId, java.lang.Object appliedFilters)
          Gets the internal cache manager identifier for the given layer identifier and applied filters
 void initCache(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
          Init the gis cache manager with the given parameters
 java.lang.Object insertData(java.lang.Object layerId, java.lang.Object insertedValues, java.lang.Object appliedFilters)
          Insert the given data insertedValues into the data provider indentified by dataProviderId
 boolean isDataInCache(java.lang.Object layerId, java.lang.Object appliedFilters)
          Check if the data according to the given filters is stored in cache
 java.lang.Object queryData(java.lang.Object layerId, java.lang.Object appliedFilters)
          Request the data related to the filters appliedFilters for the data provider dataProviderId
 void setGisClientManager(IGisClientManager clientManager)
          Set the gis client manager
 void updateData(java.lang.Object layerId, java.lang.Object updatedKeys, java.lang.Object newValues)
          Update the data identified by updatedKeys with the values newValues for the data provider dataProviderId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataLayers

protected java.util.Hashtable<java.lang.Object,ICacheElement> dataLayers

clientManager

protected IGisClientManager clientManager

initParams

protected java.util.Hashtable<java.lang.String,java.lang.Object> initParams
Constructor Detail

DefaultGisCacheManager

public DefaultGisCacheManager()
Method Detail

clearDataCache

public void clearDataCache()
Description copied from interface: IGisCacheManager
Clears the cache

Specified by:
clearDataCache in interface IGisCacheManager

deleteData

public void deleteData(java.lang.Object layerId,
                       java.lang.Object deletedKeys,
                       java.lang.Object appliedFilters)
                throws java.lang.Exception
Description copied from interface: IGisCacheManager
Delete the data identified by deletedKeys from the data provider dataProviderId

Specified by:
deleteData in interface IGisCacheManager
Parameters:
layerId - Layer identifier
deletedKeys - Identifiers of the values to delete
appliedFilters - Previous query applied filters
Throws:
java.lang.Exception

insertData

public java.lang.Object insertData(java.lang.Object layerId,
                                   java.lang.Object insertedValues,
                                   java.lang.Object appliedFilters)
                            throws java.lang.Exception
Description copied from interface: IGisCacheManager
Insert the given data insertedValues into the data provider indentified by dataProviderId

Specified by:
insertData in interface IGisCacheManager
Parameters:
layerId - Layer identifier
insertedValues - New values to insert
appliedFilters - Previous query applied filters
Throws:
java.lang.Exception

queryData

public java.lang.Object queryData(java.lang.Object layerId,
                                  java.lang.Object appliedFilters)
                           throws java.lang.Exception
Description copied from interface: IGisCacheManager
Request the data related to the filters appliedFilters for the data provider dataProviderId

Specified by:
queryData in interface IGisCacheManager
Parameters:
layerId - Layer identifier
appliedFilters - Previous query applied filters
Returns:
requested layer data
Throws:
java.lang.Exception

updateData

public void updateData(java.lang.Object layerId,
                       java.lang.Object updatedKeys,
                       java.lang.Object newValues)
                throws java.lang.Exception
Description copied from interface: IGisCacheManager
Update the data identified by updatedKeys with the values newValues for the data provider dataProviderId

Specified by:
updateData in interface IGisCacheManager
Parameters:
layerId - Layer identifier
updatedKeys - Identifiers of the values to update
newValues - Values to update
Throws:
java.lang.Exception

initCache

public void initCache(java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
Description copied from interface: IGisCacheManager
Init the gis cache manager with the given parameters

Specified by:
initCache in interface IGisCacheManager
Parameters:
parameters - Gis cache manager configuration parameters

isDataInCache

public boolean isDataInCache(java.lang.Object layerId,
                             java.lang.Object appliedFilters)
Description copied from interface: IGisCacheManager
Check if the data according to the given filters is stored in cache

Specified by:
isDataInCache in interface IGisCacheManager
Parameters:
layerId - Layer identifier
appliedFilters - Applied filters on data request
Returns:
Confirmation of data existence

getIntersectedArea

public com.vividsolutions.jts.geom.Geometry getIntersectedArea(java.lang.Object layerId,
                                                               com.vividsolutions.jts.geom.Envelope interestBoundingBox)
Description copied from interface: IGisCacheManager
Gets the area resulting from the intersection of a bounding box with the cached area

Specified by:
getIntersectedArea in interface IGisCacheManager
Parameters:
layerId - Layer identifier
interestBoundingBox - Area of interest
Returns:
Intersected area

getKeyFromValues

protected java.util.Hashtable<java.lang.String,java.lang.Object> getKeyFromValues(java.lang.Object layerId,
                                                                                  java.lang.Object appliedFilters)
Gets the internal cache manager identifier for the given layer identifier and applied filters

Parameters:
layerId - Layer identifier
appliedFilters - Current request applied filters
Returns:
key of the requested data layer

setGisClientManager

public void setGisClientManager(IGisClientManager clientManager)
Description copied from interface: IGisCacheManager
Set the gis client manager

Specified by:
setGisClientManager in interface IGisCacheManager
Parameters:
clientManager - Gis Client Manager