|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ontimize.util.gis.client.defaultimplementations.cache.CacheElementRasterByteArrays
public class CacheElementRasterByteArrays
Cache managing class used for raster layers, this class allows the user to save the images
in a temporal
cache on disk. This cache will save the images and a HSQL database to
manage the related data.
The configuration parameters for this cache class are:
| Field Summary | |
|---|---|
protected static java.lang.String |
BASE_FOLDER
|
protected java.awt.image.BufferedImage |
buffImage
|
protected java.util.HashMap<java.lang.Number,com.vividsolutions.jts.geom.Geometry> |
cachedAreas
|
protected java.sql.Connection |
conn
|
protected static int |
counterInitialValue
|
protected boolean |
createTable
|
(package private) org.geotools.index.Data |
data
|
protected java.lang.String |
DATABASE_NAME
|
static java.lang.String |
DATABASE_TYPE
|
protected org.geotools.index.DataDefinition |
dataDef
|
protected java.util.List<org.geotools.index.rtree.RTree> |
dataIndex
|
protected java.util.List<java.util.HashMap<java.lang.Object,java.lang.Object>> |
dataMap
|
protected java.io.File |
directory
|
protected static java.lang.String |
DIRECTORY_KEY
|
protected java.lang.String |
directoryPath
|
protected java.util.HashMap<java.lang.String,java.lang.Class> |
extraDataColumns
|
protected org.opengis.filter.FilterFactory |
ff
|
protected static java.lang.String |
FILE_LOCATION
|
protected java.lang.String |
FOLDER
|
(package private) boolean |
found
|
protected boolean |
hsqlDB
|
protected static java.lang.String |
INSERT_DATE
|
protected int |
insertsCounter
|
protected java.lang.String[] |
keys
|
protected int |
lastInsertedIndex
|
protected int |
maxCacheSize
|
protected long |
maxGeoId
|
protected org.geotools.index.rtree.memory.MemoryPageStore |
pageStore
|
protected static java.lang.String |
RASTER
|
protected com.vividsolutions.jts.io.WKTReader |
reader
|
protected java.sql.ResultSet |
rst1
|
protected java.util.List<java.lang.Double> |
scales
|
protected java.lang.Object |
sourceId
|
protected java.lang.String |
sql
|
protected java.lang.StringBuilder |
sqlBuilder
|
protected java.sql.Statement |
st
|
(package private) int |
totalScales
|
protected com.vividsolutions.jts.io.WKTWriter |
writer
|
| Fields inherited from interface com.ontimize.util.gis.client.defaultimplementations.cache.ICacheElement |
|---|
BYTE_ARRAYS, CACHE_ON_DISK, DEBUG_MESSAGES, FOLDER_NAME, IMAGE_FORMAT, MAX_CACHE_SIZE, MAX_EXPIRATION_PERIOD |
| Fields inherited from interface com.ontimize.util.gis.common.GisConstants |
|---|
STR_APPLIED_FILTERS, STR_GEO_OBJECT_ID, STR_GEOMETRY, STR_RASTER |
| Constructor Summary | |
|---|---|
CacheElementRasterByteArrays()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkRecordExistence(java.lang.String recordKey)
|
void |
clearCache()
|
protected boolean |
createCacheTable(java.util.Map<java.lang.String,java.lang.Object> recordValues)
Create the HSQL cache table based on the content of the first record to introduce in the table. |
void |
deleteData(java.lang.Object deletedKeys)
Delete the data identified by deletedKeys from the cache |
void |
deleteDataFromFilters(java.lang.Object appliedFilters)
Delete the data related to the given filters |
protected void |
deleteFirstRecords(int totalRecordsToDelete)
|
protected java.lang.String |
getDatabasePath()
|
protected java.io.File |
getDirectory()
|
protected java.lang.String |
getGeoString(com.vividsolutions.jts.geom.Geometry polygon)
|
com.vividsolutions.jts.geom.Geometry |
getIntersectedArea(com.vividsolutions.jts.geom.Envelope interestBoundingBox)
Gets the area resulting from the intersection of the total cache data area and the interest area. |
protected int |
getScaleIndex(java.lang.Object appliedFilters)
|
protected java.io.File |
getTemporaryDirectory()
|
protected void |
insertCacheRecord(java.util.Map<java.lang.String,java.lang.Object> recordValues)
Insert given record into HSQL disk cache |
java.lang.Object |
insertData(java.lang.Object insertedValues,
java.lang.Object appliedFilters)
Insert new data to the actual cache element |
boolean |
isAreaInCache(java.lang.Object appliedFilters)
Check if the interest area has all its data stored in cache |
protected void |
loadDatabase()
|
protected boolean |
loadRecordIntoCache(java.lang.String recordKey)
|
java.lang.Object |
queryData(java.lang.Object appliedFilters)
Request data that fits with the applied filters |
void |
setConfigurationParameters(java.lang.Object parameters)
Set the initial configuration parameters. |
void |
setDataKeys(java.lang.String[] keys)
Set the name of the actual data key columns |
void |
setId(java.lang.Object cacheId)
|
void |
updateData(java.lang.Object updatedKeys,
java.lang.Object newValues)
Update the data identified by updatedKeys with the values newValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String RASTER
protected static final java.lang.String FILE_LOCATION
protected static final java.lang.String INSERT_DATE
protected static final java.lang.String BASE_FOLDER
public static final java.lang.String DATABASE_TYPE
protected final org.opengis.filter.FilterFactory ff
protected java.util.List<java.lang.Double> scales
protected java.util.List<org.geotools.index.rtree.RTree> dataIndex
protected org.geotools.index.rtree.memory.MemoryPageStore pageStore
protected org.geotools.index.DataDefinition dataDef
protected java.lang.Object sourceId
protected java.lang.String[] keys
org.geotools.index.Data data
protected final com.vividsolutions.jts.io.WKTWriter writer
protected final com.vividsolutions.jts.io.WKTReader reader
protected java.lang.StringBuilder sqlBuilder
protected java.lang.String directoryPath
protected java.util.List<java.util.HashMap<java.lang.Object,java.lang.Object>> dataMap
protected int lastInsertedIndex
protected java.util.HashMap<java.lang.Number,com.vividsolutions.jts.geom.Geometry> cachedAreas
protected static final int counterInitialValue
protected int insertsCounter
protected int maxCacheSize
protected static final java.lang.String DIRECTORY_KEY
protected boolean hsqlDB
protected java.lang.String DATABASE_NAME
protected java.lang.String FOLDER
protected java.sql.Connection conn
protected java.sql.Statement st
protected java.lang.String sql
protected java.sql.ResultSet rst1
protected java.awt.image.BufferedImage buffImage
protected java.io.File directory
protected boolean createTable
protected long maxGeoId
protected java.util.HashMap<java.lang.String,java.lang.Class> extraDataColumns
boolean found
int totalScales
| Constructor Detail |
|---|
public CacheElementRasterByteArrays()
| Method Detail |
|---|
public void deleteData(java.lang.Object deletedKeys)
throws java.lang.Exception
ICacheElementdeletedKeys from the cache
deleteData in interface ICacheElementdeletedKeys - Indentifiers of the data to delete
java.lang.Exception
public java.lang.Object insertData(java.lang.Object insertedValues,
java.lang.Object appliedFilters)
throws java.lang.Exception
ICacheElement
insertData in interface ICacheElementinsertedValues - Values to save in cacheappliedFilters - Filters applied in the request of the data to insert
java.lang.Exception
public java.lang.Object queryData(java.lang.Object appliedFilters)
throws java.lang.Exception
ICacheElement
queryData in interface ICacheElementappliedFilters - Filters applied on request
java.lang.Exception
protected int getScaleIndex(java.lang.Object appliedFilters)
throws java.lang.Exception
java.lang.Exception
public void updateData(java.lang.Object updatedKeys,
java.lang.Object newValues)
throws java.lang.Exception
ICacheElementupdatedKeys with the values newValues
updateData in interface ICacheElementupdatedKeys - Indentifiers of the data to updatenewValues - Updated values for the given identifiers
java.lang.Exceptionpublic com.vividsolutions.jts.geom.Geometry getIntersectedArea(com.vividsolutions.jts.geom.Envelope interestBoundingBox)
ICacheElement
getIntersectedArea in interface ICacheElementinterestBoundingBox - Interest area bounding box
public boolean isAreaInCache(java.lang.Object appliedFilters)
ICacheElement
isAreaInCache in interface ICacheElementappliedFilters - Request filters
public void setId(java.lang.Object cacheId)
setId in interface ICacheElementpublic void setDataKeys(java.lang.String[] keys)
ICacheElement
setDataKeys in interface ICacheElementkeys - String array of the key columns identifiers
public void deleteDataFromFilters(java.lang.Object appliedFilters)
throws java.lang.Exception
ICacheElement
deleteDataFromFilters in interface ICacheElementappliedFilters - Filters applied on deletion
java.lang.Exceptionpublic void setConfigurationParameters(java.lang.Object parameters)
ICacheElement
setConfigurationParameters in interface ICacheElementparameters - Cache class configuration parametersprotected void loadDatabase()
protected java.io.File getDirectory()
protected java.io.File getTemporaryDirectory()
protected java.lang.String getDatabasePath()
protected void insertCacheRecord(java.util.Map<java.lang.String,java.lang.Object> recordValues)
protected boolean checkRecordExistence(java.lang.String recordKey)
protected boolean loadRecordIntoCache(java.lang.String recordKey)
protected void deleteFirstRecords(int totalRecordsToDelete)
protected boolean createCacheTable(java.util.Map<java.lang.String,java.lang.Object> recordValues)
recordValues - protected java.lang.String getGeoString(com.vividsolutions.jts.geom.Geometry polygon)
public void clearCache()
clearCache in interface ICacheElement
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||