uk.org.ogsadai.examples.clienttoolkit
Class UsingSessionsExample

java.lang.Object
  |
  +--uk.org.ogsadai.examples.clienttoolkit.UsingSessionsExample

public class UsingSessionsExample
extends java.lang.Object

This example shows how the client toolkit can specify session requirements, determine what session a request was joined to and access the session request status property.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static java.lang.String RESOURCE_NAME
          Name of data service resource used for this example.
private static java.lang.String SERVICE_HANDLE
          Handle used in the client toolkit examples.
 
Constructor Summary
UsingSessionsExample()
           
 
Method Summary
private static Session createNewSession(DataService service)
          Sends an empty request to a data service resource instructing the creation of a new session with default settings.
private static void joinExistingSession(DataService service, Session session)
          Sends a request to a data service resource to join a particular session.
private static void joinImplictSession(DataService service)
          Sends a request which joins an implicit session then displays the identity of the session from the response.
static void main(java.lang.String[] args)
           
private static void terminateSession(DataService service, Session session)
          Sends a request to a data service resource instructing it to terminate a specific 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
See Also:
Constant Field Values

SERVICE_HANDLE

private static final java.lang.String SERVICE_HANDLE
Handle used in the client toolkit examples.

See Also:
Constant Field Values

RESOURCE_NAME

private static final java.lang.String RESOURCE_NAME
Name of data service resource used for this example.

See Also:
Constant Field Values
Constructor Detail

UsingSessionsExample

public UsingSessionsExample()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception

joinImplictSession

private static void joinImplictSession(DataService service)
                                throws java.lang.Exception
Sends a request which joins an implicit session then displays the identity of the session from the response.

Parameters:
service - a data service configured to access a particular data service resource
Throws:
java.lang.Exception - if anything goes wrong

createNewSession

private static Session createNewSession(DataService service)
                                 throws java.lang.Exception
Sends an empty request to a data service resource instructing the creation of a new session with default settings. Note that activities could also be included in the request if desired.

Parameters:
service - a data service configured to access a particular data service resource
Returns:
a client-side Session object
Throws:
java.lang.Exception - if anything goes wrong

joinExistingSession

private static void joinExistingSession(DataService service,
                                        Session session)
                                 throws java.lang.Exception
Sends a request to a data service resource to join a particular session.

Parameters:
service - a data service configured to access a particular data service resource
session - the session for the request to be joined to
Throws:
java.lang.Exception - if anything goes wrong

terminateSession

private static void terminateSession(DataService service,
                                     Session session)
                              throws java.lang.Exception
Sends a request to a data service resource instructing it to terminate a specific session. Note that activities could also be included in the request if desired.

Parameters:
service - a data service configured to access a particular data service resource
session - the session for the request to be joined to
Throws:
java.lang.Exception - if anything goes wrong