uk.org.ogsadai.client.monitor
Class DataServiceStatus

java.lang.Object
  |
  +--uk.org.ogsadai.client.monitor.DataServiceStatus

public class DataServiceStatus
extends java.lang.Object

Represents the status of a data service.

Author:
The OGSA-DAI Team.

Nested Class Summary
 class DataServiceStatus.DataServiceStatusObservable
          Observable of the data service status.
 
Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  ResourceID[] mDataResources
          List of data resources at the service
private  DataService mDataService
          the data service
private  java.lang.String mErrorMsg
          Any error that might have occurred when contacting the service
private  DataServiceStatus.DataServiceStatusObservable mObservable
          Observable object
private  ResourceID mResource
          resource id - ignored at the moment
private  java.lang.String mServiceStatus
          service status and version
private  java.lang.String mServiceURL
          URL of the service
private  java.lang.String mVersion
           
static java.lang.String SERVICE_AVAILABLE
           
static java.lang.String SERVICE_NOT_AVAILABLE
           
static java.lang.String UNKNOWN
          Service status constants
 
Constructor Summary
DataServiceStatus(java.lang.String url)
          Constructs a new data service status from an URL and resource ID
 
Method Summary
 void addObserver(java.util.Observer observer)
          Adds an observer of this class
 ResourceID getDataResource()
          Gets the current data resource ID
 ResourceID[] getDataResources()
          Gets the list of data resources that are registered at the service
 java.lang.String getErrorMessage()
          Gets the error message if an error occurred during updateStatus
 java.lang.String getServiceStatus()
          Gets the service status
 java.lang.String getServiceURL()
          Gets the service URL
 java.lang.String getServiceVersion()
          Gets the service version
 void setResourceID(ResourceID id)
          Set the resource ID
private  void setServiceStatusNotAvailable()
          Sets the service status to "NOT AVAILABLE" and service version to "UNKNOWN"
 void updateStatus()
          Updates the status of this service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mDataService

private DataService mDataService
the data service


mServiceURL

private java.lang.String mServiceURL
URL of the service


mResource

private ResourceID mResource
resource id - ignored at the moment


mServiceStatus

private java.lang.String mServiceStatus
service status and version


mVersion

private java.lang.String mVersion

mErrorMsg

private java.lang.String mErrorMsg
Any error that might have occurred when contacting the service


mDataResources

private ResourceID[] mDataResources
List of data resources at the service


mObservable

private DataServiceStatus.DataServiceStatusObservable mObservable
Observable object


UNKNOWN

public static final java.lang.String UNKNOWN
Service status constants

See Also:
Constant Field Values

SERVICE_AVAILABLE

public static final java.lang.String SERVICE_AVAILABLE
See Also:
Constant Field Values

SERVICE_NOT_AVAILABLE

public static final java.lang.String SERVICE_NOT_AVAILABLE
See Also:
Constant Field Values
Constructor Detail

DataServiceStatus

public DataServiceStatus(java.lang.String url)
Constructs a new data service status from an URL and resource ID

Parameters:
url - service URL
Method Detail

setResourceID

public void setResourceID(ResourceID id)
Set the resource ID

Parameters:
id - resource ID

addObserver

public void addObserver(java.util.Observer observer)
Adds an observer of this class

Parameters:
observer -

updateStatus

public void updateStatus()
Updates the status of this service


getServiceStatus

public java.lang.String getServiceStatus()
Gets the service status

Returns:
service status: AVAILABLE or UNAVAILABLE

getServiceVersion

public java.lang.String getServiceVersion()
Gets the service version

Returns:
service version

getErrorMessage

public java.lang.String getErrorMessage()
Gets the error message if an error occurred during updateStatus

Returns:
an error message

getServiceURL

public java.lang.String getServiceURL()
Gets the service URL

Returns:
URL of the service

getDataResource

public ResourceID getDataResource()
Gets the current data resource ID

Returns:
resource ID

getDataResources

public ResourceID[] getDataResources()
Gets the list of data resources that are registered at the service

Returns:
list of resource IDs

setServiceStatusNotAvailable

private void setServiceStatusNotAvailable()
Sets the service status to "NOT AVAILABLE" and service version to "UNKNOWN"