Version: 1.1.1

org.biomoby.client
Class ServiceConnections

java.lang.Object
  extended by org.biomoby.client.ServiceConnections

public abstract class ServiceConnections
extends Object

This class contains knowledge (an algorithm) how individual Moby services could be connected together based on their input and output data types.

The algorithms is separated here because it can be used (I hope) independently for various types of clients. It is used, for example, by the clients creating graphs of all Moby services, but can be used also by those real client exchanging data between services.

This class does not contact Moby registry - its methods get all data from the caller (who usually uses CentralImpl class to obtain the data from a Moby registry).

Version:
$Id: ServiceConnections.java,v 1.7 2005/09/22 16:07:09 senger Exp $
Author:
Martin Senger

Constructor Summary
ServiceConnections()
           
 
Method Summary
static ServicesEdge[] build(MobyDataType[] dataTypes, MobyService[] services)
          Creates all (allowed) connections between given 'services' based on the given 'dataTypes'.
static DataServiceEdge[] findEndingEdges(MobyPrimaryDataSimple targetData, MobyDataType[] dataTypes, MobyService[] services)
           
static DataServiceEdge[] findStartingEdges(MobyPrimaryDataSimple sourceData, MobyDataType[] dataTypes, MobyService[] services)
           
static Hashtable optimizedDataTypes(MobyDataType[] dataTypes)
          Make the data types better searchable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceConnections

public ServiceConnections()
Method Detail

optimizedDataTypes

public static Hashtable optimizedDataTypes(MobyDataType[] dataTypes)
Make the data types better searchable. This is a public method because for optimalization purposes it is often better to make the hashtable only once.

Parameters:
dataTypes - contains definitions of the data types
Returns:
a table where keys are names of the data types (type String) and values are of type MobyDataType

findStartingEdges

public static DataServiceEdge[] findStartingEdges(MobyPrimaryDataSimple sourceData,
                                                  MobyDataType[] dataTypes,
                                                  MobyService[] services)

findEndingEdges

public static DataServiceEdge[] findEndingEdges(MobyPrimaryDataSimple targetData,
                                                MobyDataType[] dataTypes,
                                                MobyService[] services)

build

public static ServicesEdge[] build(MobyDataType[] dataTypes,
                                   MobyService[] services)
Creates all (allowed) connections between given 'services' based on the given 'dataTypes'. The returned array of found connections contains elements of service pairs and each pair also expresses some property of that connection (e.g. if a connection is purely based on a simple data type, or if the source or destinantion service produces or expects a collection of simple data types).

It reports warning on the STDERR if it finds an unknown data type used by any service. This would indicate an error in the Moby registry (or in this code :-)).

Parameters:
dataTypes - contains definitions of the data types
services - contains definitions of the Moby services
Returns:
a list of all allowed pairs of services. Some 'pairs' can be crippled in a way that they contain only one service - the other one is missing because this service either does not have any input, or does not have any output, or has an output of a type that is not consumed by any other service in the given list of 'services'

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010