//(c) International Business Machines Corporation, 2002 - 2005. //(c) University of Edinburgh, 2002 - 2005. //See OGSA-DAI-Licence.txt for licencing information. package uk.org.ogsadai.examples.clienttoolkit; import uk.org.ogsadai.client.toolkit.GenericServiceFetcher; import uk.org.ogsadai.client.toolkit.ResourceID; import uk.org.ogsadai.client.toolkit.service.DataService; /** * This example shows how to locate and connect to a Grid Data Service Factory. */ public class LocatingADataService { // Copyright statement private static final String COPYRIGHT_NOTICE = "(c) IBM Corp. 2002 - 2005. (c) The University of Edinburgh 2002 - 2005."; public static void main(String[] args) { // URL of the data service String handle = "http://localhost:8080/wsrf/services/ogsadai/DataService"; try { // Now use the ServiceFetcher to locate the data service System.out.println( "Locating data service with the following handle:\n " + handle); DataService service = GenericServiceFetcher.getInstance().getDataService(handle, null); // Ping the service to see whether it is currently running service.ping(); // List the resources that this data services provides access to ResourceID[] resources = service.getResourceIDs(); System.out.println("The following resources are available at this service:"); for (int i=0; i