maito.datacollecting
Interface DataCollector

All Superinterfaces:
DataProcessor
All Known Implementing Classes:
DataCollectorImpl

public interface DataCollector
extends DataProcessor

An inteface for using the data collecting features of this program. This interface is designed to be used by the UI.

Author:
Antti Laitinen

Method Summary
 boolean addSource(java.lang.String name, java.lang.String type, java.net.URL location, java.lang.String format)
          Adds a single source to this DataCollector's data sources that will be updateble in the future.
 DataSourceDescription[] getSources()
          Returns a description of each source that this DataCollector has.
 java.util.HashMap getSupportedTypes()
          Returns all source types that are supported by this DataCollector.
 boolean removeSources(DataSourceDescription[] sources, boolean removeData)
          Removes one or more data sources permanently.
 void updateSources(DataSourceDescription[] sources)
          Starts updating data sources.
 
Methods inherited from interface maito.DataProcessor
getCurrentTasks, getErrors, setLogListener, workInProgress
 

Method Detail

addSource

boolean addSource(java.lang.String name,
                  java.lang.String type,
                  java.net.URL location,
                  java.lang.String format)
                  throws java.lang.IllegalArgumentException
Adds a single source to this DataCollector's data sources that will be updateble in the future.

Parameters:
name - A name/id for this source. This is the name that is visible to the user.
type - The type of this source. Must be one of the following:
  • "file"
  • "OAI-PMH"
location - The location where this source's data is retrieved from.
format - The data format. Must be one of the following:
  • "quick_format_name"
  • "quick_format_document"
  • "DCXML"
  • "oai_citeseer"
Returns:
A boolean value telling whether the given source was successfully added.
Throws:
java.lang.IllegalArgumentException - Thrown when something is wrong with the parameters so that a new data source cannot be created.

getSources

DataSourceDescription[] getSources()
Returns a description of each source that this DataCollector has.

Returns:
An array of DataSourceDescription objects. The array is empty if this DataCollector has no sources.

updateSources

void updateSources(DataSourceDescription[] sources)
Starts updating data sources.

Parameters:
sources - The data sources that are to be updated.

removeSources

boolean removeSources(DataSourceDescription[] sources,
                      boolean removeData)
Removes one or more data sources permanently. The data source will no longer be updated. All data from the database will be removed.

Parameters:
sources - The sources that are to be removed.
removeData - If true also all raw data is deleted from disk. If false the raw data is left alone.
Returns:
A boolean value telling whether the sources were successfully removed.

getSupportedTypes

java.util.HashMap getSupportedTypes()
Returns all source types that are supported by this DataCollector.

Returns:
A HashMap containing mappings from a transfer type to data format. The key values are String objects containing a supported transfer type. The keys map into String[] array objects that contain all supported data formats for the transfer type. example: "oaipmh" -> {"DCXML","oai_citeseer"} (key "oaipmh" maps to an array that contains "DCXML" and "oai_citeseer")