VLab Common 1.2

pl.psnc.vlab.management.session
Class SessionFactory

java.lang.Object
  extended by pl.psnc.vlab.management.session.SessionFactory

public class SessionFactory
extends java.lang.Object

Factory which is used to retrieve current session information

Author:
Dominik Stoklosa (~osa~)

Constructor Summary
SessionFactory()
           
 
Method Summary
static SessionValue getSessionInstance()
          Gets the session information object from the VLab system.
static SessionValue getSessionValue()
          Get the session value object.
static boolean isSessionValid()
          Check whether the current session is valid.
static boolean removeSession()
          Delete session from the database by the given session key
static boolean updateSession()
          Update timestamp in the current session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactory

public SessionFactory()
Method Detail

getSessionValue

public static SessionValue getSessionValue()
                                    throws VlabException
Get the session value object. If the session value object is null it will be retrieved from the VLab system.

Returns:
session value object
Throws:
VlabException - if the session is not valid exception will be thrown

getSessionInstance

public static SessionValue getSessionInstance()
                                       throws VlabException
Gets the session information object from the VLab system.

Returns:
session value object
Throws:
VlabException - if the session is not valid exception will be thrown

isSessionValid

public static boolean isSessionValid()
                              throws VlabException
Check whether the current session is valid. The session is valid if the following condition is true: current_timestamp < last_valid_timestamp + timestamp_limit timestamp_limit is stored in the VLab database and managed by the VLab portal.

Returns:
true if the session is valid false otherwise
Throws:
VlabException - if the session is not valid exception will be thrown

removeSession

public static boolean removeSession()
                             throws VlabException
Delete session from the database by the given session key

Returns:
true if the operation succeeds false otherwise
Throws:
VlabException - if the session is not valid exception will be thrown

updateSession

public static boolean updateSession()
                             throws VlabException
Update timestamp in the current session

Returns:
true if the operation succeeds false otherwise
Throws:
VlabException - if the session is not valid exception will be thrown

VLab Common 1.2

Copyright 2004 by VLAB Dominik Stoklosa.