Dynamically Exposing Data Service Resources via Data Services via the Command-line

If your data service is configurable then you can request that the data service immediately expose the data service resource, without having to restart your Web services container. This is done as follows:

  1. Run the following command from within the OGSA-DAI WSRF binary distribution directory:
    $ ant dataServiceClient -Ddai.url=SERVICE-URL
          -Ddai.resource.id=RESOURCE-ID -Ddai.action=deploy
    
    where For example:
    $ ant dataServiceClient 
     -Ddai.url=http://localhost:8080/wsrf/services/ogsadai/MyDataService
     -Ddai.resource.id=MyNewResource -Ddai.action=deploy
    
  2. The request will be forwarded to the data service. For example:
    [echo] Deploying resource  MyNewResource...
    [java] Contacting ... http://localhost:8080/wsrf/services/ogsadai/DataService
    [java] Service version: OGSA-DAI WSRF 2.1
    [java] Number of resources: 1
    [java] Resource: MySQLResource
    [java] Data Service Resource: MyNewResource
    [java] About to invoke Deploy...
    [java] Deploy completed!
    
  3. You can now use the listResourcesClient client to check if the operation was successful.

During this operation the service will attempt to update a data service resources file on the server. If this fails then a ServerException will occur with a corresponding message. The new data service resource will still be available via the data service but not if the container is shutdown and restarted. If such a failure occurs you can always expose the data service resource to the data service using the command-line ( exposeResource). or GUI-based (guiExposeResource) approaches described earlier.

Note that when exposing new data service resources dynamically via configurable data service this only works if the JARs required by the data service resource (e.g. database driver JARs) are already within the web service container's library directories. If this is not the case then the container has to be restarted.