uk.org.ogsadai.client.toolkit
Interface Resource

All Known Subinterfaces:
DataRequestExecutionResource, DataResource, DataSinkResource, DataSourceResource, RequestResource, SessionResource
All Known Implementing Classes:
BaseDataRequestExecutionResource, BaseDataSinkResource, BaseDataSourceResource, BaseResource, JerseyDataSink, JerseyDataSource, JerseyDRERResource, JerseyResource, ResourceWrapper, SimpleDataResource, SimpleRequestResource, SimpleSessionResource, TransformDataRequestExecutionResource

public interface Resource

Interface for a Resource.

Author:
The OGSA-DAI Project Team

Method Summary
 void addServerCommsProperty(java.lang.String propertyName, java.lang.Object value)
          Adds a server communications property to the resource.
 void destroy()
          Destroys the resource.
 ActivitiesMetaData getActivityDetails()
          Gets details of the activities that can be targeted at this resource.
 java.util.Date getCurrentTime()
          Gets current time at the server.
 ResourceProperty[] getMultipleResourceProperties(ResourcePropertyName[] names)
          Gets the specified resource properties.
 ResourceID getResourceID()
          Gets the ID of this resource.
 ResourceProperty getResourceProperty(ResourcePropertyName name)
          Gets the specified resource property.
 ResourceType getResourceType()
          Gets the type of this resource.
 java.util.Date getTerminationTime()
          Gets the resource's current termination time.
 TerminationTime setTerminationTime(java.util.Date requestedTerminationTime)
          Requests that the termination time of the resource be changed.
 void setTimeout(int timeout)
          Sets the timeout to use for calls to this resource.
 

Method Detail

getResourceType

ResourceType getResourceType()
Gets the type of this resource.

Returns:
the resource type.

getResourceID

ResourceID getResourceID()
Gets the ID of this resource. This ID is not globally unique but is unique within a specific OGSA-DAI instance.

Returns:
the resource ID.

getResourceProperty

ResourceProperty getResourceProperty(ResourcePropertyName name)
                                     throws ServerCommsException,
                                            ServerException,
                                            ClientServerCompatibilityException,
                                            ResourceUnknownException,
                                            PropertyNameInvalidException
Gets the specified resource property.

Parameters:
name - name of the desired resource property.
Returns:
the resource property value.
Throws:
ServerException - if an internal error occurs at the server.
ClientServerCompatibilityException - if the server does not behave as expected.
PropertyNameInvalidException - if resource does not contain the specified property.
ResourceUnknownException - if the resource is unknown to the server.
ServerCommsException - if an error occurs communicating with the server.

getMultipleResourceProperties

ResourceProperty[] getMultipleResourceProperties(ResourcePropertyName[] names)
                                                 throws ServerCommsException,
                                                        ServerException,
                                                        ClientServerCompatibilityException,
                                                        ResourceUnknownException,
                                                        PropertyNameInvalidException
Gets the specified resource properties.

Parameters:
names - names of the desired resource properties.
Returns:
the resource property values.
Throws:
ServerException - if an internal error occurs at the server.
ClientServerCompatibilityException - if the server does not behave as expected.
PropertyNameInvalidException - if resource does not contain the specified property.
ResourceUnknownException - if the resource is unknown to the server.
ServerCommsException - if an error occurs communicating with the server.

destroy

void destroy()
             throws ServerCommsException,
                    ServerException,
                    ClientServerCompatibilityException,
                    ResourceUnknownException,
                    ResourceNotDestroyedException
Destroys the resource.

Throws:
ServerException - if an internal error occurs at the server.
ClientServerCompatibilityException - if the server does not behave as expected.
ResourceNotDestroyedException - if the resource could not be destroyed for a reason other than authorization.
ResourceUnknownException - if the resource is unknown to the server.
ServerCommsException - if an error occurs communicating with the server.

setTerminationTime

TerminationTime setTerminationTime(java.util.Date requestedTerminationTime)
                                   throws ServerCommsException,
                                          ServerException,
                                          ClientServerCompatibilityException,
                                          ResourceUnknownException,
                                          UnableToSetTerminationTimeException,
                                          TerminationTimeChangeRejectedException
Requests that the termination time of the resource be changed.

Parameters:
requestedTerminationTime - the desired resource termination time.
Returns:
details of the new termination time.
Throws:
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.
TerminationTimeChangeRejectedException - if the request to change the termination time was rejected.
ServerCommsException - if an error occurs communicating with the server.
UnableToSetTerminationTimeException - if the termination time cannot be changed for a reason other than authorization.

getCurrentTime

java.util.Date getCurrentTime()
                              throws ServerCommsException,
                                     ServerException,
                                     ClientServerCompatibilityException,
                                     ResourceUnknownException,
                                     ClientToolkitException
Gets current time at the server.

Returns:
resource creation time.
Throws:
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.

getTerminationTime

java.util.Date getTerminationTime()
                                  throws ServerCommsException,
                                         ServerException,
                                         ResourceUnknownException,
                                         ClientServerCompatibilityException,
                                         ClientToolkitException
Gets the resource's current termination time.

Returns:
resource termination time, or null if no termination time has been set. If no termination time has been set the resource is currently configured to live forever.
Throws:
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.

getActivityDetails

ActivitiesMetaData getActivityDetails()
                                      throws ServerCommsException,
                                             ServerException,
                                             ResourceUnknownException,
                                             ClientServerCompatibilityException,
                                             ClientToolkitException
Gets details of the activities that can be targeted at this resource.

Returns:
details of the activities that can target this resource.
Throws:
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.

setTimeout

void setTimeout(int timeout)
Sets the timeout to use for calls to this resource.

Parameters:
timeout - timeout in milliseconds.

addServerCommsProperty

void addServerCommsProperty(java.lang.String propertyName,
                            java.lang.Object value)
Adds a server communications property to the resource. This property specifies how the client communicates with the server. Server communications properties are usually specific to the server implementation.

Parameters:
propertyName - name of the property
value - property value