Chapter 15. Checking the server

15.1. Deployed services list
15.1.1. Deployed services list - Tomcat users
15.1.2. Deployed services list - Globus Toolkit container users
15.2. OGSA-DAI JSP page
15.3. Example clients
15.3.1. Common arguments
15.3.2. Set the CLASSPATH
15.3.3. Server client
15.3.4. SQL client
15.3.5. Secure SQL client
15.3.6. XMLDB client
15.3.7. File client

15.1. Deployed services list

15.1.1. Deployed services list - Tomcat users

If using Tomcat then you can check whether the OGSA-DAI services are available.

If using OGSA-DAI GT and Tomcat then, assuming Tomcat is running, visit the following page using an internet browser: http://HOST:PORT/wsrf/services/. For example: http://localhost:8080/wsrf/services/.

Where:

  • HOST is the host on which Tomcat is running.

  • PORT is the port on which Tomcat accepts connections.

This assumes that the default Globus webapp of wsrf and GAR name of dai were used at deployment.

If all has gone well, you should see a list of services including OGSA-DAI services plus information on their operations and links to their WSDL service description documents. There should be entries for each OGSA-DAI service type:

  • Data source service
  • Session management service
  • Data resource information service
  • Data sink service
  • Data request execution service
  • Request management service

15.1.2. Deployed services list - Globus Toolkit container users

If using OGSA-DAI GT and the Globus Toolkit container then you should see a list of services including the OGSA-DAI ones when you start the Globus Toolkit container, e.g.:

...
[6]: http://127.0.0.1:8998/wsrf/services/dai/DataRequestExecutionService
[7]: http://127.0.0.1:8998/wsrf/services/dai/DataResourceInformationService
[8]: http://127.0.0.1:8998/wsrf/services/dai/DataSinkService
[9]: http://127.0.0.1:8998/wsrf/services/dai/DataSourceService
...
[15]: http://127.0.0.1:8998/wsrf/services/dai/RequestManagementService
...
[19]: http://127.0.0.1:8998/wsrf/services/dai/SessionManagementService
...

This assumes that the default Globus webapp of wsrf and GAR name of dai were used at deployment.

15.2. OGSA-DAI JSP page

If you are using Tomcat then you can check the OGSA-DAI server state at any time using a JSP page that is deployed with OGSA-DAI.

If using OGSA-DAI GT and Tomcat then, assuming Tomcat is running, visit the following page using an internet browser: http://HOST:PORT/wsrf/dai-manager.jsp. For example: http://localhost:8080/wsrf/dai-manager.jsp.

Where:

  • HOST is the host on which Tomcat is running.

  • PORT is the port on which Tomcat accepts connections.

This assumes that the default Globus webapp of wsrf and GAR name of dai were used at deployment.

If all has gone well you should see information on the OGSA-DAI version, the list of deployed resources, including your data resource, and a list of activities known to the server.

[Note]Note
The JSP page is not supported for OGSA-DAI GT on the Globus Toolkit container.

[Note]Note
Visiting the JSP page causes all resources specified in the OGSA-DAI server configuration to be loaded.

15.3. Example clients

As part of OGSA-DAI we provide a set of example clients. These are intended to allow users to quickly test their deployment as well as providing basic examples of how to construct clients using the client toolkit.

[Note]Note
The OGSA-DAI example clients are not intended to be the robust end-to-end applications that we would imagine OGSA-DAI end-users using. OGSA-DAI offers a toolkit which provides developers with the tools to develop their own clients that use OGSA-DAI services - these clients are the simplest examples built using this toolkit.

15.3.1. Common arguments

Arguments common to many of the clients are as follows:

  • Services base URL - this specifies the location of the OGSA-DAI server.

    • For OGSA-DAI GT the services base URL is of form:
      http://HOST:PORT/wsrf/services/dai/
      
  • where
    • HOST is the host on which the container is running.

    • PORT is the port on which the container accepts connections.

  • A resource type name. This is the name of an OGSA-DAI resource type. Section I.2, “Default resource type names” provides a full list of OGSA-DAI resource types.

  • One or more resource IDs. These are just strings possibly with "." delimiters. The following are some examples of resource IDs:

    DataRequestExecutionResource
    JDBCResource
    XMLDBResource
    FileResource
    uk.org.ogsadai.MyBrandNewDataResource
    org.somecompany.com.CustomDataResource
    

