org.geotools.gce.imagemosaic.catalog
Class GranuleCatalogStore

Object
  extended by GranuleCatalogSource
      extended by GranuleCatalogStore
All Implemented Interfaces:
GranuleSource, GranuleStore

public class GranuleCatalogStore
extends GranuleCatalogSource
implements GranuleStore

A GranuleStore implementation wrapping a GranuleCatalog.

Author:
Daniele Romagnoli, GeoSolutions SAS

Field Summary
 
Fields inherited from class GranuleCatalogSource
catalog, hints, typeName
 
Constructor Summary
GranuleCatalogStore(GranuleCatalog catalog, String typeName, Hints hints)
           
 
Method Summary
 void addGranules(SimpleFeatureCollection granules)
          Add all the granules from the specified collection to this GranuleStore.
 Transaction getTransaction()
          Gets the Transaction that this GranuleStore is currently operating against.
 int removeGranules(Filter filter)
          Removes granules selected by the given filter.
 void setTransaction(Transaction transaction)
          Provide a transaction for commit/rollback control of a modifying operation on this GranuleStore.
 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
 
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
 

Constructor Detail

GranuleCatalogStore

public GranuleCatalogStore(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 this GranuleStore.

Specified by:
addGranules in interface GranuleStore
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 interface GranuleStore
Parameters:
filter - an OpenGIS filter

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 interface GranuleStore
Parameters:
attributeNames - the attributes to modify
attributeValues - the new values for the attributes
filter - an OpenGIS filter

getTransaction

public Transaction getTransaction()
Description copied from interface: GranuleStore
Gets the Transaction that this GranuleStore 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 interface GranuleStore
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 this GranuleStore.
 
 Transation 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 interface GranuleStore
Parameters:
transaction - the transaction


Copyright © 1996-2014 Geotools. All Rights Reserved.