Naanou.ResourceExchange
Class NaanouSessionManager

Manages user sessions

Field Summary
bool autoCreate
Naanou.ResourceExchange.IUserDirectory directory
int gcMaxLifeTime
int gcProbability
string name
ClintHeyer.Httpd.Server server
System.Collections.Hashtable sessions

Constructor Summary
NaanouSessionManager(ClintHeyer.Httpd.Server server, Naanou.ResourceExchange.IUserDirectory directory, bool what, bool where)
         Constructor

Property Summary
bool AutoCreate
         Gets or sets whether sessions are automatically created
int GcMaxLifeTime
         Gets or sets the maximum number of secounds after which the session will be GC'd
int GcProbability
         Gets or sets the probability of GC'ing for each request
string Name
         Gets or sets the name for session

Method Summary
void Close(ClintHeyer.Httpd.HttpSession session)
         Closes a session from the manager's end (does not call Close or End on the session itself)
ClintHeyer.Httpd.HttpSession Create(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.Connection connection)
         Creates a session, Returns null if could not be created
void GC()
ClintHeyer.Httpd.HttpSession Get(ClintHeyer.Httpd.HttpRequest request, ClintHeyer.Httpd.Connection connection)
         Creates a new session for a connection (if AutoCreate is true), or gets an existing session. Returns null if it could not be created
void Store(ClintHeyer.Httpd.HttpSession session)
         Store session - when session is no longer used

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Field Detail

autoCreate

private bool autoCreate


directory

private Naanou.ResourceExchange.IUserDirectory directory


gcMaxLifeTime

private int gcMaxLifeTime


gcProbability

private int gcProbability


name

private string name


server

private ClintHeyer.Httpd.Server server


sessions

private System.Collections.Hashtable sessions

Constructor Detail

NaanouSessionManager

internal NaanouSessionManager(ClintHeyer.Httpd.Server server,
                              Naanou.ResourceExchange.IUserDirectory directory,
                              bool what,
                              bool where)

Constructor

Parameters:
server - Server
directory - Directory
what - nothing
Property Detail

AutoCreate

public bool AutoCreate

Gets or sets whether sessions are automatically created


GcMaxLifeTime

public int GcMaxLifeTime

Gets or sets the maximum number of secounds after which the session will be GC'd


GcProbability

public int GcProbability

Gets or sets the probability of GC'ing for each request


Name

public string Name

Gets or sets the name for session

Method Detail

Close

public void Close(ClintHeyer.Httpd.HttpSession session)

Closes a session from the manager's end (does not call Close or End on the session itself)

Parameters:
session - Session

Create

public ClintHeyer.Httpd.HttpSession Create(ClintHeyer.Httpd.HttpRequest request,
                                           ClintHeyer.Httpd.Connection connection)

Creates a session, Returns null if could not be created

Parameters:
request -
connection -
Returns:

GC

private void GC()


Get

public ClintHeyer.Httpd.HttpSession Get(ClintHeyer.Httpd.HttpRequest request,
                                        ClintHeyer.Httpd.Connection connection)

Creates a new session for a connection (if AutoCreate is true), or gets an existing session. Returns null if it could not be created

Parameters:
request - Request
connection - Connection, or null if it couldnt be created/found
Returns:
Session

Store

public void Store(ClintHeyer.Httpd.HttpSession session)

Store session - when session is no longer used

Parameters:
session -