|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.client.toolkit.wsi.WSIDataService
Client-side stub for an OGSA-DAI WSI data service.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE Copyright statement |
private SOAPCallFactory |
mCallFactory Factory for creating SOAPCall objects with the correct settings. |
protected ResourceID |
mResourceID Current data service resource |
private java.net.URL |
mServiceURL URL of the service |
private WSIDataTransport |
mTransport Data transport operations stub |
Constructor Summary | |
WSIDataService(java.lang.String url) Construct a new data service stub for the service at the given URL. |
|
WSIDataService(java.lang.String url, ResourceID resourceID) Construct a new data service stub for the service at the given URL and set up to communicate with a data service resource exposed by the service. |
Method Summary | |
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() Gets the call factory to use for creating new SOAPCall 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() Get the ID of the current data service resource. |
ResourceID[] |
getResourceIDs() Obtain the resource IDs of the resources that are exposed by this service. |
private java.lang.String |
getServiceURL(ResourceID resourceID) Generates the service URL from a resource ID. |
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. |
java.lang.String[] |
getSupportedActivities() Gets the names of the activities supported by a data service resource. |
java.net.URL |
getURL() Obtain the URL of the service |
DAIVersion |
getVersion() Get information on the OGSA-DAI distribution used to deploy the service. |
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. |
private void |
pollUntilRequestCompleted(ResourceID resourceID, SessionID sessionID, int pollInterval, int timeoutPeriod, boolean forever) |
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 |
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 id) Set the ID of the current data service 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 |
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
private WSIDataTransport mTransport
protected ResourceID mResourceID
private final SOAPCallFactory mCallFactory
Constructor Detail |
public WSIDataService(java.lang.String url) throws java.net.MalformedURLException
url
- Data service URL.java.net.MalformedURLException
- If the URL is malformed.public WSIDataService(java.lang.String url, ResourceID resourceID) throws java.net.MalformedURLException
url
- Data service URL.resourceID
- Data service resource name - may be null
java.net.MalformedURLException
- If the URL is malformed.Method Detail |
protected SOAPCallFactory getCallFactory()
SOAPCallFactory
public Response perform(Request request) throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
DataService
perform
in interface DataService
request
- 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 Response perform(RequestComponent component) throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
DataService
This 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 DataService
component
- 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 void terminate() throws ServerException, AuthorisationException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
DataService
terminate
in interface DataService
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.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
DataService
If at any time the status indicates that the request is not progressing smoothly a RequestStatusException
is thrown.
pollUntilRequestCompleted
in interface DataService
sessionID
- 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.private void pollUntilRequestCompleted(ResourceID resourceID, SessionID sessionID, int pollInterval, int timeoutPeriod, boolean forever) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException, RequestStatusException, java.lang.IllegalArgumentException
ServiceCommsException
UnknownPropertyException
ResourceUnknownException
ServerException
AuthorisationException
RequestStatusException
java.lang.IllegalArgumentException
public void pollUntilRequestCompleted(SessionID sessionID, int pollInterval, int timeoutPeriod) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException, RequestStatusException, java.lang.IllegalArgumentException
DataService
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 shows the request has completed or in error, or when an error occurs contacting the service.
pollUntilRequestCompleted
in interface DataService
sessionID
- 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 RequestStatus getStatus(SessionID sessionID) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException
DataService
getStatus
in interface DataService
sessionID
- 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
DataService
getDataResourceInfo
in interface DataService
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.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
DataService
getSupportedActivities
in interface DataService
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.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
DataService
getActivityMetaData
in interface DataService
activityName
- 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 UnknownPropertyException, ResourceUnknownException, AuthorisationException, ServiceCommsException, ServerException
Properties
getProperty
in interface Properties
propertyName
- 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 UnknownPropertyException, ResourceUnknownException, AuthorisationException, ServiceCommsException, ServerException
Properties
getProperties
in interface Properties
names
- 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 DAIVersion getVersion() throws ServiceCommsException, ServerException
DAIService
getVersion
in interface DAIService
ServerException
- If there was an error server-side.ServiceCommsException
- If there was an error communicating with the service.public java.net.URL getURL()
Service
getURL
in interface Service
public ResourceID[] getResourceIDs() throws ServiceCommsException, ServerException
Service
getResourceIDs
in interface Service
ServiceCommsException
- If there was an error communicating with the service.ServerException
- If there was an error server-side.public void setConnectionProperty(ConnectionProperty property)
DataTransport
setConnectionProperty
in interface Service
property
- A connection propertypublic java.lang.Object getFully() throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
DataTransport
getFully
in interface DataTransport
ResourceUnknownException
- 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
DataTransport
getNBlocks
in interface DataTransport
numberOfBlocks
- 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
DataTransport
getBlock
in interface DataTransport
ServiceConstants.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
DataTransport
putFully
in interface DataTransport
data
- 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
DataTransport
putClosingBlock
method should be called to signal to the data service resource that all the data has been forwarded.
putBlock
in interface DataTransport
data
- 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
DataTransport
putBlock
method should no longer be called.
putClosingBlock
in interface DataTransport
ResourceBusyException
- 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()
DataTransport
getDataTransportURL
in interface DataTransport
public ResourceID getResourceID()
getResourceID
in interface DataTransport
public void setResourceID(ResourceID id)
setResourceID
in interface Service
id
- Resource ID.public SessionStreamID getSessionStreamID()
DataTransport
getSessionStreamID
in interface DataTransport
public void setSessionStreamID(SessionStreamID streamID)
DataTransport
setSessionStreamID
in interface DataTransport
streamID
- Session stream identifierpublic Session createSession() throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
DataService
createSession
in interface DataService
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.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
DataService
closeSession
in interface DataService
session
- 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 void ping() throws ServiceCommsException
Service
ping
in interface Service
ServiceCommsException
- If there was an error communicating with the service.public DataTransport createDataTransport(ResourceID resourceID, SessionStreamID stream)
DataService
createDataTransport
in interface DataService
resourceID
- data service resource identifierstream
- session stream identifierDataTransport
objectprivate java.lang.String getServiceURL(ResourceID resourceID)
resourceID
- Resource IDServiceURL/DAIid.getName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |