Version: 1.1.1

org.biomoby.client
Class FilterServices

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

public abstract class FilterServices
extends Object

This class allows to filter a set of services using some criteria.

Version:
$Id: FilterServices.java,v 1.6 2005/07/19 12:39:59 senger Exp $
Author:
Martin Senger

Constructor Summary
FilterServices()
           
 
Method Summary
static ServicesEdge[][] dataPaths(DataServiceEdge[] startingEdges, ServicesEdge[] edges, DataServiceEdge[] endingEdges)
          Find all paths (using available 'edges') that start by any of the 'startingEdges' and finish by any of the 'endingEdges'.
static ServicesEdge[] filter(ServicesEdge[] edges, String[] authorities, String[] serviceNames, int depth)
          Selects (from the given set of edges) only those edges that start in the nodes defined in 'authorities' or in 'serviceNames', and those that continue not farer then specified in 'depth'.
static ServicesEdge[] joinPaths(ServicesEdge[][] paths)
          Join together several paths.
static ServicesEdge[] pathes(ServicesEdge[] edges, String sourceServiceName, String targetServiceName)
          Selects (from the given set of edges) only those edges that compose pathes from a service given by 'sourceServiceName' to a service given by 'targetServiceName', or vice-versa.
static ServicesEdge[] pathes2(ServicesEdge[] edges, String sourceServiceName, String targetServiceName)
           
static ServicesEdge[][] straightDataPaths(DataServiceEdge[] startingEdges, ServicesEdge[] edges, DataServiceEdge[] endingEdges)
          Find all paths (using available 'edges') that start by any of the 'startingEdges' and finish by any of the 'endingEdges'.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterServices

public FilterServices()
Method Detail

filter

public static ServicesEdge[] filter(ServicesEdge[] edges,
                                    String[] authorities,
                                    String[] serviceNames,
                                    int depth)
Selects (from the given set of edges) only those edges that start in the nodes defined in 'authorities' or in 'serviceNames', and those that continue not farer then specified in 'depth'. 'depth' 1 means that only the most close neighbours remain and the rest is filtered out.

Parameters:
edges - contains definitions of all service connections.
authorities - contains names of authorities - all services owned by these authorities will remain; if it is an empty array, however, then all authorities are considered as wanted
serviceNames - contains names of services that will be included in the result; if it is en empty array, however, then all services remain (unless other criteria specified in 'authorities')
depth - indicates how far to go in the graph; the parameter is used only if the 'authorities' or 'serviceNames' are not empty
Returns:
a list of all remaining pairs of services; if 'authorities' and 'serviceNames' are empty it returns the 'edges' unchanged

pathes

public static ServicesEdge[] pathes(ServicesEdge[] edges,
                                    String sourceServiceName,
                                    String targetServiceName)
Selects (from the given set of edges) only those edges that compose pathes from a service given by 'sourceServiceName' to a service given by 'targetServiceName', or vice-versa.

Parameters:
edges - contains definitions of all service connections.
sourceServiceName - names a service at the beginning or at the end of all found pathes
targetServiceName - names a service at the beginning or at the end of all found pathes
Returns:
a list of all edges (an edge is a pair of services connected by the same data type) that constitute all available pathes between the source and target service

dataPaths

public static ServicesEdge[][] dataPaths(DataServiceEdge[] startingEdges,
                                         ServicesEdge[] edges,
                                         DataServiceEdge[] endingEdges)
Find all paths (using available 'edges') that start by any of the 'startingEdges' and finish by any of the 'endingEdges'. Each path always has one start and one end but can contain cycles, and forking and merging branches.

The number of returned pathes is equal or less than a product of number of 'startingEdges' and number of 'endingEdges'.

Parameters:
startingEdges - where returned paths start
edges - are all available edges the returned paths are built from (including 'startingEdges' and 'endingEdges')
endingEdges - where returned paths finish
Returns:
an array where each element is a list of edges that constitute a path; it returns an empty array (not null) if there is no such path
See Also:
straightDataPaths(org.biomoby.client.DataServiceEdge[], org.biomoby.client.ServicesEdge[], org.biomoby.client.DataServiceEdge[])

joinPaths

public static ServicesEdge[] joinPaths(ServicesEdge[][] paths)
Join together several paths. It makes sure that the result does not have duplicated edges (edges with the same source, target, connector and perhaps other characteristics).

Parameters:
paths - an array of paths (each paths is an array of edges) that will be joined
Returns:
a joint path

pathes2

public static ServicesEdge[] pathes2(ServicesEdge[] edges,
                                     String sourceServiceName,
                                     String targetServiceName)

straightDataPaths

public static ServicesEdge[][] straightDataPaths(DataServiceEdge[] startingEdges,
                                                 ServicesEdge[] edges,
                                                 DataServiceEdge[] endingEdges)
Find all paths (using available 'edges') that start by any of the 'startingEdges' and finish by any of the 'endingEdges'. Each path always has one start and one end and it has no cycles and no branches.

The number of returned pathes is equal or less than a product of number of 'startingEdges' and number of 'endingEdges'.

Parameters:
startingEdges - where returned paths start
edges - are all available edges the returned paths are built from (including 'startingEdges' and 'endingEdges')
endingEdges - where returned paths finish
Returns:
an array where each element is a list of edges that constitute a path; it returns an empty array (not null) if there is no such path
See Also:
dataPaths(org.biomoby.client.DataServiceEdge[], org.biomoby.client.ServicesEdge[], org.biomoby.client.DataServiceEdge[])

Version: 1.1.1

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