|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.client.toolkit.resource.ResourceWrapper
uk.org.ogsadai.client.toolkit.resource.SimpleRequestResource
public class SimpleRequestResource
Simple implementation of a request resource.
| Constructor Summary | |
|---|---|
SimpleRequestResource(Resource resource)
Constructor. |
|
| Method Summary | |
|---|---|
protected RequestExecutionStatus |
fetchExecutionStatus()
Gets the request execution status from the server. |
protected RequestStatus |
fetchRequestStatus()
Gets the request status from the server. |
ActivitiesMetaData |
getActivityDetails()
Gets details of the activities that can be targeted at this resource. |
RequestStatus |
getLocalRequestStatus()
Gets the status of the request as stored locally. |
RequestExecutionStatus |
getRequestExecutionStatus()
Gets the execution status of the request. |
RequestStatus |
getRequestStatus()
Gets the status of the request. |
SessionResource |
getSessionResource()
Gets the session resource associated with this request. |
boolean |
hasSession()
Gets whether or not this request has an associated session. |
void |
pollUntilRequestCompleted(int pollInterval)
Polls a request resource to obtain the latest execution status and blocks until the status indicates that processing is completed. |
void |
pollUntilRequestCompleted(int pollInterval,
int timeoutPeriod)
Polls a request resource to obtain the latest execution status is blocks until the status is COMPLETED. |
void |
pollUntilRequestStarted(int pollInterval)
Polls a request resource to obtain the latest execution status and blocks until the status indicates that processing is started. |
void |
pollUntilRequestStarted(int pollInterval,
int timeoutPeriod)
Polls a request resource to obtain the latest execution status and blocks until the status indicates that processing is started. |
void |
setRequestStatus(RequestStatus requestStatus)
Sets the requests status for the request resource. |
void |
setRequestWorkflow(Workflow requestWorkflow)
Sets the request workflow. |
void |
setSessionResource(SessionResource sessionResource)
Sets the session resource associated with the request. |
| Methods inherited from class uk.org.ogsadai.client.toolkit.resource.ResourceWrapper |
|---|
addServerCommsProperty, destroy, getCurrentTime, getMultipleResourceProperties, getResource, getResourceID, getResourceProperty, getResourceType, getTerminationTime, setTerminationTime, setTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uk.org.ogsadai.client.toolkit.Resource |
|---|
addServerCommsProperty, destroy, getCurrentTime, getMultipleResourceProperties, getResourceID, getResourceProperty, getResourceType, getTerminationTime, setTerminationTime, setTimeout |
| Constructor Detail |
|---|
public SimpleRequestResource(Resource resource)
resource - class implementing the base resource operations| Method Detail |
|---|
public RequestExecutionStatus getRequestExecutionStatus()
throws ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
getRequestExecutionStatus in interface RequestResourceServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong
type.
ClientServerCompatibilityException - if there are incompatibility issues between the client and
the server.
ClientToolkitException - if an internal client toolkit error occurs.public boolean hasSession()
RequestResource
hasSession in interface RequestResourcetrue if the request has an associated session, or
false otherwise.public SessionResource getSessionResource()
RequestResource
getSessionResource in interface RequestResourcenull if there is none.public void setSessionResource(SessionResource sessionResource)
RequestResource
setSessionResource in interface RequestResourcesessionResource - session resource or null if there is no session
associated with this request.public void setRequestWorkflow(Workflow requestWorkflow)
RequestResource
setRequestWorkflow in interface RequestResourcerequestWorkflow - the request workflow.public void setRequestStatus(RequestStatus requestStatus)
RequestResource
setRequestStatus in interface RequestResourcerequestStatus - requests status.
public RequestStatus getRequestStatus()
throws ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
getRequestStatus in interface RequestResourceServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong
type.
ClientServerCompatibilityException - if the data received from the server is cannot be handled by
the client toolkit.
ClientToolkitException - if an internal client toolkit error occurs.
public RequestStatus getLocalRequestStatus()
throws ClientToolkitException
RequestResourcegetRequestStatus.
getLocalRequestStatus in interface RequestResourceClientToolkitException - if an internal client toolkit error occurs.
public ActivitiesMetaData getActivityDetails()
throws ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
Resource
getActivityDetails in interface ResourcegetActivityDetails in class ResourceWrapperServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
public void pollUntilRequestStarted(int pollInterval)
throws RequestErrorException,
ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
If the status shows an error has occurred before starting then a
RequestErrorException 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.
pollUntilRequestStarted in interface RequestResourcepollInterval - Time (in milliseconds) between polls.
RequestErrorException - if the request failed to start due to an error.
ServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong type.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
public void pollUntilRequestStarted(int pollInterval,
int timeoutPeriod)
throws RequestErrorException,
TimeoutException,
ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
If the status shows an error has occured before starting then a
RequestErrorException 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.
pollUntilRequestStarted in interface RequestResourcepollInterval - Time (in milliseconds) between polls.timeoutPeriod - Time (in milliseconds) before timeout.
RequestErrorException - if the request failed to start due to an error
TimeoutException - if the method times out before the request has finished.
ServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong type.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
public void pollUntilRequestCompleted(int pollInterval)
throws RequestExecutionException,
ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
If the final status shows that the request has not completed successfully
a RequestExecutionException 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 RequestResourcepollInterval - Time (in milliseconds) between polls.
RequestExecutionException - if the request failed to run to completion or completes with
an error.
ServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong type.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
public void pollUntilRequestCompleted(int pollInterval,
int timeoutPeriod)
throws RequestExecutionException,
TimeoutException,
ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
RequestResource
If at any time the status indicates that the request is not
progressing smoothly a RequestStatusException is
thrown.
If the execution status has not reached COMPLETED within the specififed
timeout period a RequestStatusException is thrown.
pollUntilRequestCompleted in interface RequestResourcepollInterval - Time (in milliseconds) between polls.timeoutPeriod - Time (in milliseconds) before timeout.
RequestExecutionException - if the request failed to run to completion due to an error,
termination.
TimeoutException - if the method times out before the request has finished.
ServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server or is the wrong type.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
protected RequestStatus fetchRequestStatus()
throws ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
ServerCommsException - if an error occurs communicating with the server.
ServerException - if an internal error occurs at the server.
ResourceUnknownException - if the resource is unknown to the server.
ClientServerCompatibilityException - if the server does not behave as expected.
ClientToolkitException - if an internal client toolkit error occurs.
protected RequestExecutionStatus fetchExecutionStatus()
throws ServerCommsException,
ServerException,
ResourceUnknownException,
ClientServerCompatibilityException,
ClientToolkitException
ServerException - if an internal error occurs at the server.
ClientServerCompatibilityException - if the server does not behave as expected.
ResourceUnknownException - if the resource is unknown to the server.
ClientToolkitException - if an internal client toolkit error occurs.
ServerCommsException - if an error occurs communicating with the server.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||