Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Plugins.Session.Sessions.ASession Class Reference

This is the base class for a session instance. More...

+ Inheritance diagram for Plugins.Session.Sessions.ASession:

Public Member Functions

def __init__
 Construct a new session instance. More...
 
def init
 Initializer.
 
def flush
 Flush session information to the storage medium. More...
 
def close
 Mark the end of the session. More...
 
def __del__
 Destructor.
 
def create
 Create the specified session with the specified maximum length. More...
 
def load
 Load the specified session. More...
 
def open
 Open the specified session or, if one is not specified, begin a new session. More...
 
def renew
 Renew the session. More...
 
def length
 Return the length of the session, in seconds. More...
 
def __len__
 Return the length of the session, in seconds. More...
 
def Log
 Retrieve a reference to the message log that is being used by the session to log errors and other diagnostic information. More...
 
def id
 Retrieve the session ID. More...
 
def changed
 Retrieve whether or not session information has changed. More...
 
def opened
 Retrieve the time, in seconds since the Unix epoch, at which the session began. More...
 
def closed
 Retrieve the time, in seconds since the Unix epoch, at which the session ended. More...
 
def expiration
 Retrieve the time, in seconds since the Unix epoch, at which the session will expire. More...
 
def expirationTimeStamp
 Return a string representation of the date and time at which the session will expire, formatted using the specified format. More...
 
def maxLength
 Retrieve the maximum number of seconds alotted to the session. More...
 
def hasExpired
 Determine whether or not the session has expired.
 
def Variables
 Retrieve the session variables. More...
 
def __getitem__
 Retrieve the specified item from the session keys. More...
 
def __setitem__
 Set the specified item in the session keys. More...
 
def __delitem__
 Delete the specified item from the session keys. More...
 
def __iter__
 Create an iterator for the keys in the session variables. More...
 
def iterkeys
 Create an iterator for the keys in the session variables. More...
 
def __reversed__
 Create an iterator to iterate backwards over the keys in the session variables. More...
 
def iteritems
 Create an iterator for the values in the session variables. More...
 
def itervalues
 Create an iterator the keys and values in the session variables. More...
 
def __contains__
 Determine whether or not the specified key exists in the session variables. More...
 
- Public Member Functions inherited from Library.Base.Events.ALoggingEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def error
 Generate an error event. More...
 
def log
 Log the specified item. More...
 
def Log
 Retrieve the log used by the class.
 
- Public Member Functions inherited from Library.Base.Events.AnEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def __del__
 Destructor.
 
def parseParams
 Parse the specified parameters, looking for named events and setting event handlers as appropriate. More...
 
def generate
 Generate the named event.
 
def update
 Update the events generated by the object.
 
def error
 Generate an error event. More...
 
def toString
 Construct a string representation of the object. More...
 
def on
 Set the handler for the specified event. More...
 
def onMultiple
 Set handlers for multiple events. More...
 
def handlerFor
 Retrieve the handler for the specified event. More...
 
def generates
 Determine whether or not the object generates the named event. More...
 
def __getitem__
 Retrieve the value of the named property.
 
def __setitem__
 Set the value of the named property.
 
- Public Member Functions inherited from Library.Base.Classwork.AnObject
def init
 Initialize a new object instance. More...
 
def __init__
 Construct and initialize a new instance of AnObject. More...
 
def __del__
 Destroy the object instance. More...
 
def displayName
 Construct a "pretty" display name for the class instance, based on the name of its class. More...
 
def implements
 Determine whether the class instance is related to the specified class. More...
 
def toString
 Return a string representation of the class, suitable for output to a console or text-based device. More...
 
def __str__
 Return a string representation of the class. More...
 
def classname
 Return the name of the class from which the instance was created. More...
 
def name
 Return the name of the class. More...
 
- Public Member Functions inherited from Library.String.Utilities.IsPrintable
def toString
 Return a string representation of the class conveniently. More...
 
def __str__
 Return a string representation of the class. More...
 
def printTo
 Print a string representation of the class to the specified stream. More...
 

Detailed Description

This is the base class for a session instance.

It defines the methods that are used by its descendants to manage session states and variables, which can be sourced from a file or a database or something else entirely.

Constructor & Destructor Documentation

def Plugins.Session.Sessions.ASession.__init__ (   Self,
  params 
)

Construct a new session instance.

Member Function Documentation

def Plugins.Session.Sessions.ASession.__contains__ (   Self,
  key 
)

