Version: 1.1.1

org.biomoby.client
Class ServicesEdge

java.lang.Object
  extended by org.biomoby.client.ServicesEdge
Direct Known Subclasses:
DataServiceEdge

public class ServicesEdge
extends Object

An instance of this class is a container for a pair of Moby service definitions, and for an information how they can be connected. You can imagine that instances of this class represent edges in a graph of services.

The instances are suitable for creation of graphs, but also, for example, for building automatic clients that exchange data between several services.

Version:
$Id: ServicesEdge.java,v 1.7 2005/11/20 12:30:51 senger Exp $
Author:
Martin Senger
See Also:
ServiceConnections

Field Summary
static int BOTH_COLLECTIONS_CONNECTION
           
static int HEAD_COLLECTION_CONNECTION
           
static int NO_CONNECTION
          Indicates that there is no information how the services are connected.
static int NO_OUTPUT
           
static String NS_DIVIDER
          A divider used in connectors to separate namespace and data type name.
static int SIMPLE_CONNECTION
           
static int TAIL_COLLECTION_CONNECTION
           
 
Constructor Summary
ServicesEdge(MobyService sourceService, int connectionType)
          Constructs an instance with a source service and a connection type.
ServicesEdge(MobyService sourceService, MobyService targetService, String connector)
          Constructs an instance with both source and target services, and a connector.
ServicesEdge(MobyService sourceService, String connector)
          Constructs an instance with a source service and a connector.
 
Method Summary
 String extractNamespace()
           
 int getConnectionType()
          Retrieves connection type.
 String getConnector()
          Retrieves connector.
 String getId()
           
 MobyService getSourceService()
          Retrieves the source service.
 MobyService getTargetService()
          Retrieves the target service.
 boolean isWeakConnection()
          Returns quality of this connection.
 void setConnectionType(int connectionType)
          Sets connection type.
 void setConnector(String connector)
          Sets connector.
 void setWeakConnection(boolean weak)
          Sets quality of this connection.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_CONNECTION

public static final int NO_CONNECTION
Indicates that there is no information how the services are connected.

See Also:
Constant Field Values

SIMPLE_CONNECTION

public static final int SIMPLE_CONNECTION
See Also:
Constant Field Values

HEAD_COLLECTION_CONNECTION

public static final int HEAD_COLLECTION_CONNECTION
See Also:
Constant Field Values

TAIL_COLLECTION_CONNECTION

public static final int TAIL_COLLECTION_CONNECTION
See Also:
Constant Field Values

BOTH_COLLECTIONS_CONNECTION

public static final int BOTH_COLLECTIONS_CONNECTION
See Also:
Constant Field Values

NO_OUTPUT

public static final int NO_OUTPUT
See Also:
Constant Field Values

NS_DIVIDER

public static final String NS_DIVIDER
A divider used in connectors to separate namespace and data type name.

See Also:
Constant Field Values
Constructor Detail

ServicesEdge

public ServicesEdge(MobyService sourceService,
                    int connectionType)
Constructs an instance with a source service and a connection type. It prints a warning on the STDERR if the connection type is unknown.


ServicesEdge

public ServicesEdge(MobyService sourceService,
                    String connector)
Constructs an instance with a source service and a connector. This is usually used for services not connected with other services.


ServicesEdge

public ServicesEdge(MobyService sourceService,
                    MobyService targetService,
                    String connector)
Constructs an instance with both source and target services, and a connector. This is usually a normal case - the connection type is set to SIMPLE but can be overwritten by setConnectionType(int) later.

Method Detail

getId

public String getId()

toString

public String toString()
Overrides:
toString in class Object

extractNamespace

public String extractNamespace()

getSourceService

public MobyService getSourceService()
Retrieves the source service.

Returns:
the source service

getTargetService

public MobyService getTargetService()
Retrieves the target service.

Returns:
the target service

setConnector

public void setConnector(String connector)
Sets connector.

Parameters:
connector - is a string representing namespace and data type linking together source and target services

getConnector

public String getConnector()
Retrieves connector.

Returns:
connector
See Also:
setConnector(java.lang.String)

setConnectionType

public void setConnectionType(int connectionType)
Sets connection type.

Parameters:
connectionType - is a new connection type. It prints a warning on the STDERR if the connection type is unknown.

getConnectionType

public int getConnectionType()
Retrieves connection type.

Returns:
connection type

setWeakConnection

public void setWeakConnection(boolean weak)
Sets quality of this connection.

Parameters:
weak - value TRUE suggests to consider the connection weak
See Also:
isWeakConnection

isWeakConnection

public boolean isWeakConnection()
Returns quality of this connection.

What is a "weak connection"? It indicates that one or both involved services have more than one input or output but the other service in the pair can provide less (usually just one) inputs or outputs. This may not be wrong (it depends on the service itself how can deal with missing inputs) but it is worth to mentioned it somewhere.

Returns:
true if the connection between two services is considered weak

Version: 1.1.1

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