When accessing a data resource over the Grid using OGSA-DAI, the first stage is generally to locate a specific Data Service. There are several ways to do this:
This exercise will show you how to obtain a list of data services from a DAISGR. These are the steps:
Once you have listed all registered data services, you can obtain the URL of a suitable data service.
String registryURL = "http://localhost:8080/ogsa/services/ogsadai/DAIServiceGroupRegistry";
Registry registry = OGSIServiceFetcher.getInstance().getRegistry( registryURL );That's all, the Registry object is now ready to use.
URL[] services = sgr.getServices( OGSIConstants.GDSF_PORT_TYPE );This searches for all services implementing the GridDataServiceFactoryPortType portType. The name of the portType is encoded as a QName and is defined in uk.org.ogsadai.service.ogsi.OGSIConstants. The return type is an array of URLs.
ServiceMetaData metadata = sgr.getServiceMetaData(services[0]);The service metadata object holds the URL of the service and the names of the portTypes that this service implements. The metadata that the registry returns is accessed as follows:
URL serviceURL = metadata.getURL(); QName[] portTypes = metadata.getPortTypes();
Element[] description = metadata.getElements();
See OGSA-DAI/examples/tutorials/clienttoolkit/ListingRegisteredFactories.java for an example.
| Back: Obtaining Meta Data | Up: Using the Client Toolkit | Next: Transforming Data |
| © International Business Machines Corporation, 2004. | © The University of Edinburgh, 2004. |