uk.org.ogsadai.client.toolkit.properties
Class RequestStatus

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.properties.RequestStatus

public final class RequestStatus
extends java.lang.Object

The status of a request at a data service.


Field Summary
static RequestStatus COMPLETED
          The request has completed.
static RequestStatus ERROR
          The request resulted in an error.
static RequestStatus PROCESSING
          The request is being processed.
static RequestStatus TERMINATED
          The request has terminated.
static RequestStatus UNSTARTED
          The request has yet to be started.
 
Method Summary
static RequestStatus createFromProperty(Property property)
          Creates a RequestStatus object from a service data value representing the request status.
 boolean isFinished()
          Returns true if the status indicates a finished state, where a finished status equals RequestStatus.COMPLETE, RequestStatus.ERROR or RequestStatus.TERMINATED.
 boolean isStopped()
          Returns true if the status indicates a stopped state, where a stopped state equals RequestStatus.ERROR or RequestStatus.TERMINATED.
 boolean isUnfinished()
          Returns true iff the status indicates that the we are in a state that does not represent completion.
 boolean isUnstarted()
          Returns true if the status indicates an unstarted state.
 java.lang.String toString()
          Gets a the status in a displayable string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSTARTED

public static final RequestStatus UNSTARTED
The request has yet to be started.


PROCESSING

public static final RequestStatus PROCESSING
The request is being processed.


COMPLETED

public static final RequestStatus COMPLETED
The request has completed.


ERROR

public static final RequestStatus ERROR
The request resulted in an error.


TERMINATED

public static final RequestStatus TERMINATED
The request has terminated.

Method Detail

toString

public java.lang.String toString()
Gets a the status in a displayable string.

Overrides:
toString in class java.lang.Object
Returns:
The status as a string.

isStopped

public boolean isStopped()
Returns true if the status indicates a stopped state, where a stopped state equals RequestStatus.ERROR or RequestStatus.TERMINATED.


isFinished

public boolean isFinished()
Returns true if the status indicates a finished state, where a finished status equals RequestStatus.COMPLETE, RequestStatus.ERROR or RequestStatus.TERMINATED.


isUnfinished

public boolean isUnfinished()
Returns true iff the status indicates that the we are in a state that does not represent completion.

Returns:
true if we are unstarted or currently processing

isUnstarted

public boolean isUnstarted()
Returns true if the status indicates an unstarted state.


createFromProperty

public static RequestStatus createFromProperty(Property property)
                                        throws DataFormatException
Creates a RequestStatus object from a service data value representing the request status.

Parameters:
property - The property obtained from the service.
Returns:
The RequestStatus object corresponding to the status in the given service data value.
DataFormatException