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

All Known Subinterfaces:
ConfigurableDataService, DataService
All Known Implementing Classes:
ConfigurableWSIDataService, ConfigurableWSRFDataService, WSIDataService, WSIDataTransport, WSRFDataService, WSRFDataTransport

public interface DataTransport

Interface for data service proxies that provides the data transport operations of a data service.

Author:
The OGSA-DAI Project Team

Method Summary
 java.lang.Object getBlock()
          Gets a single block of data from the output stream of a data service resource.
 java.net.URL getDataTransportURL()
          Obtain the URL of the data service.
 java.lang.Object getFully()
          Gets an entire data set from the output stream of a data service resource in one go.
 java.lang.Object getNBlocks(int numberOfBlocks)
          Gets an number of blocks of data from the output stream of a data service resource in one go.
 ResourceID getResourceID()
          Gets the default resource.
 SessionStreamID getSessionStreamID()
          Gets the session stream ID - the session and stream of that session exposed by the data service resource of interest.
 void putBlock(java.lang.Object data)
          Puts one block of data onto a data service resource input stream.
 void putClosingBlock()
          Inform a data service resource that it can close an input stream as all data has been forwarded.
 void putFully(java.lang.Object data)
          Puts an entire data set onto a data service resource input stream in one go.
 void setConnectionProperty(ConnectionProperty property)
          Configure the connection with a property.
 void setResourceID(ResourceID resourceID)
          Sets the default resource.
 void setSessionStreamID(SessionStreamID streamID)
          Sets the session stream ID - the session and stream of that session exposed by the data service resource of interest.
 

Method Detail

getFully

public java.lang.Object getFully()
                          throws ServerException,
                                 AuthorisationException,
                                 RequestException,
                                 ResourceUnknownException,
                                 ResourceBusyException,
                                 ServiceCommsException
Gets an entire data set from the output stream of a data service resource in one go.

Returns:
entire data set
Throws:
RequestException - If there is a problem with the client's request e.g there is no such session.
ResourceBusyException - If the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

getNBlocks

public java.lang.Object getNBlocks(int numberOfBlocks)
                            throws ServerException,
                                   AuthorisationException,
                                   RequestException,
                                   ResourceUnknownException,
                                   ResourceBusyException,
                                   ServiceCommsException
Gets an number of blocks of data from the output stream of a data service resource in one go. The blocks are aggregated to form a single larger block.

Parameters:
numberOfBlocks - Number of blocks to get.
Returns:
the aggregated block of data retrieved or ServiceConstants.NO_MORE_DATA if there is no more data to retrieve.
Throws:
RequestException - If there is a problem with the client's request e.g there is no such session.
ResourceBusyException - If the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

getBlock

public java.lang.Object getBlock()
                          throws ServerException,
                                 AuthorisationException,
                                 RequestException,
                                 ResourceUnknownException,
                                 ResourceBusyException,
                                 ServiceCommsException
Gets a single block of data from the output stream of a data service resource.

Returns:
the block of data retrieved or ServiceConstants.NO_MORE_DATA if there is no more data to retrieve.
Throws:
RequestException - If there is a problem with the client's request e.g there is no such session.
ResourceBusyException - If the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

putFully

public void putFully(java.lang.Object data)
              throws ServerException,
                     AuthorisationException,
                     RequestException,
                     ResourceUnknownException,
                     ResourceBusyException,
                     ServiceCommsException
Puts an entire data set onto a data service resource input stream in one go.

Parameters:
data - The complete set of data.
Throws:
RequestException - if there is a problem with the client's request e.g there is no such session.
ResourceBusyException - if the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

putBlock

public void putBlock(java.lang.Object data)
              throws ServerException,
                     AuthorisationException,
                     RequestException,
                     ResourceUnknownException,
                     ResourceBusyException,
                     ServiceCommsException
Puts one block of data onto a data service resource input stream. Once all blocks have been submitted using this method, the putClosingBlock method should be called to signal to the data service resource that all the data has been forwarded.

Parameters:
data - Block of data.
Throws:
RequestException - if there is a problem with the client's request e.g there is no such session.
ResourceBusyException - if the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

putClosingBlock

public void putClosingBlock()
                     throws ServerException,
                            AuthorisationException,
                            RequestException,
                            ResourceUnknownException,
                            ResourceBusyException,
                            ServiceCommsException
Inform a data service resource that it can close an input stream as all data has been forwarded. After a call to this method the putBlock method should no longer be called.

Throws:
RequestException - if there is a problem with the client's request e.g there is no such session.
ResourceBusyException - if the resource is busy.
ResourceUnknownException - If the resource is unknown to the service.
AuthorisationException - If the client is not authorised to access the service, resource, session or stream.
ServerException - If there was an error server-side.
ServiceCommsException - If there was an error communicating with the service.

getDataTransportURL

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

Returns:
URL

getSessionStreamID

public SessionStreamID getSessionStreamID()
Gets the session stream ID - the session and stream of that session exposed by the data service resource of interest.

Returns:
session stream ID

setSessionStreamID

public void setSessionStreamID(SessionStreamID streamID)
Sets the session stream ID - the session and stream of that session exposed by the data service resource of interest.

Parameters:
streamID - Session stream identifier

getResourceID

public ResourceID getResourceID()
Gets the default resource. Any resource-specific requests will be targetted at the resource with this ID.

Returns:
resource ID.

setResourceID

public void setResourceID(ResourceID resourceID)
Sets the default resource. Any resource-specific requests will be targetted at the resource with this ID.

Parameters:
resourceID - Resource ID

setConnectionProperty

public void setConnectionProperty(ConnectionProperty property)
Configure the connection with a property.

Parameters:
property - A connection property
Throws:
java.lang.IllegalArgumentException - if the property parameter is null