uk.org.ogsadai.client.toolkit.wsrf
Class WSRFDataServiceStub

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.wsrf.WSRFDataServiceStub
All Implemented Interfaces:
AxisStub, Stub

public class WSRFDataServiceStub
extends java.lang.Object
implements AxisStub

Author:
The OGSA-DAI Team. Wraps the WSRF data service stubs

Constructor Summary
WSRFDataServiceStub(java.lang.String url)
           
 
Method Summary
 ActivityMetaData getActivityMetaData(ResourceID id, java.lang.String activityName)
          Obtain metadata for an activity
 DataResourceInfo getDataResourceInfo(ResourceID id)
          Obtain data resource information from a data resource
 javax.xml.namespace.QName[] getPortTypes()
          Obtain the port types that this service implements
 Property[] getProperties(ResourceID id, javax.xml.namespace.QName[] names)
          Obtain multiple properties in one request
 Property getProperty(ResourceID id, javax.xml.namespace.QName name)
           
 javax.xml.namespace.QName[] getPropertyNames(ResourceID id)
           
 ResourceID[] getResourceIDs()
          Obtain the IDs of the resources that are associated with this service
 RequestStatus getStatus(ResourceID id)
          Obtain the status of the current request running at the resource with the specified ID.
 org.apache.axis.client.Stub getStub()
          Return Axis stub class to client.
 java.lang.String[] getSupportedActivities(ResourceID id)
          Obtain a list of activities that the specified data resource supports
 java.net.URL getURL()
          Obtain the URL of the data service
 DAIVersion getVersion()
          Obtain the version of this service
 Response perform(ResourceID id, Request request)
          Performs a request against the specified resource.
 void pollUntilRequestCompleted(ResourceID id, int pollInterval, int timeoutPeriod, boolean forever)
          Polls a data service for the request status and blocks until the status is 'COMPLETED'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSRFDataServiceStub

public WSRFDataServiceStub(java.lang.String url)
                    throws java.net.MalformedURLException
Method Detail

perform

public Response perform(ResourceID id,
                        Request request)
                 throws PerformException,
                        UnsupportedActivityException,
                        AuthorisationException,
                        ActivityException,
                        ResourceException,
                        ServiceCommsException,
                        ServerException
Performs a request against the specified resource.

Parameters:
id - resource ID
request -
Returns:
response document
Throws:
PerformException
ActivityException
ServiceCommsException
UnsupportedActivityException
AuthorisationException
ResourceException
ServerException

getResourceIDs

public ResourceID[] getResourceIDs()
                            throws ServiceCommsException,
                                   ServerException
Obtain the IDs of the resources that are associated with this service

Returns:
an array of resource IDs
Throws:
ServiceCommsException
ServerException

getStatus

public RequestStatus getStatus(ResourceID id)
                        throws ServiceCommsException,
                               ResourceException
Obtain the status of the current request running at the resource with the specified ID.

Parameters:
id - resource ID
Returns:
status of currect request
Throws:
ServiceCommsException
ResourceException

getDataResourceInfo

public DataResourceInfo getDataResourceInfo(ResourceID id)
                                     throws ServiceCommsException,
                                            ResourceException
Obtain data resource information from a data resource

Parameters:
id - the resource id of the data resource
Returns:
data resource information
Throws:
ServiceCommsException
DataFormatException
ResourceException

getVersion

public DAIVersion getVersion()
                      throws ServiceCommsException,
                             ServerException
Obtain the version of this service

Returns:
version
Throws:
ServiceCommsException
ServerException

getSupportedActivities

public java.lang.String[] getSupportedActivities(ResourceID id)
                                          throws ServiceCommsException,
                                                 ResourceException
Obtain a list of activities that the specified data resource supports

Parameters:
id - data resource ID
Returns:
an array of activity names
Throws:
ServiceCommsException
DataFormatException
ResourceException

getActivityMetaData

public ActivityMetaData getActivityMetaData(ResourceID id,
                                            java.lang.String activityName)
                                     throws ServiceCommsException,
                                            ResourceException
Obtain metadata for an activity

Parameters:
id - resource ID
activityName - the name of the activity
Returns:
description and name of an activity
Throws:
ServiceCommsException
DataFormatException
ResourceException

getURL

public java.net.URL getURL()
Obtain the URL of the data service

Returns:
the URL

getProperty

public Property getProperty(ResourceID id,
                            javax.xml.namespace.QName name)
                     throws ServiceCommsException,
                            DataFormatException,
                            ResourceException,
                            InvalidPropertyNameException
Parameters:
id -
name -
Returns:
property requested
Throws:
ServiceCommsException
ResourceException
DataFormatException
InvalidPropertyNameException

getProperties

public Property[] getProperties(ResourceID id,
                                javax.xml.namespace.QName[] names)
                         throws ResourceException,
                                ServiceCommsException,
                                InvalidPropertyNameException
Obtain multiple properties in one request

Parameters:
id - data resource id
names - names of the properties to obtain
Returns:
properties
Throws:
ResourceException
ServiceCommsException
DataFormatException
InvalidPropertyNameException

getPropertyNames

public javax.xml.namespace.QName[] getPropertyNames(ResourceID id)

getPortTypes

public javax.xml.namespace.QName[] getPortTypes()
Obtain the port types that this service implements

Returns:
qualified names of the port types

getStub

public org.apache.axis.client.Stub getStub()
Description copied from interface: AxisStub
Return Axis stub class to client.

Specified by:
getStub in interface AxisStub
Returns:
stub.

pollUntilRequestCompleted

public void pollUntilRequestCompleted(ResourceID id,
                                      int pollInterval,
                                      int timeoutPeriod,
                                      boolean forever)
                               throws RequestStatusException,
                                      ServiceCommsException,
                                      ResourceException,
                                      java.lang.IllegalArgumentException
Polls a data service for the request status and blocks until the status is 'COMPLETED'. If at any time the status indicates that the request is not progressing smoothly a RequestStatusException is thrown. If the status has not reached COMPLETED within the specififed timeout period a RequestStatusException is thrown.

Parameters:
pollInterval - time (in milliseconds) between polls
timeoutPeriod - time (in millisconds) to wait before giving up
forever - true if wait forever, false if to timeout
Throws:
RequestStatusException - If the status shows that the requent is not progressing smoothly.
ServiceCommsException - If there was an error communicating with the service.
java.lang.IllegalArgumentException - If the poll internal or the timeout period are less than or equal to 0.
ResourceException