Package twisted :: Package web :: Package woven :: Module guard :: Class GuardSession

[frames | no frames]

## Class GuardSession

    Versioned --+
                |
    Componentized --+
                    |
                   GuardSession

A user's session with a system.

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

Method Summary
| ``__init__`(self, guard, uid)` Initialize a session with a unique ID for that session.
| `__getstate__(self)`
| `__setstate__(self, d)`
| `_getSelf(self, interface)`
| `checkExpired(self)`
| `clientForService(self, service)`
| ``expire`(self)` Expire/logout of the session.
| ``notifyOnExpire`(self, callback)` Call this callback when the session expires or logs out.
| `portalLogout(self, port)`
| `resourceForPortal(self, port)`
| `setClientForService(self, ident, perspective, client, service)`
| ``setLifetime`(self, lifetime)` Set the approximate lifetime of this session, in seconds.
| `setResourceForPortal(self, rsrc, port, logout)`
| `touch(self)`
Inherited from Componentized
| ``addAdapter`(self, adapterClass, ignoreClass, registry)` Utility method that calls addComponent.
| ``addComponent`(self, component, ignoreClass, registry)` Add a component to me, for all appropriate interfaces.
| ``getComponent`(self, interface, registry, default)` Create or retrieve an adapter for the given interface.
| ``locateAdapterClass`(self, klass, interfaceClass, default, registry)`
| ``removeComponent`(self, component)` Remove the given component from me entirely, for all interfaces for which it has been registered.
| ``setAdapter`(self, interfaceClass, adapterClass)`
| ``setComponent`(self, interfaceClass, component)`
| ``unsetComponent`(self, interfaceClass)` Remove my component specified by the given interface class.
| ``upgradeToVersion1`(self)`
Inherited from Versioned
| ``versionUpgrade`(self)` (internal) Do a version upgrade.

Class Variable Summary
Inherited from Componentized
`int` | `persistenceVersion` = 1
Inherited from Versioned
`tuple` | `persistenceForgets` = `()`

Method Details

### __init__(self, guard, uid)
(Constructor)

Initialize a session with a unique ID for that session.

  Overrides:
    `twisted.python.components.Componentized.__init__`

### expire(self)

Expire/logout of the session.

### notifyOnExpire(self, callback)

Call this callback when the session expires or logs out.

### setLifetime(self, lifetime)

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.

Generated by Epydoc 2.0 on Sat May 15 20:08:39 2004 | http://epydoc.sf.net