uk.org.ogsadai.client.toolkit.service
Interface DataService

All Superinterfaces:
DAIService, DataTransport, Properties, Service
All Known Implementing Classes:
WSRFDataService

public interface DataService
extends DAIService, DataTransport

Author:
The OGSA-DAI Team. The general OGSA-DAI data service interface that extends the DAIService and DataTransport interfaces.

Method Summary
 void close()
          Used to terminate a clients use of a Data Service.
 ActivityMetaData getActivityMetaData(java.lang.String activityName)
          Retrieves meta data for the specified activity from the data service.
 DataResourceInfo getDataResourceInfo()
          Retrieves the data resource information from the data service.
 RequestStatus getStatus()
          Gets the status of the current request.
 java.lang.String[] getSupportedActivities()
          Retrieves the names of the supported activities from the service.
 Response perform(Request request)
          Sends the request document to a data service.
 Response perform(RequestComponent component)
          Sends a single activity request to the data service.
 void pollUntilRequestCompleted(int pollInterval)
          Polls the data service for the request status and blocks until the status is 'COMPLETED'.
 void pollUntilRequestCompleted(int pollInterval, int timeoutPeriod)
          Polls the data service for the request status and blocks until the status is 'COMPLETED'.
 
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.DAIService
getVersion
 
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.Service
getConnectionProperty, getPortTypes, getResourceIDs, getURL, ping, setConnectionProperty, setResourceID
 
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.Properties
getProperties, getProperty, getPropertyNames
 
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.DataTransport
getBlock, getDataTransportURL, getFully, getNBlocks, getResourceID, getStreamID, putBlock, putClosingBlock, putFully
 

Method Detail

perform

public Response perform(Request request)
                 throws ServerException,
                        ActivityException,
                        AuthorisationException,
                        ResourceException,
                        ServiceCommsException,
                        UnsupportedActivityException,
                        PerformException
Sends the request document to a data service. The service will attempt to process the request and send a response.

Parameters:
request - Request specifying the work to be performed at the data service.
Returns:
Response from the data service containing the status of the request and any output results.
Throws:
PerformException - If there is a problem at the service that prevents the request from starting to process.
ActivityException - If an activity produces an error when executed at the service, causing the request to fail.
ServiceCommsException - If there was an error communicating with the service.
UnsupportedActivityException
PerformException
java.lang.IllegalArgumentException - If the argument is null.
ServerException
AuthorisationException
ResourceException

perform

public Response perform(RequestComponent component)
                 throws ActivityException,
                        AuthorisationException,
                        ResourceException,
                        UnsupportedActivityException,
                        ServerException,
                        ServiceCommsException,
                        PerformException
Sends a single activity request to the data service. The data service will attempt to process the request and send a response.

This is a shortcut when the request consists of only one activity. It is functionally equivalent to:
perform( new ActivityRequest( new Activity[] { activity } ) )

Parameters:
component - Activity to be performed.
Returns:
Response from the data service containing the status of the request and any output results.
Throws:
PerformException - If there is a problem at the service that prevents the request from starting to process.
ActivityException - If an activity produces an error when executed at the service, causing the request to fail.
ServiceCommsException - If there was an error communicating with the service.
PerformException
java.lang.IllegalArgumentException - If the argument is null.
AuthorisationException
ResourceException
UnsupportedActivityException
ServerException

getStatus

public RequestStatus getStatus()
                        throws ServiceCommsException,
                               ResourceException,
                               AuthorisationException
Gets the status of the current request.

Returns:
The status of the current request.
Throws:
ServiceCommsException - If there was an error communicating with the service.
ResourceException
AuthorisationException

pollUntilRequestCompleted

public void pollUntilRequestCompleted(int pollInterval)
                               throws AuthorisationException,
                                      RequestStatusException,
                                      ResourceException,
                                      ServiceCommsException,
                                      java.lang.IllegalArgumentException
Polls the 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.

Parameters:
pollInterval - time (in milliseconds) between polls
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 less than or equal to 0.
AuthorisationException
ResourceException

pollUntilRequestCompleted

public void pollUntilRequestCompleted(int pollInterval,
                                      int timeoutPeriod)
                               throws RequestStatusException,
                                      ResourceException,
                                      ServiceCommsException,
                                      java.lang.IllegalArgumentException,
                                      AuthorisationException
Polls the 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.

This method does not timeout. It will only terminate when the status showns the request is completed or in error, or when an error occurs contacting the service.

Parameters:
pollInterval - time (in milliseconds) between polls
timeoutPeriod - time (in millisconds) to wait before giving up
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 is less than or equal to 0.
ResourceException
AuthorisationException

getDataResourceInfo

public DataResourceInfo getDataResourceInfo()
                                     throws ServiceCommsException,
                                            ResourceException,
                                            AuthorisationException
Retrieves the data resource information from the data service.

Returns:
information on the data resource
Throws:
ServiceCommsException - If there was an error communicating with the service.
DataFormatException - If the property returned by the service did not have the expected format
ResourceException
AuthorisationException

getSupportedActivities

public java.lang.String[] getSupportedActivities()
                                          throws ServiceCommsException,
                                                 ResourceException,
                                                 AuthorisationException
Retrieves the names of the supported activities from the service.

Returns:
all supported activities
Throws:
ServiceCommsException - If there was an error communicating with the service.
DataFormatException - If the property returned by the service did not have the expected format
ResourceException
AuthorisationException

getActivityMetaData

public ActivityMetaData getActivityMetaData(java.lang.String activityName)
                                     throws ServiceCommsException,
                                            ResourceException,
                                            AuthorisationException
Retrieves meta data for the specified activity from the data service.

Parameters:
activityName - the name of a supported activity
Returns:
meta data
ServiceCommsException
ResourceException
AuthorisationException

close

public void close()
           throws ServiceCommsException,
                  ServiceTerminationException
Used to terminate a clients use of a Data Service.

The method will destroy an OGSI (GT3) Data Service. It will do nothing on other platforms.

Throws:
ServiceCommsException - If there was a problem accessing the service
ServiceTerminationException - If there was a problem when trying to terminate the service