uk.org.ogsadai.client.toolkit.sessions
Class SessionImpl

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.sessions.SessionImpl
All Implemented Interfaces:
Session

public class SessionImpl
extends java.lang.Object
implements Session

A client-side session object contructed from a response document returned from a data service.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement.
private  DataService mDataService
          The data service that the session belongs to.
private  SessionID mSessionID
          The identifier for the session.
 
Constructor Summary
SessionImpl(DataService dataService, org.w3c.dom.Document response)
          Creates a new session object from the session element of a response document.
 
Method Summary
 SessionID getSessionID()
          Returns the identity of the session that the request was joined to.
 RequestStatus getStatus()
          Gets the status of the current request for the session.
 
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
Copyright statement.

See Also:
Constant Field Values

mSessionID

private SessionID mSessionID
The identifier for the session.


mDataService

private DataService mDataService
The data service that the session belongs to.

Constructor Detail

SessionImpl

public SessionImpl(DataService dataService,
                   org.w3c.dom.Document response)
            throws DataFormatException
Creates a new session object from the session element of a response document.

Parameters:
dataService - the data service that the session belongs to
response - the response document
Throws:
java.lang.IllegalArgumentException - if dataService is null or response is null.
DataFormatException - if response does not contain a session element.
Method Detail

getSessionID

public SessionID getSessionID()
Description copied from interface: Session
Returns the identity of the session that the request was joined to.

Specified by:
getSessionID in interface Session
Returns:
a SessionID

getStatus

public RequestStatus getStatus()
                        throws AuthorisationException,
                               ResourceUnknownException,
                               UnknownPropertyException,
                               DataFormatException,
                               ServerException,
                               ServiceCommsException
Description copied from interface: Session
Gets the status of the current request for the session.

Specified by:
getStatus in interface Session
Returns:
the status of the current request for the session.
Throws:
ServerException - If there was an error server-side.
UnknownPropertyException - If the resource has no property for the status of the current request for the session.
AuthorisationException - If the client is not authorised to access this information.
ResourceUnknownException - If the resource to which the session belongs is unknown to the service.
ServiceCommsException - If there was an error communicating with the service.
DataFormatException - If the structure of the status information from the service cannot be parsed by the client toolkit.