maito.integration
Interface Integrator

All Superinterfaces:
DataProcessor
All Known Implementing Classes:
IntegratorImpl

public interface Integrator
extends DataProcessor

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

Author:
Antti Laitinen

Method Summary
 void addGraph(java.lang.String graphName)
          Adds a new graph to this Integrator.
 java.util.List getGraphs()
          Returns an array of all resource graphs known to this Integrator.
 java.util.List getSources(java.lang.String graph)
          Returns the descriptions of the sources that are integrated into a graph.
 void integrate(DataSourceDescription[] sources, java.lang.String graph)
          Starts the creation of a new resource graph in the integration subsystem.
 java.lang.String setLogListener(java.lang.String graph, LogListener listener)
          Sets a listener for log messages sent by this Integrator.
 
Methods inherited from interface maito.DataProcessor
getCurrentTasks, getErrors, setLogListener, workInProgress
 

Method Detail

addGraph

void addGraph(java.lang.String graphName)
              throws java.lang.IllegalArgumentException
Adds a new graph to this Integrator. Actual integration is not done until the integrate-method is called.

Parameters:
graphName - The name of the new resource graph
Throws:
java.lang.IllegalArgumentException - Thrown when the graph with the given name already exists.

getGraphs

java.util.List getGraphs()
Returns an array of all resource graphs known to this Integrator.

Returns:
A List of resource graph name Strings. If no graphs exist an empty List is returned.

getSources

java.util.List getSources(java.lang.String graph)
                          throws java.lang.IllegalArgumentException
Returns the descriptions of the sources that are integrated into a graph.

Parameters:
graph - The graph that's source are to be returned.
Returns:
A list of String arrays where the arrary[0] displays the source name. The array[1] displays integration date. If no sources are found returns an empty List.
Throws:
java.lang.IllegalArgumentException - Thrown if something is wrong with the graph parameter.

integrate

void integrate(DataSourceDescription[] sources,
               java.lang.String graph)
               throws IntegrationException
Starts the creation of a new resource graph in the integration subsystem.

Parameters:
sources - The data sources that are integrated.
graph - The name of the graph that is to be integrated.
Throws:
IntegrationException - Thrown if something goes wrong during the integration process.

setLogListener

java.lang.String setLogListener(java.lang.String graph,
                                LogListener listener)
Sets a listener for log messages sent by this Integrator.

Parameters:
graph - The resource graph that's log messages are to be listened to. If null all messages are listened to.
listener - The object that listens to this Integrator's log messages.