|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.client.toolkit.wsrf.WSRFDataService
Client-side stub for OGSA-DAI WSRF data services. This class handles the details of SOAP request building, submission and response parsing.
| Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICECopyright statement |
private SOAPCallFactory |
mCallFactoryFactory for creating SOAPCall objects with the correct settings. |
protected ResourceID |
mResourceIDCurrent data service resource |
private java.net.URL |
mServiceURLURL of the service |
private WSRFDataTransport |
mTransportData transport operations stub |
| Constructor Summary | |
WSRFDataService(java.lang.String url)Construct a new data service stub for the service at the given URL. |
|
WSRFDataService(java.lang.String url, ResourceID resourceID)Construct a new data service stub for the service at the given URL and configure it to communicate with a data service resource exposed by the service. |
|
| Method Summary | |
protected void |
addAddressingHeaders(SOAPCall call, ResourceID resourceID)Generates the addressing headers for a given resource ID and adds them to the specified SOAPCall. |
void |
closeSession(Session session)Closes the given session. |
DataTransport |
createDataTransport(ResourceID resourceID, SessionStreamID stream)Creates a new data transport object configured for reading and writing from the specified session stream. |
Session |
createSession()Creates a new session for this service. |
ActivityMetaData |
getActivityMetaData(java.lang.String activityName)Gets the meta-data about a specific activity supported by a data service resource. |
java.lang.Object |
getBlock()Gets a single block of data from the output stream of a data service resource. |
protected SOAPCallFactory |
getCallFactory()Provides subclasses with access to the factory used for creating new call objects. |
DataResourceInfo |
getDataResourceInfo()Gets information on a data resource exposed by 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. |
Property[] |
getProperties(javax.xml.namespace.QName[] names)Obtain multiple properties of a resource. |
Property |
getProperty(javax.xml.namespace.QName propertyName)Obtain a property of a resource. |
ResourceID |
getResourceID()Gets the default resource. |
ResourceID[] |
getResourceIDs()Obtain the resource IDs of the resources that are exposed by this service. |
SessionStreamID |
getSessionStreamID()Gets the session stream ID - the session and stream of that session exposed by the data service resource of interest. |
RequestStatus |
getStatus(SessionID sessionID)Gets the request status of a request executing within a specific session. |
private java.lang.String |
getStringFromResponse(java.util.List response, javax.xml.namespace.QName resultName)Gets a result string from a SOAP response list. |
private java.lang.String[] |
getStringsFromResponse(java.util.List response, javax.xml.namespace.QName resultName)Gets an array of result strings from a SOAP response list. |
java.lang.String[] |
getSupportedActivities()Gets the names of the activities supported by a data service resource. |
java.net.URL |
getURL()Get the service URL. |
DAIVersion |
getVersion()Get information on the OGSA-DAI distribution used to deploy the service. |
private java.util.Vector |
invokeServiceOperation(javax.xml.namespace.QName operationName)Invokes the specified service operation using a SOAP call with an empty body. |
private java.util.Vector |
invokeServiceOperation(javax.xml.namespace.QName operationName, org.apache.axis.message.SOAPBodyElement body)Invokes the specified service operation using a SOAP call. |
private java.util.Vector |
invokeServiceResourceOperation(ResourceID resourceID, javax.xml.namespace.QName operationName, org.apache.axis.message.SOAPBodyElement body)Invokes the specified service resource operation using a SOAP call. |
Response |
perform(Request request)Send a request to a data service resource exposed by a service. |
Response |
perform(RequestComponent component)Send a single activity request to a data service resource exposed by a service. |
void |
ping()Contacts the service to check it is running. |
void |
pollUntilRequestCompleted(SessionID sessionID, int pollInterval)Polls a data service resource exposed by a data service for the request status for a specific session and blocks until the status is 'COMPLETED'. |
void |
pollUntilRequestCompleted(SessionID sessionID, int pollInterval, int timeoutPeriod)Polls a data service resource exposed by a data service for the request status for a specific session and blocks until the status is 'COMPLETED'. |
void |
pollUntilRequestCompleted(SessionID sessionID, int pollInterval, int timeoutPeriod, boolean forever) |
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 |
setProperty(java.lang.String name, java.lang.Object value) |
void |
setResourceID(ResourceID id)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. |
void |
setTimeout(int duration) |
void |
terminate()Send a request termination to a data service resource exposed by a service. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private final java.net.URL mServiceURL
protected ResourceID mResourceID
private final WSRFDataTransport mTransport
private final SOAPCallFactory mCallFactory
| Constructor Detail |
public WSRFDataService(java.lang.String url)
throws java.net.MalformedURLException
url - URL for the data service.java.net.MalformedURLException - If the URL is malformed.
public WSRFDataService(java.lang.String url,
ResourceID resourceID)
throws java.net.MalformedURLException
url - URL for the data service.resourceID - Name of the data service resource to access via the data service. This may be null if access to a data service resource is not required at this time.java.net.MalformedURLException - If the URL is malformed.| Method Detail |
public DAIVersion getVersion()
throws ServerException,
ServiceCommsException
DAIServicegetVersion in interface DAIServiceServerException - If there was an error server-side.ServiceCommsException - If there was an error communicating with the service.
public ResourceID[] getResourceIDs()
throws ServerException,
ServiceCommsException
ServicegetResourceIDs in interface ServiceServiceCommsException - If there was an error communicating with the service.ServerException - If there was an error server-side.
public RequestStatus getStatus(SessionID sessionID)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
DataServicegetStatus in interface DataServicesessionID - Session identifierServiceCommsException - If there was an error communicating with the service.AuthorisationException - If the client is not authorised to perform their request.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.UnknownPropertyException - If the resource property that holds the request status is unknown to the resource.ServerException - If there was an error server-side.
public DataResourceInfo getDataResourceInfo()
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
DataServicegetDataResourceInfo in interface DataServiceResourceUnknownException - If the resource at which the request is targetted is unknown to the service.AuthorisationException - If the client is not authorised to perform their request.UnknownPropertyException - If the resource property that holds the data resource information is unknown to the resource.ServerException - If there was an error server-side.ServiceCommsException - If there was an error communicating with the service.
public java.lang.String[] getSupportedActivities()
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
DataServicegetSupportedActivities in interface DataServiceAuthorisationException - If the client is not authorised to perform their request.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.ServiceCommsException - If there was an error communicating with the service.UnknownPropertyException - If the resource property that holds the activity information is unknown to the resource.ServerException - If there was an error server-side.
public ActivityMetaData getActivityMetaData(java.lang.String activityName)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
DataServicegetActivityMetaData in interface DataServiceactivityName - Name of an activity.ServerException - If there was an error server-side.UnknownPropertyException - If the resource property that holds the activity information is unknown to the resource.ServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.AuthorisationException - If the client is not authorised to perform their request.
public Property getProperty(javax.xml.namespace.QName propertyName)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
PropertiesgetProperty in interface PropertiespropertyName - Qualified name of the propertyUnknownPropertyException - If the property is unknown to the resource.ResourceUnknownException - If the resource is unknown to the service.ServiceCommsException - If there was an error communicating with the service.ServerException - If there was an error server-side.AuthorisationException - If the client is not authorised to access this information.
public Property[] getProperties(javax.xml.namespace.QName[] names)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
PropertiesgetProperties in interface Propertiesnames - An array of qualified names of the properties.ServiceCommsException - If there was an error communicating with the service.AuthorisationException - If the client is not authorised to access this information.UnknownPropertyException - If one of the properties is unknown to the resource.ServerException - If there was an error server-side.ResourceUnknownException - If the resource is unknown to the service.
public Response perform(Request request)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataServiceperform in interface DataServicerequest - Request specifying the work to be performed by a data service resource.Response from the data service resource containing the status of the request and any output results.ResourceBusyException - If the requested resource is too busy to perform the request.RequestException - If there is a problem with the client's request.ServiceCommsException - If there was an error communicating with the service.ServerException - If there was an error server-side.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.AuthorisationException - If the client is not authorised to perform their request.
public void terminate()
throws ServerException,
AuthorisationException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataServiceterminate in interface DataServiceServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.ServerException - If there was an error server-side.ResourceBusyException - If the requested resource is too busy to perform the request.AuthorisationException - If the client is not authorised to perform their request.
public void pollUntilRequestCompleted(SessionID sessionID,
int pollInterval)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException,
RequestStatusException,
java.lang.IllegalArgumentException
DataServiceIf at any time the status indicates that the request is not progressing smoothly a RequestStatusException is thrown.
pollUntilRequestCompleted in interface DataServicesessionID - Session identifier.pollInterval - Time (in milliseconds) between polls.RequestStatusException - if the status shows that the request is not progressing smoothly.ServerException - If there was an error server-side.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.AuthorisationException - If the client is not authorised to perform their request.java.lang.IllegalArgumentException - if sessionID is null or if the poll interval less than or equal to 0.UnknownPropertyException - If the resource property that holds the request status is unknown to the resource.ServiceCommsException - If there was an error communicating with the service.
public void pollUntilRequestCompleted(SessionID sessionID,
int pollInterval,
int timeoutPeriod)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException,
RequestStatusException,
java.lang.IllegalArgumentException
DataServiceIf 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 shows the request has completed or in error, or when an error occurs contacting the service.
pollUntilRequestCompleted in interface DataServicesessionID - Session identifier.pollInterval - Time (in milliseconds) between polls.timeoutPeriod - Time (in millisconds) to wait before giving up.ServerException - If there was an error server-side.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.ServiceCommsException - If there was an error communicating with the service.RequestStatusException - if the status shows that the request is not progressing smoothly.UnknownPropertyException - If the resource property that holds the request status is unknown to the resource.java.lang.IllegalArgumentException - if sessionID is null or if the poll interval less than or equal to 0.AuthorisationException - If the client is not authorised to perform their request.
public void pollUntilRequestCompleted(SessionID sessionID,
int pollInterval,
int timeoutPeriod,
boolean forever)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException,
RequestStatusException,
java.lang.IllegalArgumentException
sessionID -pollInterval -timeoutPeriod -forever -ServiceCommsExceptionUnknownPropertyExceptionResourceUnknownExceptionServerExceptionAuthorisationExceptionRequestStatusExceptionjava.lang.IllegalArgumentExceptionpublic java.net.URL getURL()
getURL in interface Servicepublic void setTimeout(int duration)
public void setProperty(java.lang.String name,
java.lang.Object value)
public Response perform(RequestComponent component)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataServiceThis is a shortcut when the request consists of only one activity. It is functionally equivalent to:
perform(new ActivityRequest(new Activity[]{activity}))
perform in interface DataServicecomponent - RequestComponent specifying the work to be performed by a data service resource.Response from the data service resource containing the status of the request and any output results.AuthorisationException - If the client is not authorised to perform their request.ServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.ResourceBusyException - If the requested resource is too busy to perform the request.RequestException - If there is a problem with the client's request.ServerException - If there was an error server-side.
public Session createSession()
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataServicecreateSession in interface DataServiceServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.RequestException - If there is a problem with the client's request.AuthorisationException - If the client is not authorised to perform their request.ResourceBusyException - If the requested resource is too busy to perform the request.ServerException - If there was an error server-side.
public void closeSession(Session session)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataServicecloseSession in interface DataServicesession - the session to be closedServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource at which the request is targetted is unknown to the service.ServerException - If there was an error server-side.ResourceBusyException - If the requested resource is too busy to perform the request.RequestException - If there is a problem with the client's request.AuthorisationException - If the client is not authorised to perform their request.
public DataTransport createDataTransport(ResourceID resourceID,
SessionStreamID stream)
DataServicecreateDataTransport in interface DataServiceresourceID - data service resource identifierstream - session stream identifierDataTransport objectpublic void setResourceID(ResourceID id)
DataTransportsetResourceID in interface Serviceid - Resource IDpublic void setConnectionProperty(ConnectionProperty property)
DataTransportsetConnectionProperty in interface Serviceproperty - A connection property
public void ping()
throws ServiceCommsException
Serviceping in interface ServiceServiceCommsException - If there was an error communicating with the service.
public java.lang.Object getFully()
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportgetFully in interface DataTransportResourceUnknownException - If the resource is unknown to the service.ResourceBusyException - If the resource is busy.RequestException - If there is a problem with the client's request e.g there is no such session.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ServiceCommsException - If there was an error communicating with the service.ServerException - If there was an error server-side.
public java.lang.Object getNBlocks(int numberOfBlocks)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportgetNBlocks in interface DataTransportnumberOfBlocks - Number of blocks to get.ServiceConstants.NO_MORE_DATA if there is no more data to retrieve.RequestException - If there is a problem with the client's request e.g there is no such session.ResourceUnknownException - If the resource is unknown to the service.ServerException - If there was an error server-side.ServiceCommsException - If there was an error communicating with the service.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ResourceBusyException - If the resource is busy.
public java.lang.Object getBlock()
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportgetBlock in interface DataTransportServiceConstants.NO_MORE_DATA if there is no more data to retrieve.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ResourceUnknownException - If the resource is unknown to the service.RequestException - If there is a problem with the client's request e.g there is no such session.ServiceCommsException - If there was an error communicating with the service.ServerException - If there was an error server-side.ResourceBusyException - If the resource is busy.
public void putFully(java.lang.Object data)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportputFully in interface DataTransportdata - The complete set of data.ServiceCommsException - If there was an error communicating with the service.ResourceUnknownException - If the resource is unknown to the service.RequestException - if there is a problem with the client's request e.g there is no such session.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ServerException - If there was an error server-side.ResourceBusyException - if the resource is busy.
public void putBlock(java.lang.Object data)
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportputClosingBlock method should be called to signal to the data service resource that all the data has been forwarded.
putBlock in interface DataTransportdata - Block of data.ServerException - If there was an error server-side.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ResourceBusyException - if the resource is busy.ResourceUnknownException - If the resource is unknown to the service.ServiceCommsException - If there was an error communicating with the service.RequestException - if there is a problem with the client's request e.g there is no such session.
public void putClosingBlock()
throws ServerException,
AuthorisationException,
RequestException,
ResourceUnknownException,
ResourceBusyException,
ServiceCommsException
DataTransportputBlock method should no longer be called.
putClosingBlock in interface DataTransportResourceBusyException - if the resource is busy.ServerException - If there was an error server-side.ResourceUnknownException - If the resource is unknown to the service.AuthorisationException - If the client is not authorised to access the service, resource, session or stream.ServiceCommsException - If there was an error communicating with the service.RequestException - if there is a problem with the client's request e.g there is no such session.public java.net.URL getDataTransportURL()
DataTransportgetDataTransportURL in interface DataTransportpublic SessionStreamID getSessionStreamID()
DataTransportgetSessionStreamID in interface DataTransportpublic void setSessionStreamID(SessionStreamID streamID)
DataTransportsetSessionStreamID in interface DataTransportstreamID - Session stream identifierpublic ResourceID getResourceID()
DataTransportgetResourceID in interface DataTransportprotected SOAPCallFactory getCallFactory()
SOAPCallFactory
protected void addAddressingHeaders(SOAPCall call,
ResourceID resourceID)
throws ServiceCommsException
call - the SOAP call to generate headers forresourceID - Resource IDServiceCommsException - If the URL of the service that will receive the request is malformed.
private java.util.Vector invokeServiceOperation(javax.xml.namespace.QName operationName)
throws ServerException,
ServiceCommsException
operationName - qualified name of the service operation to invokeVector containing the SOAP responseServerException - if an internal SOAP fault occurs while communicating with the serviceServiceCommsException - if there is another problem communicating with the service
private java.util.Vector invokeServiceOperation(javax.xml.namespace.QName operationName,
org.apache.axis.message.SOAPBodyElement body)
throws ServerException,
ServiceCommsException
operationName - qualified name of the service operation to invokebody - body for the SOAP callVector containing the SOAP responseServerException - if an internal SOAP fault occurs while communicating with the serviceServiceCommsException - if there is another problem communicating with the service
private java.util.Vector invokeServiceResourceOperation(ResourceID resourceID,
javax.xml.namespace.QName operationName,
org.apache.axis.message.SOAPBodyElement body)
throws ServiceCommsException,
UnknownPropertyException,
ResourceUnknownException,
ServerException,
AuthorisationException
resourceID - ID of the service resource to invoke the operation onoperationName - qualified name of the service operation to invokebody - body for the SOAP callVector containing the SOAP responseServerException - if an internal SOAP fault occurs while communicating with the serviceServiceCommsException - if there is another problem communicating with the serviceUnknownPropertyException - if a service property associated with the operation cannot be foundResourceUnknownException - if the resource cannot be foundAuthorisationException - if an authorisation problem occurs while accessing the resource
private java.lang.String getStringFromResponse(java.util.List response,
javax.xml.namespace.QName resultName)
response - a list of SOAPBodyElement objectsresultName - the name of the SOAP body element to extract the result string from
private java.lang.String[] getStringsFromResponse(java.util.List response,
javax.xml.namespace.QName resultName)
response - a list of SOAPBodyElement objectsresultName - the name of the SOAP body elements to extract result strings from
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||