Class n.g.GuardSession(components.Componentized):

Part of nevow.guard View Source View In Hierarchy

Implements interfaces: nevow.inevow.IGuardSession, nevow.inevow.ISession

A user's session with a system.

This utility class contains no functionality, but is used to represent a session.

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
48 Method __init__ Initialize a session with a unique ID for that session.
62 Method getLoggedInRoot Get the most-recently-logged-in avatar.
70 Method resourceForPortal Undocumented
73 Method setDefaultResource Change the root-resource available to the user who has already
89 Method setResourceForPortal Change the root-resource available to a user authenticating against a given
104 Method portalLogout If we have previously acccepted a login for this portal, call its
126 Method setLifetime Set the approximate lifetime of this session, in seconds.
136 Method notifyOnExpire Call this callback when the session expires or logs out.
141 Method expire Expire/logout of the session.
161 Method touch Undocumented
164 Method checkExpired Undocumented
178 Method __getstate__ Get state, adding a version number to it on its way out.
184 Method __setstate__ Undocumented

Inherited from Componentized:

Line # Kind Name Docs
206 Method locateAdapterClass Undocumented
209 Method setAdapter Undocumented
212 Method addAdapter Utility method that calls addComponent. I take an adapter class and
222 Method setComponent Undocumented
227 Method addComponent Add a component to me, for all appropriate interfaces.
249 Method unsetComponent Remove my component specified by the given interface class.
253 Method removeComponent Remove the given component from me entirely, for all interfaces for which
267 Method getComponent Create or retrieve an adapter for the given interface.
300 Method __conform__ Undocumented

Inherited from Versioned (via Componentized):

Line # Kind Name Docs
207 Method versionUpgrade (internal) Do a version upgrade.
Line # Kind Name Docs
300 Method __conform__ Undocumented
178 Method __getstate__ Get state, adding a version number to it on its way out.
48 Method __init__ Initialize a session with a unique ID for that session.
184 Method __setstate__ Undocumented
212 Method addAdapter Utility method that calls addComponent. I take an adapter class and
227 Method addComponent Add a component to me, for all appropriate interfaces.
164 Method checkExpired Undocumented
141 Method expire Expire/logout of the session.
267 Method getComponent Create or retrieve an adapter for the given interface.
62 Method getLoggedInRoot Get the most-recently-logged-in avatar.
206 Method locateAdapterClass Undocumented
136 Method notifyOnExpire Call this callback when the session expires or logs out.
104 Method portalLogout If we have previously acccepted a login for this portal, call its
253 Method removeComponent Remove the given component from me entirely, for all interfaces for which
70 Method resourceForPortal Undocumented
209 Method setAdapter Undocumented
222 Method setComponent Undocumented
73 Method setDefaultResource Change the root-resource available to the user who has already
126 Method setLifetime Set the approximate lifetime of this session, in seconds.
89 Method setResourceForPortal Change the root-resource available to a user authenticating against a given
161 Method touch Undocumented
249 Method unsetComponent Remove my component specified by the given interface class.
207 Method versionUpgrade (internal) Do a version upgrade.
def __init__(self, guard, uid): (source)
Initialize a session with a unique ID for that session.
def getLoggedInRoot(self): (source)
Get the most-recently-logged-in avatar.
def resourceForPortal(self, port): (source)
Undocumented
def setDefaultResource(self, rsrc, logout): (source)
Change the root-resource available to the user who has already authenticated anonymously. This only works in applications that DO NOT use the multiple-simultaneous-portals feature. If you do not know what this means, you may safely ignore it.
def setResourceForPortal(self, rsrc, port, logout): (source)

Change the root-resource available to a user authenticating against a given portal.

If a user was already logged in to this session from that portal, first log them out.
Parametersrsrcan IResource implementor.
porta cred Portal instance.
logouta 0-arg callable to be invoked upon logout.
def portalLogout(self, port): (source)

If we have previously acccepted a login for this portal, call its logout method and de-associate that portal from this session, catching any errors from the logout method.

Otherwise: do nothing.
Parametersporta cred Portal.
def setLifetime(self, lifetime): (source)

Set the approximate lifetime of this session, in seconds.

This is highly imprecise, but it allows you to set some general parameters about when this session will expire. A callback will be scheduled each 'lifetime' seconds, and if I have not been 'touch()'ed in half a lifetime, I will be immediately expired.
def notifyOnExpire(self, callback): (source)
Call this callback when the session expires or logs out.
def expire(self): (source)
Expire/logout of the session.
def touch(self): (source)
Undocumented
def checkExpired(self): (source)
Undocumented
def __getstate__(self): (source)
Get state, adding a version number to it on its way out.
def __setstate__(self, d): (source)
Undocumented
API Documentation for Nevow, generated by pydoctor.