org.biomoby.registry.rdfagent.verifier
Class MobyServiceComparator
java.lang.Object
org.biomoby.registry.rdfagent.verifier.MobyServiceComparator
public class MobyServiceComparator
- extends Object
This class compares 2 services and determines what it is that is different
between them. If you are interested in the validity of the inputs/outputs for
a particular service, then take a look at
areInputsOutputsForServiceValid(MobyService).
To use this class, do the following:
// create 2 services and do stuff with them
MobyService service1 = new MobyService();
MobyService service2 = new MobyService();
...
// now use the MobyServiceComparator class
MobyServiceComparator c = new MobyServiceComparator();
if (c.areServicesDifferent(service1, service2)) {
// print out the differences
System.out.println(c.getDifferences());
} else {
System.out.println("The 2 services are identical");
}
// lets check if the inputs and outputs for service 1 are valid
if (c.areInputsOutputsForServiceValid(service1)) {
System.out.println("The inputs/outputs are valid!");
}
- Author:
- Eddie created Feb 2, 2006
MobyServiceComparator
public MobyServiceComparator()
- Constructor
areServicesDifferent
public boolean areServicesDifferent(MobyService service1,
MobyService service2)
- Parameters:
service1
- a service to compare to service2service2
- a service to compare with service1
- Returns:
- true if the service signatures are not equal, false otherwise.
For services that are null, true is always returned.
areInputsOutputsForServiceValid
public boolean areInputsOutputsForServiceValid(MobyService service)
- Parameters:
service
- a MobyService object
- Returns:
- true if the service has inputs and outputs that are structured
correctly, i.e. are all named, false otherwise.
getDifferences
public String getDifferences()
- Returns:
- a string of differences for the last comparison of services
getServiceErrors
public String getServiceErrors(MobyService s)
- Parameters:
s
- the service to attempt to extract the errors from
- Returns:
- a string of possible reasons for the prevention of this service
to be registered with a registry
Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010