Package g4ds :: Module communitymanager :: Class MemberManager
[show private | hide private]
[frames | no frames]

Class MemberManager


Managing information about members of communities

Connected to a database. All the data is loaded into the memory at startup time. Changes are written through directly.
Method Summary
  __init__(self, loadFromDatabase)
Initialises the member manager.
  __str__(self)
Some basic information about the object
  addMember(self, member, persistent, storeCommunityRelations)
Adds a member instance to the dictionary.
Member getLocalMember(self)
Returns the member instance for the local node.
Member getMember(self, memberId)
Get the member with the given ID from the repository.
  getMemberIds(self)
Provides a list with IDs of all members stored in the repository.
Member updateMember(self, member, updateCommunityRelations)
Updates the member information for the object in the member manager with the same member id.

Instance Variable Summary
communitymanager_db.CM_DB _cm_db: Community Manager Database Connector
Boolean _dbconnected: Indicates, whether the manager is connected to a database; hence whether the changes shall be written through
Dict of String | Member _members: Dictionary with all known members (key is the id, value a Member instance)

Method Details

__init__(self, loadFromDatabase=0)
(Constructor)

Initialises the member manager.

__str__(self)
(Informal representation operator)

Some basic information about the object

addMember(self, member, persistent=1, storeCommunityRelations=0)

Adds a member instance to the dictionary.
Parameters:
member - Member to be added
           (type=Member)
persistent - Indicates, whether the member shall be written through to the database
           (type=Boolean)
storeCommunityRelations - When persistent is true, shall the relations be saved in the db too?
           (type=Boolean)

getLocalMember(self)

Returns the member instance for the local node.
Returns:
Member with the ID as provided in the config file
           (type=Member)

getMember(self, memberId)

Get the member with the given ID from the repository.
Parameters:
memberId - ID for the member to return
           (type=String)
Returns:
Member with the given ID
           (type=Member)

getMemberIds(self)

Provides a list with IDs of all members stored in the repository.

return: List of IDs of all known members. rtype: List of String

updateMember(self, member, updateCommunityRelations)

Updates the member information for the object in the member manager with the same member id.

If no member with the given id is in the manager, a new member will be created. All changes are written through to the database if connected.
Parameters:
member - Reference to the new or updated member instance
           (type=Member)
Returns:
Reference to the member object stored in the manager
           (type=Member)

Instance Variable Details

_cm_db

Community Manager Database Connector
Type:
communitymanager_db.CM_DB

_dbconnected

Indicates, whether the manager is connected to a database; hence whether the changes shall be written through
Type:
Boolean

_members

Dictionary with all known members (key is the id, value a Member instance)
Type:
Dict of String | Member

Generated by Epydoc 2.0 on Sat Oct 22 22:52:47 2005 http://epydoc.sf.net