Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
public interface GranuleStore extends GranuleSource {
    /**
     * Add all the granules from the specified collection to this {@link GranuleStore}.
     * 
     * @param granules the granules to add
     */
    void addGranules(SimpleFeatureCollection granules);
    /**
     * Removes granules selected by the given filter.
     * 
     * @param filter an OpenGIS filter
     * 
     * @throws IOException if an error occurs modifying the data source
     */
    int removeGranules(Filter filter);
    /**
     * Modifies the attributes with the supplied values in all granules selected by the given filter.
     * 
     * @param attributeNames the attributes to modify
     * 
     * @param attributeValues the new values for the attributes
     * 
     * @param filter 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
     */
    void updateGranules(String[] attributeNames, Object[] attributeValues, Filter filter);
    /**
     * Gets the {@code Transaction} that this {@code GranuleStore} is currently operating against.
     * 
     * <pre>
     * <code>
     * Transaction t = GranuleStore.getTransaction();
     * try {
     *     GranuleStore.addGranules (granules);
     *     t.commit();
     * } catch( IOException erp ){
     *     // something went wrong;
     *     t.rollback();
     * }
     * </code>
     * </pre>
     * 
     * @return Transaction in use, or {@linkplain Transaction#AUTO_COMMIT}
     */
    Transaction getTransaction();
    /**
     * Provide a transaction for commit/rollback control of a modifying operation on this {@code GranuleStore}.
     * 
     * <pre>
     * <code>
     * Transation t = new DefaultTransaction();
     * GranuleStore.setTransaction(t);
     * try {
     *     GranuleStore.addGranules (granules);
     *     t.commit();
     * } catch ( IOException ex ) {
     *     // something went wrong;
     *     t.rollback();
     * } finally {
     *     t.close();
     * }
     * </code>
     * </pre>
     * 
     * @param transaction the transaction
     */
    void setTransaction(Transaction transaction);
}

Documentation

...

list the pages effected by this proposal

changes

The interfaces are purely additive, so no existing documentation requires to be changed.
Some examples of dealing with a structured grid coverage reader could be extracted from the mosaic/netcdf reader unit tests.