This information is for a release that is no longer supported by the Globus Toolkit. The currently supported versions of the Globus Toolkit are 4.2 (recommended) and 4.0.

WS Information Services : Developer's Guide

Overview
API: Aggregator | Service Data Providers
>WS Service Data Providers
Web Service Data Browser
Querying Service Data (Xpath)
Querying Service Data (ogsi-find-service-data)
Querying Examples
GLUE schema
Migrating from Pre-WS to WS: Porting Guide

Service Data Providers

Service Data Providers gather and generate data for use by Grid service instances.  The data is generated in the form of XML objects, which become the value of a Service Data Element (SDE) emitted as either a Java output stream or a memory-bound Java DOM (Document Object Model) representation.

Service Data Provider components consist of the ServiceDataProviderManager Java class and one or more “plug-in” ServiceDataProvider classes, which are regularly executed by the Service Data Provider Manager (using Java TimerTasks).

These provider plug-in programs can be the supplied providers that are part of GT3.2 or user-created, custom providers.

A valid provider is defined as any Java class that implements at least one of three predefined Java interfaces (SimpleDataProvider, DOMDataProvider, and AsyncDataProvider; see Provider Interfaces below), and generates a well-formed, compatible XML document as the output of its execution.

"Well-formed" above means that the XML document can be parsed in any environment, i.e., any parsing tools written in any programming language can be used.  “Compatible” above means a form compatible with the Service Data Provider Manager, i.e., a Java output stream or DOM representation.

This document contains the following sections:

Service Data Provider Model of Operation

The following diagram presents an overview of Service Data Provider operation:

Core GT3.2 Service Data Providers 

GT 3.2 supplies the following Service Data Providers:

SimpleSystemInformationProvider

A Java-based host information data provider that produces the following types of data:  CPU count, memory statistics, OS type, and logical disk volumes.

HostScriptProvider

A set of shell scripts for Unix systems that output various types of detailed host resource information.  These scripts are basically the same scripts as the Pre-WS Index Services information providers, ported to output XML rather than LDIF, and they provide basically the same information as the Pre-WS Index Services information providers.

AsyncDocumentProvider

A utility provider that uses the AsyncDataProvider interface to periodically read an XML document from disk.  It can be useful for simulations or cases where the provider developer does not have a software interface to the component generating the data.  This provider works with any type of XML data.

ScriptExecutionProvider

A utility provider that provides a simple wrapper for the execution of another program (typically a shell script) that generates the XML document data on its standard output stream.

Creating Custom Service Data Providers

Service Data Providers can be as simple or as complicated as the situation requires.  The baseline case requires only that the provider developer create a Java class implementing the functions of one interface – SimpleDataProvider – whose purpose is to produce XML output in the form of a Java OutputStream as the result of its execution.

The following steps are the essence of creating a new Service Data Provider:

1

Choose the provider interface to be implemented, based on application needs or constraints.

2

Write code to produce your dataset as an XML document.  This can either be in an OS-specific external program, or native Java code that is executed by the provider class itself.

3

Create an entry for the service in which you intend to run the provider in your auxiliary service configuration file.  This service is assumed to have incorporated the functionality of the Service Data Provider Manager, which parses the provider configuration file property specified in the service's deployment descriptor entry (in the default server configuration file, server.config.wsdd), loads the provider, and executes it according to parameters specified by a client service.

Provider Interfaces

The Service Data Provider interfaces are designed to support execution in either a synchronous ("pull") mode or asynchronous ("push") mode.  It is up to the developer to choose the appropriate provider interface to implement, based on specific application needs.

There are three provider interfaces (described below): SimpleDataProvider, DOMDataProvider, and AsyncDataProvider.

SimpleDataProvider

This is a synchronous provider that produces XML output in the form of a Java OutputStream.  The SimpleDataProvider is the basic interface that all Service Data Providers must implement, as follows:

public interface SimpleDataProvider 
  { 
    // Returns the display name of the provider.
    String getName();
    // Returns a description of the provider's functionality.
    String getDescription();
    // If the provider has a set of default arguments,
    // they can be retrieved with this function.
    String getDefaultArgs(); 
    // The provider should return a string representation 
    // of the current error, if any.
    String getErrorString();    
    // Triggers the execution of the provider in order
    // to update the provider's internal state,
    // sending the output to the specified OutputStream. 
    void run(String args, java.io.OutputStream outStream) throws
Exception; 
  } 

DOMDataProvider

This is a synchronous ("pull") extension of SimpleDataProvider that can also produce XML output in the form of a Java org.w3c.dom document.  The DOMDataProvider is the interface for XML Service Data Providers that are capable of emitting this Java document object at run time, as follows:

public interface DOMDataProvider extends SimpleDataProvider  
  { 
    public org.w3c.dom.Document run(String args) throws Exception;  
  } 

AsyncDataProvider

This is an asynchronous version of SimpleDataProvider that allows for "push" mode delivery of data.  To use this interface, the name of a callback function must be specified to the run method, along with a valid ServiceDataProviderDocumentCallback object.  The context parameter is for the caller's use, so that state information or object references can be passed between the calling thread and the callback thread.  This provider is as follows:

