Package org.geotools.coverage.grid.io
Interface GranuleStore
-
- All Superinterfaces:
GranuleSource
- All Known Implementing Classes:
GranuleCatalogStore
,RenamingGranuleStore
public interface GranuleStore extends GranuleSource
API extendingGranuleSource
providing capabilities to add, delete and modify granules.- Author:
- Simone Giannecchini, GeoSolutions SAS, Andrea Aime, GeoSolutions SAS, Daniele Romagnoli, GeoSolutions SAS
-
-
Field Summary
-
Fields inherited from interface GranuleSource
FILE_VIEW, FILES, NATIVE_BOUNDS, NATIVE_BOUNDS_KEY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addGranules(SimpleFeatureCollection granules)
Add all the granules from the specified collection to thisGranuleStore
.Transaction
getTransaction()
Gets theTransaction
that thisGranuleStore
is currently operating against.int
removeGranules(Filter filter)
Removes granules selected by the given filter.default int
removeGranules(Filter filter, Hints hints)
Removes granules selected by the given filter, controlled by a set of hints (might be implementation dependent and eventually ignored).void
setTransaction(Transaction transaction)
Provide a transaction for commit/rollback control of a modifying operation on thisGranuleStore
.void
updateGranules(String[] attributeNames, Object[] attributeValues, Filter filter)
Modifies the attributes with the supplied values in all granules selected by the given filter.-
Methods inherited from interface GranuleSource
dispose, getBounds, getCount, getGranules, getSchema, getSupportedHints
-
-
-
-
Method Detail
-
addGranules
void addGranules(SimpleFeatureCollection granules)
Add all the granules from the specified collection to thisGranuleStore
.- Parameters:
granules
- the granules to add
-
removeGranules
int removeGranules(Filter filter)
Removes granules selected by the given filter.- Parameters:
filter
- an OpenGIS filter- Throws:
IOException
- if an error occurs modifying the data source
-
removeGranules
default int removeGranules(Filter filter, Hints hints)
Removes granules selected by the given filter, controlled by a set of hints (might be implementation dependent and eventually ignored).- Parameters:
filter
- an OpenGIS filterhints
- a set of hints to control how the removal is performed- Throws:
IOException
- if an error occurs modifying the data source
-
updateGranules
void updateGranules(String[] attributeNames, Object[] attributeValues, Filter filter)
Modifies the attributes with the supplied values in all granules selected by the given filter.- Parameters:
attributeNames
- the attributes to modifyattributeValues
- the new values for the attributesfilter
- an OpenGIS filter- Throws:
IOException
- if the attribute and object arrays are not equal in length; if the value types do not match the attribute types; if modification is not supported; or if there errors accessing the data source
-
getTransaction
Transaction getTransaction()
Gets theTransaction
that thisGranuleStore
is currently operating against.Transaction t = GranuleStore.getTransaction(); try { GranuleStore.addGranules (granules); t.commit(); } catch( IOException erp ){ // something went wrong; t.rollback(); }
- Returns:
- Transaction in use, or Transaction.AUTO_COMMIT
-
setTransaction
void setTransaction(Transaction transaction)
Provide a transaction for commit/rollback control of a modifying operation on thisGranuleStore
.Transaction t = new DefaultTransaction(); GranuleStore.setTransaction(t); try { GranuleStore.addGranules (granules); t.commit(); } catch ( IOException ex ) { // something went wrong; t.rollback(); } finally { t.close(); }
- Parameters:
transaction
- the transaction
-
-