15.3.2. Set the CLASSPATH

To set the CLASSPATH in an OGSA-DAI binary distribution:

  • If running under Solaris or Linux run:

    $ source setenv.sh
    

  • If running under Windows run:

    $ setenv.bat
    

The FAQ "Section C.1.18, “ What do I need in my CLASSPATH to be able to run OGSA-DAI clients or compile OGSA-DAI client examples? ”" describes what is needed in the CLASSPATH to run OGSA-DAI clients if the above are not used.

15.3.3. Server client

This is a simple command-line client for running generic queries as to the state of an OGSA-DAI server.

To print the OGSA-DAI server version run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -c getVersion

To print all the resources of a given type known to the server run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -t RESOURCE-TYPE -c listResources

If no -t RESOURCE-TYPE argument is given then all resources are listed.

To print the lifetime of an OGSA-DAI resource run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -r RESOURCE-ID -t RESOURCE-TYPE    \
  -c getLifetime

To print the supported activities of an OGSA-DAI resource run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -r RESOURCE-ID -t RESOURCE-TYPE    \
  -c getActivities

To print the value of an OGSA-DAI resource property run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -r RESOURCE-ID -t RESOURCE-TYPE    \
  -c getProperty -p RESOURCE-PROPERTY-NAME

RESOURCE-PROPERTY-NAME should be the name of a resource property exposed by the resource. Section I.4, “Default resource property names” lists the default resource property names for each type of OGSA-DAI resource.

To print out the WS-EPR of a resource exposed by a service run:

$ java uk.org.ogsadai.client.toolkit.example.ServerClient \
  -u SERVICES-BASE-URL -r RESOURCE-ID -t RESOURCE-TYPE    \
  -c resolve

15.3.4. SQL client

This is a simple command-line client for executing SQL queries on a relational resource and pretty-printing the results. You can specify the ID of the data request execution resource is the OGSA-DAI resource which will execute the request, the ID of the relational data resource at which relational activities in the request (ie. SQLQuery) will be targetted and the SQL query itself.

To run a query on a relational data resource run:

$ java uk.org.ogsadai.client.toolkit.example.SQLClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default JDBCResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/"
  -q SQL-QUERY

For example:

$ java uk.org.ogsadai.client.toolkit.example.SQLClient \
 -u http://localhost:8080/wsrf/services/dai/           \
 -d MyOwnJDBCDataResource                              \
 -q "SELECT * FROM littleblackbook where id < 10"

15.3.5. Secure SQL client

This client is an extension of the SQLClient that allows various Globus Toolkit security settings to be used to secure the communications between the client and the server. It is a useful program to check that server security is configured correctly. You can specify to use either transport level security or message level security with secure conversation. Both security options provide integrity by default but can be specified to additionally provide privacy using encryption. Both security options use host authorization to authorize the server.

To run a query on a relational data resource using security run:

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default JDBCResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/"
  -q SQL-QUERY
  -secconv [encrypt] - use secure conversation [with privacy]
  -tls [encrypt] - use transport level security [with privacy]

For example, to use secure conversation with privacy:

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient  \ 
 -u http://server.full.hostname:8080/wsrf/services/dai/         \
 -d MyOwnJDBCDataResource                                       \
 -q "SELECT * FROM littleblackbook where id < 10"            \
 -secconv encrypt

To use transport level security with integrity:

$ java uk.org.ogsadai.client.toolkit.gt.example.GTSecureSQLClient \ 
 -u https://server.full.hostname:8443/wsrf/services/dai/       \
 -d MyOwnJDBCDataResource                                      \
 -q "SELECT * FROM littleblackbook where id < 10"           \
 -tls

Note that because host authorization is used the client must specify the full name of the server and cannot use localhost.

15.3.6. XMLDB client

This is a simple command-line client for listing collections and resources in XMLDB data resources and running XPath queries and displaying the results. You can specify the ID of the data request execution resource is the OGSA-DAI resource which will execute the request, the ID of the XMLDB data resource at which XMLDB activities in the request (eg. XMLListCollections, XMLListResources, XPath) will be targetted, the XML activity to be executed and any parameters this requires.

