|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for data service proxies that provides standard operations of a data 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. |
DataResourceInfo |
getDataResourceInfo() Gets information on a data resource exposed by a data service resource. |
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. |
Response |
perform(Request request) Send a request to a data service resource exposed by a service. |
Response |
perform(RequestComponent request) Send a single activity request to a data service resource exposed by a service. |
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 |
terminate() Send a request termination to a data service resource exposed by a service. |
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.DAIService |
getVersion |
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.Service |
getResourceIDs, getURL, ping, setConnectionProperty, setResourceID |
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.Properties |
getProperties, getProperty |
Methods inherited from interface uk.org.ogsadai.client.toolkit.service.DataTransport |
getBlock, getDataTransportURL, getFully, getNBlocks, getResourceID, getSessionStreamID, putBlock, putClosingBlock, putFully, setConnectionProperty, setResourceID, setSessionStreamID |
Method Detail |
public Response perform(Request request) throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
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.RequestException
- If there is a problem with the client's request.AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.java.lang.IllegalArgumentException
- if request
is null
.public void terminate() throws ServerException, AuthorisationException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.public Response perform(RequestComponent request) throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
This is a shortcut when the request consists of only one activity. It is functionally equivalent to:
perform(new ActivityRequest(new Activity[]{activity}))
request
- 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.RequestException
- If there is a problem with the client's request.AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.java.lang.IllegalArgumentException
- if request
is null
.public Session createSession() throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
ServiceCommsException
- If there was an error communicating with the service.ResourceBusyException
- If the requested resource is too busy to perform the request.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.ServerException
- If there was an error server-side.public void closeSession(Session session) throws ServerException, AuthorisationException, RequestException, ResourceUnknownException, ResourceBusyException, ServiceCommsException
session
- the session to be closedServiceCommsException
- If there was an error communicating with the service.ResourceBusyException
- If the requested resource is too busy to perform the request.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.ServerException
- If there was an error server-side.public RequestStatus getStatus(SessionID sessionID) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException
sessionID
- Session identifierAuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the request status is unknown to the resource.java.lang.IllegalArgumentException
- if sessionID
is null
.public void pollUntilRequestCompleted(SessionID sessionID, int pollInterval) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException, RequestStatusException
If at any time the status indicates that the request is not progressing smoothly a RequestStatusException
is thrown.
sessionID
- Session identifier.pollInterval
- Time (in milliseconds) between polls.AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the request status is unknown to the resource.RequestStatusException
- if the status shows that the request is not progressing smoothly.java.lang.IllegalArgumentException
- if sessionID
is null
or if the poll interval less than or equal to 0.public void pollUntilRequestCompleted(SessionID sessionID, int pollInterval, int timeoutPeriod) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException, RequestStatusException, java.lang.IllegalArgumentException
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.
sessionID
- Session identifier.pollInterval
- Time (in milliseconds) between polls.timeoutPeriod
- Time (in millisconds) to wait before giving up.AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the request status is unknown to the resource.RequestStatusException
- if the status shows that the request is not progressing smoothly.java.lang.IllegalArgumentException
- if sessionID
is null
or if the poll interval less than or equal to 0.public DataResourceInfo getDataResourceInfo() throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException
AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the data resource information is unknown to the resource.public java.lang.String[] getSupportedActivities() throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException
AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the activity information is unknown to the resource.public ActivityMetaData getActivityMetaData(java.lang.String activityName) throws ServiceCommsException, UnknownPropertyException, ResourceUnknownException, ServerException, AuthorisationException
activityName
- Name of an activity.AuthorisationException
- If the client is not authorised to perform their request.ServerException
- If there was an error server-side.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.UnknownPropertyException
- If the resource property that holds the activity information is unknown to the resource.java.lang.IllegalArgumentException
- if activityName
is null
.public DataTransport createDataTransport(ResourceID resourceID, SessionStreamID stream)
resourceID
- data service resource identifierstream
- session stream identifierDataTransport
object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |