uk.org.ogsadai.service.wsrf.dataservice.impl
Class DataServiceImpl

java.lang.Object
  |
  +--uk.org.ogsadai.service.wsrf.dataservice.impl.DataServiceImpl
All Implemented Interfaces:
SecurityContextProvider
Direct Known Subclasses:
ConfigurableDataServiceImpl

public class DataServiceImpl
extends java.lang.Object
implements SecurityContextProvider

This class provides WSRF/GT4-compliant data service objects for exposing OGSA-DAI data service resources as WS-Resources.

The service.resource.DataServiceResource objects are wrapped in WSRF/GT4-compliant service.wsrf.resource.DataServiceResourceWrappers which are maintained in a service.wsrf.resource.DataServiceResourceWrapperHome collection.

The class provides an implementation of the WSDL2Java-generated uk.org.ogsadai.service.wsrf.dataservice.DataServicePortType methods relating to data service-related operations (other operations are expected to be provided by GT4 operation providers).

Deployment descriptor information is expected to be:

For paths in in XML Schema and the like the value of the org.apache.axis.Constants.MC_HOME_DIR of the current org.apache.axis.MessageContext is used as a base (termed the default root directory).

For each data service resource a uk.org.ogsadai.service.wsrf.resource.DataServiceResourceWrapper is created via use of a uk.org.ogsadai.service.wsrf.resource.DataServiceResourceWrapperHome which collects all the data service resources exposed by the service.

Author:
The OGSA-DAI Project Team
See Also:
DataServiceResource, DataServicePortType, DataServiceResourceWrapper, DataServiceResourceWrapperHome

Field Summary
protected  java.lang.String mResourcesFile
           
protected static java.lang.String RESOURCE_ATTR
           
protected static java.lang.String RESOURCE_ELT
           
 
Constructor Summary
DataServiceImpl()
          Create a new data service.
 
Method Summary
protected  org.globus.wsrf.ResourceKey createResource(java.lang.Object id)
          Create a data service resource with the given ID.
 GetResponse getBlock(GetBlock parameters)
          Get part of a batch of data from a stream known to a specific data service resource.
protected  DataServiceResource getDataServiceResource()
          From the current message and request context get the DataServiceResourceWrapper specified within the WS-EPR and pass back the wrapped DataServiceResource.
 GetResponse getFully(GetFully parameters)
          Get all the possible data from stream known to a specific data service resource.
 SecurityContext getSecurityContext()
          Return a security context providing security-related information.
 GetVersionResponse getVersion(GetVersion parameters)
          Return the version string of the service.
 ListResourcesResponse listResources(ListResources parameters)
          Return a list of the names of the data service resources exposed by the service.
 PerformResponse perform(Perform performDocument)
          Submit an OGSA-DAI Perform document to a data service resource.
 PutResponse putBlock(PutBlock parameters)
          Put part of a successive batch of data into a stream known to a specific data service resource.
 PutResponse putFully(PutFully parameters)
          Put some data into a stream known to a specific data service resource.
protected  void throwInternalFault(int msgID, java.lang.String[] params)
          Log an internal problem that occured during some operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_ELT

protected static final java.lang.String RESOURCE_ELT
See Also:
Constant Field Values

RESOURCE_ATTR

protected static final java.lang.String RESOURCE_ATTR
See Also:
Constant Field Values

mResourcesFile

protected java.lang.String mResourcesFile
Constructor Detail

DataServiceImpl

public DataServiceImpl()
                throws InternalFaultType
Create a new data service.

The new object will initialise itself using information within its deployment descriptor if it has not already done so.

Throws:
InternalFaultType - - if some internal problem occurs.
Method Detail

createResource

protected org.globus.wsrf.ResourceKey createResource(java.lang.Object id)
                                              throws ConfigurationFaultType,
                                                     IDAlreadyAssignedFaultType,
                                                     InternalFaultType
Create a data service resource with the given ID.

Parameters:
id - - ID for the data service resource.
Returns:
key of new data service resource.
Throws:
ConfigurationFaultType - - if there is a problem in finding or parsing the configuration files that is the user's fault.
IDAlreadyAssignedFaultType - - if the given ID has already been taken.
InternalFaultType - - if some internal problem occurs.
See Also:
DataServiceResource, DataServiceResourceWrapper, DataServiceResourceWrapperHome.create(java.lang.Object, java.lang.String, java.lang.String, uk.org.ogsadai.common.SecurityContextProvider)

listResources

public ListResourcesResponse listResources(ListResources parameters)
                                    throws java.rmi.RemoteException,
                                           InternalFaultType
Return a list of the names of the data service resources exposed by the service.

Parameters:
parameters - - ignored.
Returns:
list of current data resource names.
Throws:
java.rmi.RemoteException - - never thrown.
InternalFaultType - if the resource informaton cannot be accessed.
See Also:
DataServicePortType.listResources(uk.org.ogsadai.service.types.ListResources)

getVersion

public GetVersionResponse getVersion(GetVersion parameters)
                              throws java.rmi.RemoteException,
                                     InternalFaultType
Return the version string of the service.

Parameters:
parameters - - ignored.
Returns:
version of the service.
Throws:
java.rmi.RemoteException - - never.
InternalFaultType - - never.
See Also:
DataServicePortType.getVersion(uk.org.ogsadai.service.types.GetVersion)

perform

public PerformResponse perform(Perform performDocument)
                        throws java.rmi.RemoteException,
                               AuthorisationFaultType,
                               UnsupportedActivityFaultType,
                               InvalidPerformDocumentFaultType,
                               PerformFaultType,
                               InternalFaultType,
                               ActivityFaultType,
                               ResourceUnknownFaultType
Submit an OGSA-DAI Perform document to a data service resource.

Parameters:
performDocument - - OGSA-DAI Perform document.
Returns:
OGSA-DAI Response document.
Throws:
java.rmi.RemoteException - - never.
ActivityFaultType - - problem with specific activities within the Perform document.
AuthorisationFaultType - - authorisation exception.
InternalFaultType - - internal problem occurs when handling the request.
InvalidPerformDocumentFaultType - - problem with the content of the Perform document.
PerformFaultType - - problem caused during execution of the Perform document that is a consequence of a client error.
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
UnsupportedActivityFaultType - - activity in Perform document is unsupported.
See Also:
DataServicePortType.perform(uk.org.ogsadai.service.perform.types.Perform)

throwInternalFault

protected void throwInternalFault(int msgID,
                                  java.lang.String[] params)
                           throws InternalFaultType
Log an internal problem that occured during some operation. Then throw a fault suitable for the client. Assumes that message ID corresponds to a message that can take the given number of parameters in params.

Parameters:
msgID - - server side log message ID.
params - - further information.
Throws:
InternalFaultType - - fault for client.

putFully

public PutResponse putFully(PutFully parameters)
                     throws java.rmi.RemoteException,
                            AuthorisationFaultType,
                            StreamAccessFaultType,
                            ResourceUnknownFaultType,
                            InternalFaultType
Put some data into a stream known to a specific data service resource.

Parameters:
parameters - - the data and stream ID.
Returns:
success information.
Throws:
java.rmi.RemoteException - - never.
AuthorisationFaultType - - authorisation exception - currently unused.
InternalFaultType - - internal problem occurs when handling the request.
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
StreamAccessFaultType - - the stream is unknown within the context of the data service resource.
See Also:
DataServicePortType.putFully(uk.org.ogsadai.service.transport.types.PutFully)

putBlock

public PutResponse putBlock(PutBlock parameters)
                     throws java.rmi.RemoteException,
                            AuthorisationFaultType,
                            StreamAccessFaultType,
                            ResourceUnknownFaultType,
                            InternalFaultType
Put part of a successive batch of data into a stream known to a specific data service resource.

Parameters:
parameters - - the data and stream ID.
Returns:
success information.
Throws:
java.rmi.RemoteException - - never.
AuthorisationFaultType - - authorisation exception - currently unused.
InternalFaultType - - internal problem occurs when handling the request.
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
StreamAccessFaultType - - the stream is unknown within the context of the data service resource.
See Also:
DataServicePortType.putBlock(uk.org.ogsadai.service.transport.types.PutBlock)

getFully

public GetResponse getFully(GetFully parameters)
                     throws java.rmi.RemoteException,
                            AuthorisationFaultType,
                            StreamAccessFaultType,
                            ResourceUnknownFaultType,
                            InternalFaultType
Get all the possible data from stream known to a specific data service resource.

Parameters:
parameters - - the stream ID.
Returns:
the data.
Throws:
java.rmi.RemoteException - - never.
AuthorisationFaultType - - authorisation exception - currently unused.
InternalFaultType - - internal problem occurs when handling the request.
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
StreamAccessFaultType - - the stream is unknown within the context of the data service resource.
See Also:
DataServicePortType.getFully(uk.org.ogsadai.service.transport.types.GetFully)

getBlock

public GetResponse getBlock(GetBlock parameters)
                     throws java.rmi.RemoteException,
                            AuthorisationFaultType,
                            StreamAccessFaultType,
                            ResourceUnknownFaultType,
                            InternalFaultType
Get part of a batch of data from a stream known to a specific data service resource.

Parameters:
parameters - - the stream ID.
Returns:
the data.
Throws:
java.rmi.RemoteException - - never.
AuthorisationFaultType - - authorisation exception - currently unused.
InternalFaultType - - internal problem occurs when handling the request.
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
StreamAccessFaultType - - the stream is unknown within the context of the data service resource.
See Also:
DataServicePortType.getBlock(uk.org.ogsadai.service.transport.types.GetBlock)

getDataServiceResource

protected DataServiceResource getDataServiceResource()
                                              throws ResourceUnknownFaultType,
                                                     InternalFaultType
From the current message and request context get the DataServiceResourceWrapper specified within the WS-EPR and pass back the wrapped DataServiceResource.

Returns:
DataServiceResource
Throws:
ResourceUnknownFaultType - - WS-EPR specifies a resource unknown to the service.
InternalFaultType - - internal problem occurs when trying to access the resource.

getSecurityContext

public SecurityContext getSecurityContext()
Return a security context providing security-related information.

Specified by:
getSecurityContext in interface SecurityContextProvider
Returns:
context.
See Also:
SecurityContextProvider.getSecurityContext()