I represent a set of abstractions which users may interact with over a
specified protocol.
Methods
|
|
|
|
__init__
|
__init__ (
self,
serviceName,
application=None,
)
Create me, attached to the given application.
Arguments: application, a twisted.internet.app.Application instance.
Exceptions
|
|
TypeError( "%s is not a string." % serviceName )
|
|
|
addPerspective
|
addPerspective ( self, perspective )
Add a perspective to this Service.
|
|
cachePerspective
|
cachePerspective ( self, perspective )
Cache a perspective loaded from an external data source.
Perspectives that were loaded from memory will not be uncached.
|
|
createPerspective
|
createPerspective ( self, name )
Create a perspective from self.perspectiveClass and add it to this service.
|
|
getPerspectiveNamed
|
getPerspectiveNamed ( self, name )
Return a perspective that represents a user for this service. (DEPRECATED)
Raises a KeyError if no such user exists. Override this method to
provide dynamic instantiation of perspectives. It is only deprecated
to call this method directly, not to override it; when you need to get
a Perspective, call getPerspectiveRequest.
|
|
getPerspectiveRequest
|
getPerspectiveRequest ( self, name )
Return a Deferred which is a request for a perspective on this service.
|
|
getServiceName
|
getServiceName ( self )
The name of this service.
|
|
getServiceType
|
getServiceType ( self )
Get a string describing the type of this service.
|
|
loadPerspective
|
loadPerspective ( self, name )
Load a perspective from an external data-source.
If no such data-source exists, return None. Implement this if you want
to load your perspectives from somewhere else (e.g. LDAP or a
database). It is not recommended to call this directly, since
getPerspectiveRequest provides management of caching perspectives.
|
|
setApplication
|
setApplication ( self, application )
Exceptions
|
|
RuntimeError( "Application already set!" )
TypeError( "%s is not an Application" % application )
|
|
|
startService
|
startService ( self )
This call is made as a service starts up.
|
|
stopService
|
stopService ( self )
This call is made before shutdown.
|
|
uncachePerspective
|
uncachePerspective ( self, perspective )
Uncache a perspective loaded from an external data source.
Perspectives that were loaded from memory will not be uncached.
|