Table of Contents

Class: Perspective | Twisted-0.17.4/twisted/cred/perspective.py
--- | ---

### I am an Identity's view onto a service.

I am the interface through which most `external` code should interact with a service; I represent the actions a user may perform upon a service, and the state associated with that user for that service.

Methods |
--- | ---

__init__ attached detached getIdentityRequest getPerspectiveName | getService makeIdentity setIdentity setIdentityName setService

| __init__

    __init__ (
            self,
            perspectiveName,
            identityName="Nobody",
            )

### Create me.

I require a name for myself and a reference to the service I participate in. (My identity name will be `Nobody` by default, which will normally not resolve.)

Exceptions |
--- | ---
TypeError

| attached

    attached (
            self,
            reference,
            identity,
            )

### Called when a remote reference is `attached` to me.

After being authorized, a remote actor can attach to me through its identity. This call will be made when that happens, and the return value of this method will be used as the actual perspective to which I am attached.

Note that the symmetric call, detached, will be made on whatever this method returns, not on me. Therefore, by default I return `self`.

| detached

    detached (
            self,
            reference,
            identity,
            )

### Called when a broker is `detached` from me.

See `attached`.

When a remote actor disconnects (or times out, for example, with HTTP), this is called in order to indicate that the reference associated with that peer is no longer attached to this perspective.

| getIdentityRequest

    getIdentityRequest ( self )

Request my identity.

| getPerspectiveName

    getPerspectiveName ( self )

### Return the unique name of this perspective.

This will return a value such that self.service.getPerspectiveNamed(value) is self.

(XXX: That's assuming I have been addPerspective'd to my service.)

| getService

    getService ( self )

Return a service.

| makeIdentity

    makeIdentity ( self,  password )

### Make an identity from this perspective with a password.

This is a utility method, which can be used in circumstances where the distinction between Perspective and Identity is weak, such as single-Service servers.

Exceptions |
--- | ---
TypeError

| setIdentity

    setIdentity ( self,  ident )

Determine which identity I connect to.

Exceptions |
--- | ---
TypeError

| setIdentityName

    setIdentityName ( self,  name )

Exceptions |
--- | ---
TypeError

| setService

    setService ( self,  service )

Change what service I am a part of.

Table of Contents

This document was automatically generated on Sat Apr 20 01:32:12 2002 by HappyDoc version 2.0