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

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.wsrf.WSRFDataTransport
All Implemented Interfaces:
DataTransport

public class WSRFDataTransport
extends java.lang.Object
implements DataTransport

Wrapper for the DataTransport operations

Author:
The OGSA-DAI Team.

Constructor Summary
WSRFDataTransport(java.net.URL url, ResourceID id, java.lang.String streamID)
           
 
Method Summary
 java.lang.Object getBlock()
          Gets one block from the complete data set from the DT output stream.
 java.net.URL getDataTransportURL()
          Obtain the URL of the data service implementing the data transport interface
 java.lang.Object getFully()
          Gets the entire data set from the Data Transport output stream in one operation.
 java.lang.Object getNBlocks(int numberOfBlocks)
          Gets a number of blocks from the complete data set from the DT output stream as a single block.
 ResourceID getResourceID()
          Obtain the resource ID of the resource this service is interacting with
 java.lang.String getStreamID()
          Get the stream ID
 boolean putBlock(java.lang.Object data)
          Puts one block from a larger data set in to the DT input stream.
 boolean putClosingBlock()
          Signals to the DT input stream that all blocks have been sent, so processing at the data service can be completed.
 boolean putFully(java.lang.Object data)
          Puts the entire data set in to the DT input stream in one operation.
 void setResourceID(ResourceID id)
          Set the resource ID
 void setStreamID(java.lang.String streamID)
          Set the stream ID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSRFDataTransport

public WSRFDataTransport(java.net.URL url,
                         ResourceID id,
                         java.lang.String streamID)
Method Detail

setStreamID

public void setStreamID(java.lang.String streamID)
Set the stream ID

Parameters:
streamID -

getStreamID

public java.lang.String getStreamID()
Get the stream ID

Specified by:
getStreamID in interface DataTransport
Returns:
stream ID.

setResourceID

public void setResourceID(ResourceID id)
Set the resource ID

Parameters:
id -

getDataTransportURL

public java.net.URL getDataTransportURL()
Description copied from interface: DataTransport
Obtain the URL of the data service implementing the data transport interface

Specified by:
getDataTransportURL in interface DataTransport
Returns:
URL

getFully

public java.lang.Object getFully()
                          throws AuthorisationException,
                                 ServiceCommsException,
                                 ServerException
Description copied from interface: DataTransport
Gets the entire data set from the Data Transport output stream in one operation. Uses the DT getFully operation.

Specified by:
getFully in interface DataTransport
Returns:
The entire data set
Throws:
ServiceCommsException - If there is a problem communicating with the data service
ServerException
AuthorisationException

getNBlocks

public java.lang.Object getNBlocks(int numberOfBlocks)
                            throws DataFormatException,
                                   ServiceCommsException
Description copied from interface: DataTransport
Gets a number of blocks from the complete data set from the DT output stream as a single block. Uses the DT getNBlocks operation. Returns null if there are no more blocks to retrieve.

Specified by:
getNBlocks in interface DataTransport
Parameters:
numberOfBlocks - The number of blocks to fetch from the DT output stream at once. These blocks will be amalgamated into a single block
Returns:
The block of data retrieved from the DT output stream, null if there are no more blocks to retrieve
Throws:
ServiceCommsException - If there is a problem communicating with the service.
DataFormatException - If there is a problem with the data.

getBlock

public java.lang.Object getBlock()
                          throws AuthorisationException,
                                 ResourceException,
                                 ServiceCommsException,
                                 ServerException
Description copied from interface: DataTransport
Gets one block from the complete data set from the DT output stream. Uses the DT getBlock operation. Returns null if there are no more blocks to retrieve.

Specified by:
getBlock in interface DataTransport
Returns:
The block of data retrieved from the DT output stream, null if there are no more blocks to retrieve
Throws:
ServerException - If there is a problem at the server
AuthorisationException
ServiceCommsException - If there is a problem communicating with the service.
ResourceException

putFully

public boolean putFully(java.lang.Object data)
                 throws AuthorisationException,
                        ResourceException,
                        ServiceCommsException,
                        ServerException
Description copied from interface: DataTransport
Puts the entire data set in to the DT input stream in one operation. Uses the DT putFully operation.

Specified by:
putFully in interface DataTransport
Parameters:
data - The data set to put in to the DataTransport input stream
Returns:
true if the data was successfully put, false otherwise.
Throws:
ResourceException
AuthorisationException
ServiceCommsException - If there is a problem communicating with the DataTransport input stream
ServerException

putBlock

public boolean putBlock(java.lang.Object data)
                 throws AuthorisationException,
                        ResourceException,
                        ServiceCommsException,
                        ServerException
Description copied from interface: DataTransport
Puts one block from a larger data set in to the DT input stream. Uses the DT putBlock operation. Once all blocks have been submitted using this method, the putClosingBlock method should be called to signal to the data service that all the data has been sent.

Specified by:
putBlock in interface DataTransport
Parameters:
data - The block to put in to the DataTransport input stream
Returns:
true if the data was successfully put, false otherwise.
Throws:
ResourceException
AuthorisationException
ServiceCommsException - If there is a problem communicating with the DataTransport input stream
ServerException

putClosingBlock

public boolean putClosingBlock()
                        throws AuthorisationException,
                               ResourceException,
                               ServiceCommsException,
                               ServerException
Description copied from interface: DataTransport
Signals to the DT input stream that all blocks have been sent, so processing at the data service can be completed. After putClosingBlock has been called, the putBlock method should no longer be used.

Specified by:
putClosingBlock in interface DataTransport
Returns:
true if the closing block was successfully put, false otherwise.
Throws:
ServiceCommsException - If there is a problem communicating with the DataTransport input stream
ServerException
AuthorisationException
ResourceException

getResourceID

public ResourceID getResourceID()
Description copied from interface: DataTransport
Obtain the resource ID of the resource this service is interacting with

Specified by:
getResourceID in interface DataTransport
Returns:
resource ID