To list the collections in an XMLDB data resource run:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default XMLDBResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/";
  -c listCollections   \
  -coll COLLECTION        Optional. Sub-collection to list.

If -coll COLLECTION is ommited then the collections in the base collection of the XMLDB data resource are listed.

For example:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient      \
  -u http://localhost:8080/wsrf/services/dai/"                \
  -d MyOwnXMLDDataResource                                    \
  -c listCollections                                          \
  -coll someSubCollection

To list the resources in an XMLDB data resource run:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default XMLDBResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/";
  -c listResources     \
  -coll COLLECTION     Optional. Sub-collection to list resources of.

If -coll COLLECTION is ommited then the resources in the base collection of the XMLDB data resource are listed.

For example:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient    \
  -u http://localhost:8080/wsrf/services/dai/"              \
  -d MyOwnXMLDDataResource                                  \
  -c listResources                                          \
  -coll someSubCollection

To run an XPath query over the resources in an XMLDB data resource run:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \
  -e DRER-ID           \ Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \ Optional. Default XMLDBResource
  -u SERVICES-BASE-URL \ Optional. Default "http://localhost:8080/dai/services/";
  -c xpath             \
  -coll COLLECTION     \ Optional. Sub-collection to run query in.
  -r RESOURCE          \ Optional. Name of resource in collection to run
                                   query over. 
  -n PREFIX:URN, PREFIX:URN,...  \ Optional. Mappings from namespace
                                             prefixes used in the XPath
                                             query to namespace URNs. 
  -x XPATH-QUERY       Required. XPath query to run.

If -coll COLLECTION is ommited then the resources in the base collection of the XMLDB data resource, and its sub-collections, are queried.

If -r RESOURCE is provided then only the named resource in the sub-collection or base collection (if there is no -coll value given) is queried if there is a resource with that name.

For example:

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \
  -u http://localhost:8080/wsrf/services/dai/           \
  -d MyOwnXMLDDataResource                               \
  -c xpath -x "//*"

$ java uk.org.ogsadai.client.toolkit.example.XMLDBClient \
  -u http://localhost:8080/wsrf/services/dai/            \
  -d MyOwnXMLDDataResource                               \
  -c xpath                                               \
  -coll someSubCollection -resource someXMLDBResource    \
  -n myprefix:http://org.somecompany.com/XML,myprefix2:http://org.someothercompany.com/SomeOtherXML \
  -x "//*/myprefix:SomeElement/myprefix2:SomeOtherElement/"

15.3.7. File client

This is a simple command-line client for listing file system resources and reading files in these and pretty-printing the results. You can specify the ID of the data request execution resource is the OGSA-DAI resource which will execute the request, the ID of the file system data resource at which file activities in the request (eg. ListDirectory or ReadFile) will be targetted, the file activity to be executed and any parameters this requires.

To list the files in a directory of a file system resource run:

$ java uk.org.ogsadai.client.toolkit.example.FileClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default FileResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/";
  -c list              \
  -dir DIR                Optional. Sub-directory to list.

If -d DIR is ommited then the root of the file system resource is listed.

$ java uk.org.ogsadai.client.toolkit.example.FileClient \
 -u http://localhost:8080/wsrf/services/dai             \
 -d MyOwnFileDataResource                               \
 -c list -d somedir

To read a files in a file system resource run:

$ java uk.org.ogsadai.client.toolkit.example.FileClient \
  -e DRER-ID           \  Optional. Default DataRequestExecutionResource
  -d DATA-RESOURCE-ID  \  Optional. Default FileResource
  -u SERVICES-BASE-URL \  Optional. Default "http://localhost:8080/dai/services/";
  -c read              \
  -f FILE

The FILE argument can specify a directory path relative to the root of the file system resource e.g. some/dir/someFile.txt.

For example:

$ java uk.org.ogsadai.client.toolkit.example.FileClient \
 -u http://localhost:8080/wsrf/services/dai             \
 -d MyOwnFileDataResource                               \
 -c read -f some/dir/someFile.txt