uk.org.ogsadai.sessions.impl
Class ReferenceSessionStrategy

java.lang.Object
  |
  +--uk.org.ogsadai.sessions.impl.ReferenceSessionStrategy
All Implemented Interfaces:
SessionStrategy

public class ReferenceSessionStrategy
extends java.lang.Object
implements SessionStrategy

A SessionStrategy that retrieves an existing Session from a SessionManager.

This strategy performs no lifetime management duties - it is assumed that the necessary measures were taken when the session was first created.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private static DAILogger LOG
           
private  SessionID mSessionID
           
 
Constructor Summary
ReferenceSessionStrategy(SessionID sessionID)
          Creates a new strategy to access the specified existing session.
 
Method Summary
 InternalSession obtainSession(SessionManager manager)
          Uses the session manager to create a new session or access an existing session, depending on the session requirements built into the strategy.
 
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

LOG

private static final DAILogger LOG

mSessionID

private final SessionID mSessionID
Constructor Detail

ReferenceSessionStrategy

public ReferenceSessionStrategy(SessionID sessionID)
Creates a new strategy to access the specified existing session.

Parameters:
sessionID - The identifier for the pre-existing session to be obtained.
Throws:
java.lang.IllegalArgumentException - if the argument is null.
Method Detail

obtainSession

public InternalSession obtainSession(SessionManager manager)
                              throws SessionCreationException,
                                     SessionLookupException,
                                     SessionNotFoundException
Description copied from interface: SessionStrategy
Uses the session manager to create a new session or access an existing session, depending on the session requirements built into the strategy.

An implementation of this method should also take necessary measures to ensure that the session ends at the appropriate point, such as after a certain time has passed.

Specified by:
obtainSession in interface SessionStrategy
Parameters:
manager - The SessionManagement to use for interactions.
Returns:
A SessionAccess object to the session thus obtained.
Throws:
SessionNotFoundException - if a specific named session does not exist.
SessionCreationException - if some problem arises when creating a new session.
SessionLookupException - if some problem arises when accessing an existing session.