Determine whether or not the specified key exists in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.__delitem__ (   Self,
  key 
)

Delete the specified item from the session keys.

This method is defined for the sake of convenience, so that access to session variables can be programmed as though the session instance was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.__getitem__ (   Self,
  key 
)

Retrieve the specified item from the session keys.

This method is defined for the sake of convenience, so that access to session variables can be programmed as though the session instance was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.__iter__ (   Self)

Create an iterator for the keys in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.__len__ (   Self)

Return the length of the session, in seconds.

This method is defined for convenience, so that the Python len() function can be used on a session instance. This routine simply returns the result of a call to ASession.length().

def Plugins.Session.Sessions.ASession.__reversed__ (   Self)

Create an iterator to iterate backwards over the keys in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.__setitem__ (   Self,
  key,
  value 
)

Set the specified item in the session keys.

This method is defined for the sake of convenience, so that access to session variables can be programmed as though the session instance was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.changed (   Self)

Retrieve whether or not session information has changed.

def Plugins.Session.Sessions.ASession.close (   Self)

Mark the end of the session.

This routine can be overridden by descendant classes. In its base implementation, it merely records the time that the session was closed and then calls ASession.flush()

def Plugins.Session.Sessions.ASession.closed (   Self)

Retrieve the time, in seconds since the Unix epoch, at which the session ended.

def Plugins.Session.Sessions.ASession.create (   Self,
  maxLength = 0 
)

Create the specified session with the specified maximum length.

This routine should be implemented by descendant classes. It should create the specified session and return a status code to indicate whether or not the operation was successful. A status code of zero (0) indicates success.

def Plugins.Session.Sessions.ASession.expiration (   Self)

Retrieve the time, in seconds since the Unix epoch, at which the session will expire.

def Plugins.Session.Sessions.ASession.expirationTimeStamp (   Self,
  fmt = "rfc2822" 
)

Return a string representation of the date and time at which the session will expire, formatted using the specified format.

def Plugins.Session.Sessions.ASession.flush (   Self)

Flush session information to the storage medium.

This routine is meant to be overridden by descendant classes. It is called automatically by the destructor method. The routine should write pertinent session information to the storage medium and return a status code to indicate whether such a write was successful. If the routine indicates failure, a warning message will be logged by the destructor.

A return value of zero (0) indicates success. Any other value is indicative of an error.

def Plugins.Session.Sessions.ASession.id (   Self)

Retrieve the session ID.

def Plugins.Session.Sessions.ASession.iteritems (   Self)

Create an iterator for the values in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.iterkeys (   Self)

Create an iterator for the keys in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.itervalues (   Self)

Create an iterator the keys and values in the session variables.

This routine is provided for convenience, so that access to the items in the session can be programmed as though the session was a native Python dictionary object.

def Plugins.Session.Sessions.ASession.length (   Self)

Return the length of the session, in seconds.

If the session has ended, this routine returns the amount of time that the session was active. If the session has not ended, this routine calculates the amount of time that has elapsed since the session began.

def Plugins.Session.Sessions.ASession.load (   Self,
  sid = None 
)

Load the specified session.

This routine should be implemented by descendant classes. It should load the specified session and set the session variables.

A status code should be returned to indicate whether the load was successful. A value of zero (0) indicates success.

def Plugins.Session.Sessions.ASession.Log (   Self)

Retrieve a reference to the message log that is being used by the session to log errors and other diagnostic information.

def Plugins.Session.Sessions.ASession.maxLength (   Self)

Retrieve the maximum number of seconds alotted to the session.

def Plugins.Session.Sessions.ASession.open (   Self,
  maxLength = 0,
  sid = None 
)

Open the specified session or, if one is not specified, begin a new session.

This routine should be overridden by descendant classes, where it can load session information from a stream or data source, establish session variables, and so forth. It should return the session ID if the session was successfully opened, or None if not.

def Plugins.Session.Sessions.ASession.opened (   Self)

Retrieve the time, in seconds since the Unix epoch, at which the session began.

def Plugins.Session.Sessions.ASession.renew (   Self)

Renew the session.

This routine extends the expiration time of the session by resetting its opened and closed attributes. The opened attribute is set to the present time and the closed attribute is reset to zero (0).

def Plugins.Session.Sessions.ASession.Variables (   Self)

Retrieve the session variables.


The documentation for this class was generated from the following file: