org.esa.beam.visat.actions.pgrab.model.dataprovider
Interface DataProvider

All Known Implementing Classes:
FileNameProvider, ProductPropertiesProvider, ProductSizeProvider, QuicklookProvider, WorldMapProvider

public interface DataProvider

This interface shall be implemented to provide new data to a RepositoryEntry. The data is shown in a table within the ProductGrabber.

To add a DataProvider to the ProductGrabber use the following example code:

ProductGrabberVPI.getInstance().getRepositoryManager().addDataProvider(new SampleDataProvider());


Method Summary
 void cleanUp(RepositoryEntry entry, Repository repository)
          Implementation should delete all stored data.
 void createData(RepositoryEntry entry, Repository repository)
          Implementation should create the data this DataProvider provides.
 Comparator getComparator()
          Returns the Comparator for the data provided by this DataProvider.
 Object getData(RepositoryEntry entry, Repository repository)
          Returns the data which is provided by this implementation.
 TableColumn getTableColumn()
          Returns a TableColumn which defines the UI representation of the provided data within a Table.
 boolean mustCreateData(RepositoryEntry entry, Repository repository)
          Implementation should check if the data this DataProvider provides must be created, or if it is already stored.
 

Method Detail

mustCreateData

boolean mustCreateData(RepositoryEntry entry,
                       Repository repository)
Implementation should check if the data this DataProvider provides must be created, or if it is already stored.

Parameters:
entry - the entry for which the data shall be provided.
repository - the repsoitory containing the entry.
Returns:
true, if the data must be created, otherwise false.

createData

void createData(RepositoryEntry entry,
                Repository repository)
                throws IOException
Implementation should create the data this DataProvider provides. Also the created should be stored for performance reasons. Created data can be stored into a PropertyMap retrieved by calling Repository.getPropertyMap() or in a directory retrieved from Repository.getStorageDir().

Parameters:
entry - the entry for which the data shall be provided.
repository - the repository containing the entry. // todo - (from nf) for what? entry knows it repository!
Throws:
IOException - if an error occurs during creating the data.

getData

Object getData(RepositoryEntry entry,
               Repository repository)
               throws IOException
Returns the data which is provided by this implementation.

Parameters:
entry - the entry for which the data shall be provided.
repository - the repository containing the entry. // todo - (from nf) for what? entry knows it repository!
Returns:
the provided data.
Throws:
IOException - if an error occurs during providing the data.

getComparator

Comparator getComparator()
Returns the Comparator for the data provided by this DataProvider.

Returns:
the comparator.

cleanUp

void cleanUp(RepositoryEntry entry,
             Repository repository)
Implementation should delete all stored data.

Parameters:
entry - the entry for which the data was provided.
repository - the repository contained the entry. // todo - (from nf) for what? entry knows it repository!

getTableColumn

TableColumn getTableColumn()
Returns a TableColumn which defines the UI representation of the provided data within a Table.

Returns:
the TableColumn.


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.