public interface AsyncDataProvider extends SimpleDataProvider 
  { 
    // Triggers the asynchronous execution of the provider,
    // which will call the callbackName method on the specified
    // ServiceDataProviderDocumentCallback object. 
    // Context is defined by the calling thread.
    void run(String args, 
             String callbackName,
             ServiceDataProviderDocumentCallback callback,
             Object context) throws Exception;
			 
    // Signals the provider to shut down, cease data callbacks,
    // and free any associated resources.
    void terminate() throws Exception;
	
    // Retrieve the current state
    int getState(); 
	
    // provider states 
    public static final int PROVIDER_IDLE = 0; 
    public static final int PROVIDER_RUNNING = 1; 
    public static final int PROVIDER_ERROR = -1;
    public static final int PROVIDER_TERMINATED = -2;
  }
 
  public interface ServiceDataProviderDocumentCallback
  {
    public Class[] getCallbackParamSig(String methodName);
    public String getDefaultCallbackMethodName();
  } 
  

Service Data Provider Input

Input to Service Data Provider execution is specified via a set of string arguments to the run method.  The argument string that gets passed to the provider is the serviceDataProviderArgs member of the ServiceDataProviderExecutionType structure that is passed to the executeProvider port type method.  The getDefaultArgs method may be used to retrieve a default argument list for the provider. 

For Service Data Provider input, the following is an example of an XML serialized form of parameters to executeProvider :

<provider-exec:ServiceDataProviderExecution> 
 	<provider-exec:serviceDataProviderName>ForkInformation</provider- 
 	exec:serviceDataProviderName> 
	<provider- 
		exec:serviceDataProviderImpl>org.globus.ogsa.impl.base.providers.servicedata.impl. 
		ScriptExecutionProvider</provider-exec:serviceDataProviderImpl> 
	<provider-exec:serviceDataProviderArgs>./etc/globus-gram-fork-provider</provider- 
	exec:serviceDataProviderArgs> 
	<provider-exec:serviceDataName>ForkInformation</provider-exec:serviceDataName> 
	<provider-exec:refreshFrequency>30</provider-exec:refreshFrequency> 
	<provider-exec:async>false</provider-exec:async> 
</provider-exec:ServiceDataProviderExecution>
 

Service Data Provider Output

The output of a Service Data Provider is XML – either in the form of a Java OutputStream or a Java org.w3c.dom document.  This output becomes the value of a Service Data Element and hence available as part of the hosting service's Service Data Elements.  These Service Data Elements can then be used for the various WS Information Services functions.

For example, the following is the XML result produced by the execution of the Simple System Information Provider:

<?xml version="1.0" encoding="UTF-8"?>
<mds:Host xmlns:mds="http://glue.base.ogsa.globus.org/ce/1.1" 
xmlns:ogsi="http://www.gridforum.org/namespaces/2003/03/OGSI" ogsi:goodFrom="2003-06-26T02:57:26.296Z" 
ogsi:goodUntil="2003-06-26T03:17:26.296Z" ogsi:availableUntil="2003-06-26T03:17:26.296Z" mds:Name="localhost" 
mds:UniqueID="localhost" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:type="mds:HostType">
	  <mds:OperatingSystem ogsi:goodFrom="2003-06-26T02:57:26.375Z" ogsi:goodUntil="2003-06-26T03:17:26.375Z" 
ogsi:availableUntil="2003-06-26T03:17:26.375Z" mds:Name="Windows XP" mds:Version="5.1" 
mds:Architecture="x86" />
	  <mds:Processor ogsi:goodFrom="2003-06-26T02:57:26.375Z" ogsi:goodUntil="2003-06-26T03:17:26.375Z" 
ogsi:availableUntil="2003-06-26T03:17:26.375Z" />
	  <mds:MainMemory ogsi:goodFrom="2003-06-26T02:57:26.375Z" ogsi:goodUntil="2003-06-26T03:17:26.375Z" 
ogsi:availableUntil="2003-06-26T03:17:26.375Z" mds:RAMSize="2031616" mds:RAMAvailable="574768" 
mds:VirtualSize="2031616" mds:VirtualAvailable="574768" />
	  <mds:FileSystem ogsi:goodFrom="2003-06-26T02:57:28.968Z" ogsi:goodUntil="2003-06-26T03:17:28.968Z" 
ogsi:availableUntil="2003-06-26T03:17:28.968Z" mds:Name="A:\" />
	<mds:FileSystem ogsi:goodFrom="2003-06-26T02:57:28.968Z" ogsi:goodUntil="2003-06-26T03:17:28.968Z" 
ogsi:availableUntil="2003-06-26T03:17:28.968Z" mds:Name="C:\" />
	<mds:FileSystem ogsi:goodFrom="2003-06-26T02:57:28.968Z" ogsi:goodUntil="2003-06-26T03:17:28.968Z" 
ogsi:availableUntil="2003-06-26T03:17:28.968Z" mds:Name="D:\" />
	<mds:FileSystem ogsi:goodFrom="2003-06-26T02:57:28.968Z" ogsi:goodUntil="2003-06-26T03:17:28.968Z" 
ogsi:availableUntil="2003-06-26T03:17:28.968Z" mds:Name="E:\" />
	<mds:FileSystem ogsi:goodFrom="2003-06-26T02:57:28.968Z" ogsi:goodUntil="2003-06-26T03:17:28.968Z" 
ogsi:availableUntil="2003-06-26T03:17:28.968Z" mds:Name="F:\" />
</mds:Host>