The Client Toolkit Tutorial
Introduction
These pages introduce the OGSA-DAI Client Toolkit, a Java API
providing the basic building blocks for OGSA-DAI client
development. Using these building blocks, a developer can construct
anything from a basic query client to a complex distributed data
integration client with relative ease. The Client Toolkit
minimises the specialist knowledge required to interact with OGSA-DAI
services and shields the developer from future changes.
The OGSA-DAI Client Toolkit supports interaction with OGSA-DAI services
compliant with OGSI, WSRF and WSI.
The main concept of the Client Toolkit is that of the
activity. An activity dictates an
action to be performed by an OGSA-DAI service. OGSA-DAI provides many
different types of activity to perform operations such as SQL queries,
XSL transformations and FTP data delivery. A sequence of one or more
activities can be chained together to form a request. The Client
Toolkit provides a simple mechanism for constructing and processing
requests. The steps involved in a typical
interaction are summarised below:
- Locate an OGSA-DAI data service
- Construct a number of activities
- Chain them together to form a request
- Process the request using the data service
- Process the results of the activities
The remainder of these pages consists of practical examples with
sample code. Starting with a basic query, the examples become
progressively more complex, ending up with a distributed query data
integration scenario. At the bottom of this page is a list of prerequisites that should be satisfied
before following the examples.
Prerequisites
-
The libraries in OGSA-DAI/lib are in
your CLASSPATH:
- For Windows users, type:
$ cd OGSA-DAI
$ .\setenv.bat
- For UNIX csh users, type:
$ cd OGSA-DAI
$ source ./setenv.csh
-
For all other UNIX users, type:
$ cd OGSA-DAI
$ source ./setenv.sh
Note that all paths are relative. When you compile your Java code your
current directory must be OGSA-DAI.
-
We assume that OGSA-DAI services are running on http://localhost:8080/ogsa/services.
-
MySQL and Xindice test databases are set up with the OGSA-DAI example
data - how to set up these databases is described on these pages.
-
The MySQL database can be accessed via:
- an OGSI service located at
http://localhost:8080/ogsa/services/ogsadai/GridDataServiceFactory or
- a WSRF service located at
http://localhost:8080/wsrf/services/ogsadai/DataService and
resource ID MySQLResource or
- a WSI service located at
http://localhost:8080/axis/services/ogsadai/DataService with
resource ID MySQLResource.
-
The Xindice database can be accessed via:
- an OGSI service located at
http://localhost:8080/ogsa/services/ogsadai/GridDataServiceFactoryXindice or
- a WSRF service located at
http://localhost:8080/wsrf/services/ogsadai/DataService and
resource ID XindiceResource or
- a WSI service located at
http://localhost:8080/axis/services/ogsadai/DataService with
resource ID XindiceResource.
Examples
The following pages contain the following:
- A Simple Example
- The Basics
- Locating a data service
- Listing data resources and setting the resource ID
- Performing Queries
- Performing a basic SQL query
- Performing a sequence of queries
- Performing a parameterised SQL query repeatedly
- Performing an XPath Query on a XML database
- Processing Results
- Obtaining activity output from an SQL Query
- Obtaining activity output from an XPath Query
- Updates and Bulk Load
- Updating an XML Database
- Updating a Relational Database
- Bulk loading Data into a Table
- Control Flow
- Request Components
- Flow Control
- Sequence Control
- Obtaining Meta Data
- The Version of a Service
- Listing Data Resources
- Supported Activities and Activity Meta Data
- Product Information of a Data Resource
- Accessing Data Service and Resource Properties
- Accessing a Registry
- Listing registered Data Services
- Transforming Data
- XSL Transformations
- ZIP and GZIP Compression
- Asynchronous Delivery
- Delivering data to and from a URL
- Delivering data to and from a File
- Pulling Data
from a data service back to the Client
- Pushing Data from the Client into a data service
- Pushing Data to another data service
- Pulling Data from another data service
- Data Integration
See the full list of Client
Toolkit Examples.