Class GranuleCatalogStore
- Object
-
- GranuleCatalogSource
-
- GranuleCatalogStore
-
- All Implemented Interfaces:
GranuleSource
,GranuleStore
public class GranuleCatalogStore extends GranuleCatalogSource implements GranuleStore
AGranuleStore
implementation wrapping aGranuleCatalog
.- Author:
- Daniele Romagnoli, GeoSolutions SAS
-
-
Field Summary
-
Fields inherited from class GranuleCatalogSource
catalog, hints, manager, typeName
-
Fields inherited from interface GranuleSource
FILE_VIEW, FILES, NATIVE_BOUNDS, NATIVE_BOUNDS_KEY
-
-
Constructor Summary
Constructors Constructor Description GranuleCatalogStore(RasterManager manager, GranuleCatalog catalog, String typeName, Hints hints)
-
Method Summary
All Methods Instance Methods Concrete 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.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 class GranuleCatalogSource
dispose, getBounds, getCount, getGranules, getSchema, getSupportedHints
-
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface GranuleSource
dispose, getBounds, getCount, getGranules, getSchema, getSupportedHints
-
-
-
-
Constructor Detail
-
GranuleCatalogStore
public GranuleCatalogStore(RasterManager manager, GranuleCatalog catalog, String typeName, Hints hints)
-
-
Method Detail
-
addGranules
public void addGranules(SimpleFeatureCollection granules)
Description copied from interface:GranuleStore
Add all the granules from the specified collection to thisGranuleStore
.- Specified by:
addGranules
in interfaceGranuleStore
- Parameters:
granules
- the granules to add
-
removeGranules
public int removeGranules(Filter filter)
Description copied from interface:GranuleStore
Removes granules selected by the given filter.- Specified by:
removeGranules
in interfaceGranuleStore
- Parameters:
filter
- an OpenGIS filter
-
removeGranules
public int removeGranules(Filter filter, Hints hints)
Description copied from interface:GranuleStore
Removes granules selected by the given filter, controlled by a set of hints (might be implementation dependent and eventually ignored).- Specified by:
removeGranules
in interfaceGranuleStore
- Parameters:
filter
- an OpenGIS filterhints
- a set of hints to control how the removal is performed
-
updateGranules
public void updateGranules(String[] attributeNames, Object[] attributeValues, Filter filter)
Description copied from interface:GranuleStore
Modifies the attributes with the supplied values in all granules selected by the given filter.- Specified by:
updateGranules
in interfaceGranuleStore
- Parameters:
attributeNames
- the attributes to modifyattributeValues
- the new values for the attributesfilter
- an OpenGIS filter
-
getTransaction
public Transaction getTransaction()
Description copied from interface:GranuleStore
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(); }
- Specified by:
getTransaction
in interfaceGranuleStore
- Returns:
- Transaction in use, or Transaction.AUTO_COMMIT
-
setTransaction
public void setTransaction(Transaction transaction)
Description copied from interface:GranuleStore
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(); }
- Specified by:
setTransaction
in interfaceGranuleStore
- Parameters:
transaction
- the transaction
-
-