org.esa.beam.visat.actions.pgrab.model
Class RepositoryManager

java.lang.Object
  extended by org.esa.beam.visat.actions.pgrab.model.RepositoryManager

public class RepositoryManager
extends Object

The class RepositoryManager handels a list of repositories and a list of data provider.

Author:
Marco Peters

Constructor Summary
RepositoryManager()
          Creates an instance of RepositoryManager.
 
Method Summary
 void addDataProvider(DataProvider dataProvider)
          Adds a DataProvider.
 void addListener(RepositoryManagerListener listener)
          Adds a RepositoryManagerListener.
 void addRepository(Repository repository)
          Adds a new Repository to the internal list of repositories.
 DataProvider getDataProvider(int index)
          Returns the DataProvider at the given index.
 DataProvider[] getDataProviders()
          Returns an array of registered DataProvider.
 int getNumDataProviders()
          Retrieves the number of DataProvider.
 int getNumRepositories()
          Retrieves the number of repositories.
 Repository[] getRepositories()
          Returns an array of registered Repository.
 Repository getRepository(int index)
          Returns the Repository at the given index.
 Repository getRepository(String baseDir)
          Returns the Repository with the given baseDir.
 void removeListener(RepositoryManagerListener listener)
          Removes a RepositoryManagerListener.
 void removeRepository(Repository repository)
          Removes the given repository from the internal list of repositories.
 void startUpdateRepository(Repository repository, com.bc.ceres.core.ProgressMonitor pm, Callback uiCallback)
          This method starts an seperate thread.
 void stopUpdateRepository()
          This method stops the process started by a call to startUpdateRepository(Repository, ProgressMonitor, Callback) startUpdateRepository()}.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryManager

public RepositoryManager()
Creates an instance of RepositoryManager.

Method Detail

addRepository

public void addRepository(Repository repository)
Adds a new Repository to the internal list of repositories.

Parameters:
repository - the repository to be added.

removeRepository

public void removeRepository(Repository repository)
Removes the given repository from the internal list of repositories.

Parameters:
repository - the repository to be removed.

getRepository

public Repository getRepository(int index)
Returns the Repository at the given index.

Parameters:
index - the index of the repository to return.
Returns:
the repository at the given index.

getRepository

public Repository getRepository(String baseDir)
Returns the Repository with the given baseDir.

Parameters:
baseDir - the baseDir of the repository to return.
Returns:
the repository with the given baseDir, or null if not found.

getNumRepositories

public int getNumRepositories()
Retrieves the number of repositories.

Returns:
the number of repositories.

getRepositories

public Repository[] getRepositories()
Returns an array of registered Repository.

Returns:
an array of repositories, never null

addDataProvider

public void addDataProvider(DataProvider dataProvider)
Adds a DataProvider.

Parameters:
dataProvider - the DataProvider to be added.

getDataProvider

public DataProvider getDataProvider(int index)
Returns the DataProvider at the given index.

Parameters:
index - the index of the DataProvider to return.
Returns:
the DataProvider at the given index.

getNumDataProviders

public int getNumDataProviders()
Retrieves the number of DataProvider.

Returns:
the number of DataProvider.

getDataProviders

public DataProvider[] getDataProviders()
Returns an array of registered DataProvider.

Returns:
an array DataProvider, never null

addListener

public void addListener(RepositoryManagerListener listener)
Adds a RepositoryManagerListener.

Parameters:
listener - the RepositoryManagerListener to be added.

removeListener

public void removeListener(RepositoryManagerListener listener)
Removes a RepositoryManagerListener.

Parameters:
listener - the RepositoryManagerListener to be removed.

startUpdateRepository

public void startUpdateRepository(Repository repository,
                                  com.bc.ceres.core.ProgressMonitor pm,
                                  Callback uiCallback)
This method starts an seperate thread. Each RepositoryEntry of the given Repository is filled with data. A possibly running update process is stopped before the new one is started.

Parameters:
repository - the Repository whose entries are updated.
pm - a ProgressMonitor to get informed about the progress.
uiCallback - a callback to handle ui updates.

stopUpdateRepository

public void stopUpdateRepository()
This method stops the process started by a call to startUpdateRepository(Repository, ProgressMonitor, Callback) startUpdateRepository()}. If no process is started the method has no effect.



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